8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GrafanaでOCI Monitoringのメトリクスを可視化してみた

Last updated at Posted at 2019-03-17

2019/03/17 新規作成
2019/03/19 更新(【補】にoci cliで行うパターンを追加、「その他」にコンパートメントの指定方法を追加)


Oracle Cloud Infrastructure(OCI)のMonitoringがGrafanaと連携できると聞いたのでやってみました。

0.はじめに

前提

  • Grafana環境はイチから構築
    • 既存のGrafanaにOCi pluginを入れるパターンではない
  • GrafanaサーバーはOCI Computeサービスで構築
    • VCNやInternet Gateway等の設定は完了済み
    • ComputeインスタンスはVM.Standard2.1(Oracle Linux 7.6)を使用
    • 非OCI上のGrafanaでのやり方については、「【補】非OCI上のGrafanaとOCIとの連携)」に記載
  • ociのplug inを使うにはGrafana 6.0以上である必要がある

宿題

非OCI環境に構築したGrafanaとの連携
OCIのcomputeインスタンス以外の環境でGrafanaを使っている場合、oci cliを利用してOCI monitoringサービスから情報を採ってくる必要があるが、そのやり方がうまくいってない。
@mmarukaw氏に教えていただいた記事を参考にしたら成功しました!(感謝)

OCI Monitoringサービスとは

  • OCIのサービスを監視できるサービス
  • OCIサービスごとにメトリクスが用意されている
    • ComputeインスタンスのCPU/メモリ使用率や、LBで処理したパケット数など
  • 管理コンソール上のグラフに表示したり、アラート生成したり出来る

要するに、CloudwatchのOracle Cloud版。

・参考リンク
- Announcing Oracle Cloud Infrastructure Monitoring
- Monitoring Overview

Grafanaとは

OCI Monitoringを含む様々なサービスが生成・保存したメトリクスをいい感じに可視化+分析できるオープンソースなツール。

・参考リンク
- Grafana Features
- 10分で理解するGrafana

1.Grafana環境の準備

1-1.セキュリティまわりの設定

OCIでは、セキュリティリストおよびOSのパケットフィルタのデフォルトの設定で、22番以外のポートが閉じられています。Grafanaは3000番ポートをデフォルトで使うようなので、このポートを開けます。

クラウドのセキュリティ設定

OCIの場合「セキュリティリスト」がファイアーウォールの役割を果たしています。
ここで、ingressにstatefulで3000番ポートを開放しておきます。

~詳細省略~

OSのセキュリティ設定

OCIの場合、デフォルトでOSのパケットフィルタ設定が有効化されています。
Oracle Linux 7.xの場合はfirewalldで3000番ポートを許可します。

sudo firewall-cmd --permanent --add-port=3000/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

1-2.Grafanaインストール

公式DocのGetting startedおよびInstalling on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)に従ってインストール

yumでインストール

grafanaの6.0以上をyumでインストール

sudo yum install https://dl.grafana.com/oss/release/grafana-6.0.1-1.x86_64.rpm


