telegraf -> influxdb -> grafana 연동을 해보려고 작성해 봤습니다.

root@syslogserver:~# influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> show databases
name: databases
name
----
_internal
> create database telegrafdb
> create user telegraf with password 'password0'
>
> grant all on telegrafdb to telegraf
> show databaes
ERR: error parsing query: found databaes, expected CONTINUOUS, DATABASES, DIAGNOSTICS, FIELD, GRANTS, MEASUREMENT, MEASUREMENTS, QUERIES, RETENTION, SERIES, SHARD, SHARDS, STATS, SUBSCRIPTIONS, TAG, USERS at line 1, char 6
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".
> show databases
name: databases
name
----
_internal
telegrafdb
> quit
root@syslogserver:~#
root@syslogserver:~# vi /etc/telegraf/telegraf.conf

#[[outputs.influxdb]]
  ## The full HTTP or UDP URL for your InfluxDB instance.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  # urls = ["unix:///var/run/influxdb.sock"]
  # urls = ["udp://127.0.0.1:8089"]
  urls = ["http://192.168.000.000:8086"]

  ## The target database for metrics; will be created as needed.
  ## For UDP url endpoint database needs to be configured on server side.
  database = "telegrafdb"

  ## The value of this tag will be used to determine the database.  If this
  ## tag is not set the 'database' option is used as the default.
  # database_tag = ""

  ## If true, the 'database_tag' will not be included in the written metric.
  # exclude_database_tag = false

  ## If true, no CREATE DATABASE queries will be sent.  Set to true when using
  ## Telegraf with a user without permissions to create databases or when the
  ## database already exists.
  # skip_database_creation = false

  ## Name of existing retention policy to write to.  Empty string writes to
  ## the default retention policy.  Only takes effect when using HTTP.
  retention_policy = ""

  ## The value of this tag will be used to determine the retention policy.  If this
  ## tag is not set the 'retention_policy' option is used as the default.
  # retention_policy_tag = ""

  ## If true, the 'retention_policy_tag' will not be included in the written metric.
  # exclude_retention_policy_tag = false

  ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  ## Only takes effect when using HTTP.
  # write_consistency = "any"

  ## Timeout for HTTP messages.
  timeout = "5s"

  ## HTTP Basic Auth
  username = "telegraf"
  password = "password0"

 

이후 그라파나의 Data source 추가를 influxdb로 하시면 됩니다.

'기술 노트 > ubuntu' 카테고리의 다른 글

influxdb.conf 설정 파일  (0) 2024.03.18
influxdb v1으로 설치하기  (0) 2024.03.18
MIB search path: mibs  (0) 2024.03.15
influxdb org 확인 하기  (0) 2024.03.15
telegraf 설정하기  (0) 2024.03.15

기존 설치한 snap 방식은 버전이 낮아서 apt로 설치하는 방법으로 다시 설치해 봤습니다.

 

간단히

#### 공통 설치 부분
logmgmt@syslogserver:~$ sudo apt-get install -y apt-transport-https software-properties-common wget
logmgmt@syslogserver:~$ sudo mkdir -p /etc/apt/keyrings/ -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/nullwget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
logmgmt@syslogserver:~$ cd /etc/apt/keyrings
logmgmt@syslogserver:/etc/apt/keyrings$ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
logmgmt@syslogserver:/etc/apt/keyrings$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main
logmgmt@syslogserver:/etc/apt/keyrings$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main
logmgmt@syslogserver:~$ sudo apt-get update

#### 기존 grafana 설치 이력이 없다면
logmgmt@syslogserver:~$ sudo apt install grafana

#### 기존 grafana 설치 이력이 있다면
logmgmt@syslogserver:~$ rm -rf /var/lib/grafana
logmgmt@syslogserver:~$ rm -rf /etc/grafana
logmgmt@syslogserver:~$ sudo apt install grafana

 

자세히

