mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
baa32adc47
* deployment: create a separate env for VictoriaLogs The new environment consists of the following components: * VictoriaLogs * fluentbit for collecting logs and sending to VictoriaLogs * VictoriaMetrics for scraping and storing metrics from fluentbit and VictoriaLogs * Grafana with VictoriaLogs datasource for monitoring ----------------- The motivation for creating a separate environment is to simplify existing environments and make it easier to update or modify them in future. Signed-off-by: hagen1778 <roman@victoriametrics.com>
23 lines
883 B
Bash
Executable File
23 lines
883 B
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
VM_DS_PATH='/var/lib/grafana/plugins/victoriametrics-datasource'
|
|
PLUGIN_PATH='/var/lib/grafana/plugins'
|
|
|
|
if [[ -f ${VM_DS_PATH}/plugin.json ]]; then
|
|
ver=$(cat ${VM_DS_PATH}/plugin.json)
|
|
if [[ ! -z "$ver" ]]; then
|
|
exit
|
|
fi
|
|
fi
|
|
|
|
echo "VictoriaMetrics datasource is not installed. Installing datasource..."
|
|
rm -rf ${VM_DS_PATH}/* || true
|
|
mkdir -p ${VM_DS_PATH}
|
|
|
|
export LATEST_VERSION=$(curl https://api.github.com/repos/VictoriaMetrics/grafana-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1); \
|
|
curl -L https://github.com/VictoriaMetrics/grafana-datasource/releases/download/${LATEST_VERSION}/victoriametrics-datasource-${LATEST_VERSION}.tar.gz -o ${PLUGIN_PATH}/plugin.tar.gz && \
|
|
tar -xzf ${PLUGIN_PATH}/plugin.tar.gz -C ${PLUGIN_PATH}
|
|
echo "VictoriaMetrics datasource has been installed."
|
|
rm ${PLUGIN_PATH}/plugin.tar.gz
|