yum installのログ
[opc@instance ~]$ sudo yum install https://dl.grafana.com/oss/release/grafana-6.0.1-1.x86_64.rpm
Loaded plugins: langpacks, ulninfo
grafana-6.0.1-1.x86_64.rpm                               |  53 MB     00:00
Examining /var/tmp/yum-root-HDSnP7/grafana-6.0.1-1.x86_64.rpm: grafana-6.0.1-1.x86_64
Marking /var/tmp/yum-root-HDSnP7/grafana-6.0.1-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package grafana.x86_64 0:6.0.1-1 will be installed
--> Processing Dependency: fontconfig for package: grafana-6.0.1-1.x86_64
ol7_UEKR5                                                | 2.5 kB     00:00
ol7_addons                                               | 2.5 kB     00:00
ol7_developer                                            | 2.5 kB     00:00
ol7_developer_EPEL                                       | 2.5 kB     00:00
ol7_ksplice                                              | 2.5 kB     00:00
ol7_latest                                               | 3.0 kB     00:00
ol7_optional_latest                                      | 2.5 kB     00:00
ol7_software_collections                                 | 2.5 kB     00:00
(1/14): ol7_UEKR5/x86_64/updateinfo                        |  31 kB   00:00
(2/14): ol7_addons/x86_64/updateinfo                       |  57 kB   00:00
(3/14): ol7_ksplice/primary_db                             | 524 kB   00:00
(4/14): ol7_latest/x86_64/group_gz                         | 148 kB   00:00
(5/14): ol7_UEKR5/x86_64/primary_db                        | 4.0 MB   00:00
(6/14): ol7_latest/x86_64/updateinfo                       | 853 kB   00:00
(7/14): ol7_addons/x86_64/primary_db                       | 107 kB   00:00
(8/14): ol7_developer_EPEL/x86_64/primary_db               | 9.9 MB   00:00
(9/14): ol7_developer/x86_64/primary_db                    | 317 kB   00:00
(10/14): ol7_latest/x86_64/primary_db                      |  15 MB   00:00
(11/14): ol7_optional_latest/x86_64/primary_db             | 3.4 MB   00:00
(12/14): ol7_optional_latest/x86_64/updateinfo             | 664 kB   00:00
(13/14): ol7_software_collections/updateinfo               | 8.6 kB   00:00
(14/14): ol7_software_collections/primary_db               | 4.5 MB   00:00
--> Processing Dependency: urw-fonts for package: grafana-6.0.1-1.x86_64
--> Running transaction check
---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed
--> Processing Dependency: dejavu-sans-fonts for package: fontconfig-2.13.0-4.3.el7.x86_64
---> Package urw-fonts.noarch 0:2.4-16.el7 will be installed
--> Processing Dependency: xorg-x11-font-utils for package: urw-fonts-2.4-16.el7.noarch
--> Running transaction check
---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch
---> Package xorg-x11-font-utils.x86_64 1:7.5-21.el7 will be installed
--> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-21.el7.x86_64
--> Running transaction check
---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed
---> Package libfontenc.x86_64 0:1.1.3-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch    Version            Repository                Size
================================================================================
Installing:
 grafana              x86_64  6.0.1-1            /grafana-6.0.1-1.x86_64  154 M
Installing for dependencies:
 dejavu-fonts-common  noarch  2.33-6.el7         ol7_latest                64 k
 dejavu-sans-fonts    noarch  2.33-6.el7         ol7_latest               1.4 M
 fontconfig           x86_64  2.13.0-4.3.el7     ol7_latest               254 k
 libfontenc           x86_64  1.1.3-3.el7        ol7_latest                30 k
 urw-fonts            noarch  2.4-16.el7         ol7_latest               3.0 M
 xorg-x11-font-utils  x86_64  1:7.5-21.el7       ol7_latest               104 k

Transaction Summary
================================================================================
Install  1 Package (+6 Dependent packages)