logmgmt@syslogserver:~$ sudo apt-get install -y apt-transport-https software-properties-common wget
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
wget is already the newest version (1.21.2-2ubuntu1).
software-properties-common is already the newest version (0.99.22.8).
software-properties-common 패키지는 수동설치로 지정합니다.
apt-transport-https is already the newest version (2.4.11).
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'sudo apt autoremove' to remove them.
0개 업그레이드, 0개 새로 설치, 0개 제거 및 5개 업그레이드 안 함.
logmgmt@syslogserver:~$ sudo mkdir -p /etc/apt/keyrings/ -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/nullwget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
logmgmt@syslogserver:~$
logmgmt@syslogserver:~$ cd /etc/apt
logmgmt@syslogserver:/etc/apt$ ls -al
total 44
drwxr-xr-x   8 root root  4096 11월 28 14:00 .
drwxr-xr-x 140 root root 12288 12월 22 16:30 ..
drwxr-xr-x   2 root root  4096 11월 28 18:01 apt.conf.d
drwxr-xr-x   2 root root  4096  4월  8  2022 auth.conf.d
drwxr-xr-x   2 root root  4096  4월  8  2022 keyrings
drwxr-xr-x   2 root root  4096 11월 28 18:01 preferences.d
-rw-r--r--   1 root root  2824 11월 28 14:00 sources.list
drwxr-xr-x   2 root root  4096 12월 23 12:37 sources.list.d
drwxr-xr-x   2 root root  4096  8월  8 07:53 trusted.gpg.d
logmgmt@syslogserver:/etc/apt$ cd keyrings/
logmgmt@syslogserver:/etc/apt/keyrings$ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
logmgmt@syslogserver:/etc/apt/keyrings$ ls
grafana.gpg
logmgmt@syslogserver:/etc/apt/keyrings$ ls -al
total 12
drwxr-xr-x 2 root root 4096 12월 23 12:42 .
drwxr-xr-x 8 root root 4096 11월 28 14:00 ..
-rw-r--r-- 1 root root 1758 12월 23 12:42 grafana.gpg
logmgmt@syslogserver:/etc/apt/keyrings$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main
logmgmt@syslogserver:/etc/apt/keyrings$ echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main
logmgmt@syslogserver:/etc/apt/keyrings$ cd
logmgmt@syslogserver:~$ sudo apt-get update
받기:1 https://apt.grafana.com stable InRelease [5,984 B]
받기:2 https://apt.grafana.com beta InRelease [5,976 B]
기존:3 https://dl.yarnpkg.com/debian stable InRelease
받기:4 https://apt.grafana.com stable/main amd64 Packages [182 kB]
오류:2 https://apt.grafana.com beta InRelease
  다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
기존:5 https://deb.nodesource.com/node_20.x jammy InRelease
기존:6 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
기존:7 http://security.ubuntu.com/ubuntu jammy-security InRelease
기존:8 http://kr.archive.ubuntu.com/ubuntu jammy InRelease
기존:9 http://kr.archive.ubuntu.com/ubuntu jammy-updates InRelease
기존:10 http://kr.archive.ubuntu.com/ubuntu jammy-backports InRelease
패키지 목록을 읽는 중입니다... 완료
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://apt.grafana.com stable InRelease' doesn't support architecture 'i386'
W: GPG 오류: https://apt.grafana.com beta InRelease: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
E: The repository 'https://apt.grafana.com beta InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
logmgmt@syslogserver:~$ sudo apt update
기존:1 https://apt.grafana.com stable InRelease
받기:2 https://apt.grafana.com beta InRelease [5,976 B]
기존:3 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
기존:4 https://dl.yarnpkg.com/debian stable InRelease
오류:2 https://apt.grafana.com beta InRelease
  다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
기존:5 https://deb.nodesource.com/node_20.x jammy InRelease
기존:6 http://kr.archive.ubuntu.com/ubuntu jammy InRelease
기존:7 http://kr.archive.ubuntu.com/ubuntu jammy-updates InRelease
기존:8 http://security.ubuntu.com/ubuntu jammy-security InRelease
기존:9 http://kr.archive.ubuntu.com/ubuntu jammy-backports InRelease
패키지 목록을 읽는 중입니다... 완료
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://apt.grafana.com stable InRelease' doesn't support architecture 'i386'
W: GPG 오류: https://apt.grafana.com beta InRelease: 다음 서명들은 공개키가 없기 때문에 인증할 수 없습니다: NO_PUBKEY 9E439B102CF3C0C6
E: The repository 'https://apt.grafana.com beta InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:1 and /etc/apt/sources.list.d/grafana.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-ko_KR) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-ko) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/grafana.list:2 and /etc/apt/sources.list.d/grafana.list:4
logmgmt@syslogserver:~$ sudo apt install grafana
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  musl
다음 새 패키지를 설치할 것입니다:
  grafana musl
0개 업그레이드, 2개 새로 설치, 0개 제거 및 5개 업그레이드 안 함.
104 M바이트 아카이브를 받아야 합니다.
이 작업 후 384 M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] y
받기:1 http://kr.archive.ubuntu.com/ubuntu jammy/universe amd64 musl amd64 1.2.2-4 [407 kB]
받기:2 https://apt.grafana.com stable/main amd64 grafana amd64 10.2.3 [104 MB]
내려받기 104 M바이트, 소요시간 5초 (19.0 M바이트/초)
Selecting previously unselected package musl:amd64.
(데이터베이스 읽는중 ...현재 291313개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../musl_1.2.2-4_amd64.deb ...
Unpacking musl:amd64 (1.2.2-4) ...
Selecting previously unselected package grafana.
Preparing to unpack .../grafana_10.2.3_amd64.deb ...
Unpacking grafana (10.2.3) ...
musl:amd64 (1.2.2-4) 설정하는 중입니다 ...
grafana (10.2.3) 설정하는 중입니다 ...
mkdir: cannot create directory ‘/var/lib/grafana’: File exists
dpkg: error processing package grafana (--configure):
 installed grafana package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.10.2-1) ...
