くろひょうのぶろぐ

macOSにGrafanaをインストールする
2021-05-20 22:49 ( edited 2021-05-21 23:03 )

最近、macOSを使い始めたのですが操作に不慣れなので備忘録として。

Grafanaのインストール

% brew install grafana
% /opt/homebrew/bin/grafana-cli --version
Grafana CLI version 7.5.6
% brew services list          
Name    Status  User Plist
grafana stopped      
% brew services start grafana
==> Successfully started `grafana` (label: homebrew.mxcl.grafana)
% brew services list         
Name    Status  User         Plist
grafana started <User> /Users/<User>/Library/LaunchAgents/homebrew.mxcl.grafana.plist

プラグインのインストール

% sudo grafana-cli plugins install simpod-json-datasource
Password:
installing simpod-json-datasource @ 0.2.4
from: https://grafana.com/api/plugins/simpod-json-datasource/versions/0.2.4/download
into: /usr/local/var/lib/grafana/pluginsInstalled simpod-json-datasource successfully 

Restart grafana after installing plugins . <service grafana-server restart>
% grafana-cli plugins ls
installed plugins:
simpod-json-datasource @ 0.2.4

Restart grafana after installing plugins . <service grafana-server restart>
 % ls /usr/local/var/lib/grafana/plugins
simpod-json-datasource
% vim /opt/homebrew/etc/grafana/grafana.ini
% diff /opt/homebrew/etc/grafana/grafana.ini /opt/homebrew/etc/grafana/grafana.ini.example 
24c24
< plugins = /usr/local/var/lib/grafana/plugins
---
> ;plugins = /var/lib/grafana/plugins
% brew services restart  grafana
Stopping `grafana`... (might take a while)
==> Successfully stopped `grafana` (label: homebrew.mxcl.grafana)
==> Successfully started `grafana` (label: homebrew.mxcl.grafana)

環境

% sw_vers
ProductName:    macOS
ProductVersion: 11.3
BuildVersion:   20E232
% uname -smrv
Darwin 20.4.0 Darwin Kernel Version 20.4.0: Fri Mar  5 01:14:02 PST 2021; root:xnu-7195.101.1~3/RELEASE_ARM64_T8101 arm64
% brew --version
Homebrew 3.1.8
Homebrew/homebrew-core (git revision bb253be1f4; last commit 2021-05-20)
Homebrew/homebrew-cask (git revision 7ab1876ed3; last commit 2021-05-20)
# Grafana # macOS