Total size: 159 M
Total download size: 4.9 M
Installed size: 165 M
Is this ok [y/d/N]: y
Downloading packages:
(1/6): dejavu-fonts-common-2.33-6.el7.noarch.rpm           |  64 kB   00:00
(2/6): fontconfig-2.13.0-4.3.el7.x86_64.rpm                | 254 kB   00:00
(3/6): libfontenc-1.1.3-3.el7.x86_64.rpm                   |  30 kB   00:00
(4/6): dejavu-sans-fonts-2.33-6.el7.noarch.rpm             | 1.4 MB   00:00
(5/6): xorg-x11-font-utils-7.5-21.el7.x86_64.rpm           | 104 kB   00:00
(6/6): urw-fonts-2.4-16.el7.noarch.rpm                     | 3.0 MB   00:00
--------------------------------------------------------------------------------
Total                                               33 MB/s | 4.9 MB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libfontenc-1.1.3-3.el7.x86_64                                1/7
  Installing : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                      2/7
  Installing : dejavu-fonts-common-2.33-6.el7.noarch                        3/7
  Installing : dejavu-sans-fonts-2.33-6.el7.noarch                          4/7
  Installing : fontconfig-2.13.0-4.3.el7.x86_64                             5/7
  Installing : urw-fonts-2.4-16.el7.noarch                                  6/7
  Installing : grafana-6.0.1-1.x86_64                                       7/7
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script
  Verifying  : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                      1/7
  Verifying  : urw-fonts-2.4-16.el7.noarch                                  2/7
  Verifying  : fontconfig-2.13.0-4.3.el7.x86_64                             3/7
  Verifying  : dejavu-fonts-common-2.33-6.el7.noarch                        4/7
  Verifying  : grafana-6.0.1-1.x86_64                                       5/7
  Verifying  : dejavu-sans-fonts-2.33-6.el7.noarch                          6/7
  Verifying  : libfontenc-1.1.3-3.el7.x86_64                                7/7

Installed:
  grafana.x86_64 0:6.0.1-1

Dependency Installed:
  dejavu-fonts-common.noarch 0:2.33-6.el7
  dejavu-sans-fonts.noarch 0:2.33-6.el7
  fontconfig.x86_64 0:2.13.0-4.3.el7
  libfontenc.x86_64 0:1.1.3-3.el7
  urw-fonts.noarch 0:2.4-16.el7
  xorg-x11-font-utils.x86_64 1:7.5-21.el7

Complete!


その他必要なパッケージをインストール

initscriptsとfontconfigも必要とのこと
# OCIでOracle Linux 7.6ベースのインスタンスを作成した場合はインストール済みなので対応不要

sudo yum install initscripts fontconfig

[opc@instance ~]$ sudo yum install initscripts fontconfig
Loaded plugins: langpacks, ulninfo
Package initscripts-9.49.46-1.0.1.el7.x86_64 already installed and latest version
Package fontconfig-2.13.0-4.3.el7.x86_64 already installed and latest version
Nothing to do

サービスの起動

sudo systemctl status grafana-server
sudo systemctl enable grafana-server
sudo systemctl start grafana-server

[opc@instance ~]$ sudo systemctl start grafana-server
[opc@instance ~]$ sudo systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2019-03-17 11:17:06 GMT; 1s ago
     Docs: http://docs.grafana.org
 Main PID: 6026 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           mq6026 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini ...

Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance systemd[1]: Started Grafana instance.
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Mar 17 11:17:06 ash-ad1-ol7-pub-instance grafana-server[6026]: t=2019-03-17T1...
Hint: Some lines were ellipsized, use -l to show in full.

Grafana動作確認

ブラウザから以下のURLへアクセスして、grafanaが動いていることを確認
http://<サーバーのipアドレス>:3000

初めてアクセスすると、ログイン画面になる
username : admin
password : admin

WS20190317_003.JPG

まだ何も無い。
WS20190317_005.JPG

1-3.OCIのplug inをインストール

以下の公式blogに従ってインストール
- Grafana Labs : Oracle Cloud Infrastructure as a Data Source for Grafana
- Oracle Blog : Oracle Cloud Infrastructure as a Data Source for Grafana

sudo grafana-cli plugins install oci-datasource

[opc@instance ~]$ sudo grafana-cli plugins install oci-datasource
installing oci-datasource @ 1.0.0
from url: https://grafana.com/api/plugins/oci-datasource/versions/1.0.0/download
into: /var/lib/grafana/plugins

? Installed oci-datasource successfully

Restart grafana after installing plugins . <service grafana-server restart>
[opc@instance ~]$ ls -l /var/lib/grafana/plugins
total 0
drwxr-xr-x. 3 root root 18 Mar 17 11:27 oci-datasource

sudo service grafana-server restart

[opc@instance ~]$ sudo service grafana-server restart
Restarting grafana-server (via systemctl):                 [  OK  ]