처리하는데 오류가 발생했습니다:
 grafana
E: Sub-process /usr/bin/dpkg returned an error code (1)
logmgmt@syslogserver:~$ sudo rm -rf /var/lib/grafana
logmgmt@syslogserver:~$ sudo rm -rf /etc/grafana/
logmgmt@syslogserver:~$ sudo apt install grafana
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
grafana is already the newest version (10.2.3).
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'sudo apt autoremove' to remove them.
0개 업그레이드, 0개 새로 설치, 0개 제거 및 5개 업그레이드 안 함.
1개를 완전히 설치하지 못했거나 지움.
이 작업 후 0 바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] y
grafana (10.2.3) 설정하는 중입니다 ...
cp: cannot create regular file '/etc/grafana/grafana.ini': No such file or directory
dpkg: error processing package grafana (--configure):
 installed grafana package post-installation script subprocess returned error exit status 1
처리하는데 오류가 발생했습니다:
 grafana
E: Sub-process /usr/bin/dpkg returned an error code (1)
logmgmt@syslogserver:~$ sudo apt remove grafana
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  musl python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'sudo apt autoremove' to remove them.
다음 패키지를 지울 것입니다:
  grafana
0개 업그레이드, 0개 새로 설치, 1개 제거 및 5개 업그레이드 안 함.
1개를 완전히 설치하지 못했거나 지움.
이 작업 후 383 M바이트의 디스크 공간이 비워집니다.
계속 하시겠습니까? [Y/n] y
(데이터베이스 읽는중 ...현재 301080개의 파일과 디렉터리가 설치되어 있습니다.)
Removing grafana (10.2.3) ...
Stopping and disabling grafana-server service...
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable grafana-server
logmgmt@syslogserver:~$ sudo apt install grafana
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  python3-cliapp python3-markdown python3-pygments python3-ttystatus
Use 'sudo apt autoremove' to remove them.
다음 새 패키지를 설치할 것입니다:
  grafana
0개 업그레이드, 1개 새로 설치, 0개 제거 및 5개 업그레이드 안 함.
0 바이트/104 M바이트 아카이브를 받아야 합니다.
이 작업 후 383 M바이트의 디스크 공간을 더 사용하게 됩니다.
Selecting previously unselected package grafana.
(데이터베이스 읽는중 ...현재 291329개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../grafana_10.2.3_amd64.deb ...
Unpacking grafana (10.2.3) ...
grafana (10.2.3) 설정하는 중입니다 ...
### 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
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
logmgmt@syslogserver:~$

 

참고 자료

https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/

 

Install Grafana on Debian or Ubuntu | Grafana documentation

Enterprise Open source Install Grafana on Debian or Ubuntu This topic explains how to install Grafana dependencies, install Grafana on Linux Debian or Ubuntu, and start the Grafana server on your Debian or Ubuntu system. There are multiple ways to install

grafana.com

 

'기술 노트 > ubuntu' 카테고리의 다른 글

elastalert2 설치하기  (0) 2024.01.15
grafana 알람 설정  (0) 2024.01.08
grafana user admin 권한 부여하기  (0) 2023.12.21
grafana admin 계정  (0) 2023.12.21
snap으로 grafana 설치 후 grafana.ini 설정  (0) 2023.12.21

접속정보

  • http://{서버IP}:3000
  • ID: admin
  • PW: admin

반드시 접속 후 패스워드 변경하시기 바랍니다.

그리고 admin 계정은 삭제 후, 새로운 관리자 계정으로 사용하세요.

  • 계정 생성

     ※ admin 계정 삭제 전 생성한 계정에게 admin 권한을 부여해주세요.

  • admin 계정 삭제

  • admin 계정 삭제 시 자동으로 로그아웃 됩니다.

'기술 노트 > ubuntu' 카테고리의 다른 글

apt로 grafana 설치하기  (1) 2024.01.08
grafana user admin 권한 부여하기  (0) 2023.12.21
snap으로 grafana 설치 후 grafana.ini 설정  (0) 2023.12.21
grafana 설치하기  (1) 2023.12.21
snmp-exporter-0.25 설치하기  (0) 2023.12.21

+ Recent posts