環境:
OS:Centos 7/Centos 6
先去官網手動下載rpm的安裝包 然后放到服務器中
安裝grafana
1.安裝
1 [root@localhost soft]# rpm -ivh 安裝包 2 warning: grafana-5.2.1-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY 3 error: Failed dependencies: 4 urw-fonts is needed by grafana-5.2.1-1.x86_64 5 [root@localhost soft]# yum -y install urw-fonts
1 warning: grafana-5.2.1-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY 2 error: Failed dependencies: 3 urw-fonts is needed by grafana-5.2.1-1.x86_64
這個報錯主要關注urw-fonts
所以只需要安裝依賴件就可以了。缺什么就安裝什么
yum install -y urw-fonts
2.啟動之
1 [root@localhost soft]# service grafana-server start 2 查看3000端口 3 [root@localhost soft]# ss -nlp|grep 3000 4 tcp LISTEN 0 128 :::3000 :::* users:(("grafana-server",pid=16246,fd=8))
3.界面訪問
http://192.168.1.118:3000/login
初始賬號密碼為admin/admin
登陸要求修改密碼,我這里修改為admin123
升級
1.下載要升級的rpm包
wget https://dl.grafana.com/oss/release/grafana-6.1.6-1.x86_64.rpm
下載地址如下:
https://grafana.com/grafana/download
選擇oss版本:
注意:升級前記得先備份下源文件,安全第一
備份下文件夾
1 cp -rp /data/grafana /data/grafana_$(date +%Y%m%d%H%M) 2 cp -rp /usr/share/grafana /usr/share/grafana_$(date +%Y%m%d%H%M) 3 cp -rp /etc/grafana /etc/grafana_$(date +%Y%m%d%H%M)
2.停掉原來的服務
[root@localhost soft]# service grafana-server stop
3.直接升級
rpm -Uvh grafana-6.1.6-1.x86_64.rpm
這里安裝后會自動啟動了,不需要手工啟動
4.升級后可以回退
1 rpm -Uvh grafana-8.1.3-1.x86_64.rpm ##升級到8.1.3 2 rpm -Uvh --oldpackage grafana-6.1.6-1.x86_64.rpm ##回退到原來版本
如何查看自己安裝了哪些插件?
grafana-cli plugins ls grafana-cli -h 可以查看使用的幫助信息 GLOBAL OPTIONS: --pluginsDir value Path to the Grafana plugin directory (default: "/var/lib/grafana/plugins") [$GF_PLUGIN_DIR] --repo value URL to the plugin repository (default: "https://grafana.com/api/plugins") [$GF_PLUGIN_REPO] --pluginUrl value Full url to the plugin zip file instead of downloading the plugin from grafana.com/api [$GF_PLUGIN_URL] --insecure Skip TLS verification (insecure) (default: false) --debug Enable debug logging (default: false) --configOverrides value Configuration options to override defaults as a string. e.g. cfg:default.paths.log=/dev/null --homepath value Path to Grafana install/home path, defaults to working directory --config value Path to config file --help, -h show help (default: false) --version, -v print the version (default: false)