ブラウザを見ると、最初はなかったOracle Cloud Infrastrctureが表れた!

2.GrafanaとOCIとの連携

2-1.GrafanaサーバーからAPI発行の許可

grafanaがメトリクス等を取得するためにAPIの発行を許可する必要があります。
今回はgrafanaをOCIのcomputeインスタンスに立てているので、このインスタンスをプリンシパルとしてAPI発行を許可する方法を採用しています。

→ 2019/3/19 追記:OCIインスタンスを使用していない場合の方法については以下を参照
【補】非OCI上のGrafanaとOCIとの連携)

Dynamic Groupの作成

OCIでは、ユーザーではなく、インスタンスをAPIの発行主体として権限を付与するポリシーを定義することができます。インスタンスが主体の場合は、通常のグループではなくDynamic Groupを利用して、ルールベースでそこに属するインスタンスを定義します。

参考:Calling Services from an Instance

OCI管理コンソールより
"Identity" > "Dynamic Groups" > "Create Dynamic Group"

項目
NAME 任意の名前
DESCRIPTION 任意の説明
RULE 1 任意のルール

例)特定のコンパートメント内の全てのインスタンスをグループに含める場合
「ALL {instance.compartment.id = '<コンパートメントのOCID>'}」

WS20190318_001.JPG

Dynamic Groupへ権限の付与

IAMのポリシーで、Dynamic Groupへ以下の権限を付与します。
※"tenancy"レベルの権限を付与するため、rootコンパートメントで定義する必要があります。

Allow dynamic-group <Dynamic Group名> to read metrics in tenancy
Allow dynamic-group <Dynamic Group名> to read compartments in tenancy

2-2.Grafanaにデータソースを追加

Grafanaへ戻り、データソースの設定をします。

項目
Tenancy OCID テナンシーのOCID(※コンパートメントのOCIDでも可)
Default Region 任意のリージョン(ホームリージョンである必要はない)
Environment OCI Instance

※今回はOCIのcompute instanceを使っているため、OCI Instanceにしましたが、localでも通りました。

grafana_datasources.png

3.Grafana Dashbordの編集

あとはGrafana側で、クエリを設定したり、好きなグラフを選んだりしてDashboardを使いたいようにしていく感じです。今回は省略。

grafana_dashboard.png

気が付いた点としては、

  • Dimensionsまで指定しないとエラーになる
    時々そうなるのですが、いったんDimensionsを指定したあと削除すると大丈夫でした。

  • 1つ下の階層のコンパートメントまで画面から指定可能
    子コンパートメント単位でのグラフ化」を参照

【補】非OCI上のGrafanaとOCIとの連携

OCIのcomputeインスタンス上以外でGrafanaを構築している場合、上述のinstanceプリンシパルでAPI発行許可を行う方法は利用できません。この場合、oci cliを利用してociユーザーを介したAPI発行を行うことになります。

参考:Monitor your Oracle Cloud Infrastructure with Grafana on Oracle Linux 7

補-1.GrafanaサーバーからAPI発行の許可

IAM User/Groupの作成

未作成の場合は、API発行をするユーザーとグループを作成します。

参考:

  • OCI管理コンソールよりユーザーを作成 "Identity" > "Users" > "Create User"
項目
NAME 任意の名前
DESCRIPTION 任意の説明
EMAIL パスワードを忘れた際に使用するメールアドレス
  • OCI管理コンソールよりグループを作成 "Identity" > "Groups" > "Create Group"
項目
NAME 任意の名前
DESCRIPTION 任意の説明
  • OCI管理コンソールよりユーザーをグループに追加 "Identity" > "Groups" > "Group Details" > "Add User to Group" ユーザーを選択して、作成したユーザーをグループへ追加

IAM Groupへ権限の付与

IAMのポリシーで、作成したGroupへ以下の権限を付与します。
※"tenancy"レベルの権限を付与するため、rootコンパートメントで定義する必要があります。

"Identity" > "Policies" > "Create Policy"

Allow group <Group名> to read metrics in tenancy
Allow group <Group名> to read compartments in tenancy

補-2.OCIへAPIを発行するための準備

OSユーザーを作成

Grafanaをインストールしたサーバーに、oci cliをインストールするためのユーザーを作成

[ec2-user@ip-172-31-42-80 ~]$ sudo groupadd oci
[ec2-user@ip-172-31-42-80 ~]$ sudo useradd oci -g oci
[ec2-user@ip-172-31-42-80 ~]$ sudo passwd oci
Changing password for user oci.
New password:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

OCI CLIのインストール

apiを発行するツールoci cliをインストール
参考:Installing the CLI

bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

[oci@ip-172-31-42-80 ~]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"

インストールディレクトリの設定(デフォルトでOK)

===> In what directory would you like to place the install? (leave blank to use '/home/oci/lib/oracle-cli'):
-- Creating directory '/home/oci/lib/oracle-cli'.
-- We will install at '/home/oci/lib/oracle-cli'.

ociの配置先の設定(デフォルトでOK)

===> In what directory would you like to place the 'oci' executable? (leave blank to use '/home/oci/bin'):
-- Creating directory '/home/oci/bin'.
-- The executable will be in '/home/oci/bin'.

ociスクリプトの配置先の設定(デフォルトでOK)

===> In what directory would you like to place the OCI scripts? (leave blank to use '/home/oci/bin/oci-cli-scripts'):
-- Creating directory '/home/oci/bin/oci-cli-scripts'.
-- The scripts will be in '/home/oci/bin/oci-cli-scripts'.

PATHの設定(デフォルトの許可でOK)

===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): Y

rcファイルの配置先の設定(デフォルトの許可でOK)

===> Enter a path to an rc file to update (leave blank to use '/home/oci/.bashrc'):
-- Backed up '/home/oci/.bashrc' to '/home/oci/.bashrc.backup'
-- Tab completion set up complete.
-- If tab completion is not activated, verify that '/home/oci/.bashrc' is sourced by your shell.

OCI CLIの設定

設定ファイルを生成(API発行するユーザーのOCID、テナンシーのOCID、リージョンなどを設定)。

oci setup config

[oci@ip-172-31-42-80 ~]$ oci setup config


Enter a location for your config [/home/oci/.oci/config]:
Enter a user OCID: ocid1.user.oc1..xxxxxxxxx
Enter a tenancy OCID: ocid1.tenancy.oc1..xxxxxxxxx
Enter a region (e.g. ca-toronto-1, eu-frankfurt-1, uk-london-1, us-ashburn-1, us-gov-ashburn-1, us-gov-chicago-1, us-gov-phoenix-1, us-langley-1, us-luke-1, us-phoenix-1): us-phoenix-1
Do you want to generate a new RSA key pair? (If you decline you will be asked to supply the path to an existing key.) [Y/n]: Y
Enter a directory for your keys to be created [/home/oci/.oci]:
Enter a name for your key [oci_api_key]:
Public key written to: /home/oci/.oci/oci_api_key_public.pem
Enter a passphrase for your private key (empty for no passphrase):
Private key written to: /home/oci/.oci/oci_api_key.pem
Fingerprint: 6c:bf:1a:9b:56:76:66:90:1f:31:40:82:d3:0f:32:04
Config written to /home/oci/.oci/config

oci cliの各種ファイルをコピー

grafanaがoci cliを使用できるよう、上の手順でインストール・配置した各種ファイルをgrafanaユーザーのホームディレクトリへコピーし、権限を変更します。
※公式blogには記載がない点に注意

[ec2-user@ip-172-31-42-80 ~]$ sudo cp -r /home/oci/.oci /usr/share/grafana
[ec2-user@ip-172-31-42-80 ~]$ sudo chown -R grafana:grafana /usr/share/grafana

configファイルにAPI鍵のパスも含まれているので、ここを変更します。

[ec2-user@ip-172-31-42-80 ~]$ sudo cp /usr/share/grafana/.oci/config /usr/share/grafana/.oci/bk_config
[ec2-user@ip-172-31-42-80 ~]$ sudo vi /usr/share/grafana/.oci/config
[ec2-user@ip-172-31-42-80 ~]$ sudo diff /usr/share/grafana/.oci/config /usr/share/grafana/.oci/bk_config
4c4
< key_file=/usr/share/grafana/.oci/oci_api_key.pem
---
> key_file=/home/oci/.oci/oci_api_key.pem

補-3.Grafanaにデータソースを追加

Grafanaへ戻り、データソースの設定をします。

項目
Tenancy OCID テナンシーのOCID(コンパートメントのOCIDでも可)
Default Region 任意のリージョン(ホームリージョンである必要はない)
Environment OCI local

その他

コンパートメント単位でのグラフ化

Grafanaの管理画面からクエリを設定する際に、コンパートメントを選択・変更することができます。ただし、データソース追加時に指定したテナンシー/コンパートメントの直下のコンパートメントしか表示されないようです。

例えば、コンパートメントが以下のような構成になっているとします

root
 |- Comp1
   |- Comp1_child1
   |- Comp1_child2
     |- Comp1_grand_child1
 |- Comp2

この場合に、データソースの「Tenancy OCID」に「Comp1」のOCIDを指定すると、Grafanaでは「Comp1」(rootと表示される)、「Comp1_child1」「Comp1_child2」のコンパートメントを指定することができます。「Comp2」や「Comp1_grand_child1」は選択できません。

↓データソース追加時にコンパートメントを指定
※Grafanaサーバーのoci_cli_rcでコンパートメントを指定する必要はありませんでした。
WS20190320_002.JPG

クエリ設定部分に、上で指定したコンパートメント(root)とその直下にあるコンパートメントが指定可能になる。
WS20190320_003.JPG

ハマったところ

公式のドキュメントに記載の手順に従って、GrafanaのデータソースにOCIを追加しようとすると以下のエラーが発生してしまいました。

reject: too many failed attempts: [object Object]
WS20190317_010.JPG

reject: too many failed attempts: [object Object] #2というイシューもあがっていて、ここに記載された手順を踏むことでエラーを回避することができます(oci cliの各種ファイルをコピーに記載した内容)。

※正確にいうと、私は上のissueに記載のコメントをきちんと読み取ることが出来ず失敗してしまったのですが、この記事のコメントで@mmarukaw氏より手順が紹介されているweb記事を紹介していただき、それに従うことで出来ました。

メモ

grafanaユーザー

grafanaをインストールすると、ログインシェルがnologinのgrafanaユーザーが作成される。
ホームは/usr/share/grafana

[opc@instance ~]$ sudo getent passwd grafana
grafana:x:995:992:grafana user:/usr/share/grafana:/sbin/nologin

grafana設定ファイルの場所

[opc@instance ~]$ sudo ls -la /etc/grafana/grafana.ini
-rw-r-----. 1 root grafana 16456 Mar 17 13:01 /etc/grafana/grafana.ini

grafanaのログの場所

[opc@instance ~]$ sudo ls -la /var/log/grafana
total 40
drwxr-xr-x. 2 grafana grafana    25 Mar 17 13:02 .
drwxr-xr-x. 8 root    root     4096 Mar 17 13:01 ..
-rw-r--r--. 1 grafana grafana 33979 Mar 17 13:03 grafana.log

plug-inの場所

[opc@instance ~]$ ls -la /var/lib/grafana/plugins
total 0
drwxr-xr-x. 3 grafana grafana 28 Mar 17 13:03 .
drwxr-xr-x. 4 grafana grafana 50 Mar 17 17:23 ..
drwxr-xr-x. 3 root    root    18 Mar 17 13:03 oci-datasource

以上

8
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?