본문 바로가기

리눅스

[리눅스] influxdb 설치(influxdb 2.x)

728x90

influxdb 설치

테스트 환경

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

influxdb 설치

echo "deb https://repos.influxdata.com/ubuntu focal stable" | tee /etc/apt/sources.list.d/influxdb.list

---

export DISTRIB_ID=$(lsb_release -si);
export DISTRIB_CODENAME=$(lsb_release -sc);

echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null

GPG 키 추가

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
apt update
apt install -y influxdb2
systemctl enable --now influxdb
ps -ef | grep -v grep | grep influxdb
$ ps -ef | grep -v grep | grep influxdb           
influxdb    2192       1  0 05:36 ?        00:00:00 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
netstat -nlpt | grep influxdb
$ netstat -nlpt | grep influxdb
tcp        0      0 127.0.0.1:8088          0.0.0.0:*               LISTEN      2192/influxd        
tcp6       0      0 :::8086                 :::*                    LISTEN      2192/influxd

influxdb version 정보

influxd version
$ influxd version
InfluxDB v2.3.0+SNAPSHOT.090f681737 (git: 090f681737) build_date: 2022-06-16T19:34:04Z
influx version
$ influx version
Influx CLI 2.3.0 (git: 88ba346) build_date: 2022-04-06T19:30:53

influxdb 설정(CLI)

org 생성

influx org create -n org-scbyun
$ influx org create -n org-scbyun
ID                      Name
ddd100a11142bea2        org-scbyun
influx org list
$ influx org list
ID                      Name
ddd100a11142bea2        org-scbyun

user 생성

- Password는 8자 이상 사용

influx user create -n admin -p password1! -o org-scbyun
$ influx user create -n admin -p password1! -o org-scbyun
ID                      Name
09a6b6404d9db000        admin
influx user list
$ influx user list
ID                      Name
09a6b6404d9db000        admin

bucket 생성

influx bucket create -n bucket-telegraf -o org-scbyun -r 72h
$ influx bucket create -n bucket-telegraf -o org-scbyun -r 72h
ID                      Name            Retention       Shard group duration    Organization ID         Schema Type
14a98213ac5b4181        bucket-telegraf 72h0m0s         24h0m0s                 ddd100a11142bea2        implicit
influx bucket list
$ influx bucket list -o org-scbyun
ID                      Name            Retention       Shard group duration    Organization ID         Schema Type
f7f52e123c69685f        _monitoring     168h0m0s        24h0m0s                 ddd100a11142bea2        implicit
c1398b275069367a        _tasks          72h0m0s         24h0m0s                 ddd100a11142bea2        implicit
14a98213ac5b4181        bucket-telegraf 72h0m0s         24h0m0s                 ddd100a11142bea2        implicit

token 생성

influx auth create -o org-scbyun --all-access
$ influx auth create -o org-scbyun --all-access
ID                      Description     Token                                                                                          User Name        User ID                 Permissions
09a6bfd5ff9db000                        554dt0NVvu3Rj63NXjo9tFt-Qf8Rn1E5gj7sGuIsclk1og0OvO3NLzqHJjJmNpsl3U3EXg19GfVeRNcHS2ggMQ==       tadmin           09a6b50112ddb000        [read:orgs/ddd100a11142bea2/authorizations write:orgs/ddd100a11142bea2/authorizations read:orgs/ddd100a11142bea2/buckets write:orgs/ddd100a11142bea2/buckets read:orgs/ddd100a11142bea2/dashboards write:orgs/ddd100a11142bea2/dashboards read:/orgs/ddd100a11142bea2 read:orgs/ddd100a11142bea2/sources write:orgs/ddd100a11142bea2/sources read:orgs/ddd100a11142bea2/tasks write:orgs/ddd100a11142bea2/tasks read:orgs/ddd100a11142bea2/telegrafs write:orgs/ddd100a11142bea2/telegrafs read:/users/09a6b50112ddb000 write:/users/09a6b50112ddb000 read:orgs/ddd100a11142bea2/variables write:orgs/ddd100a11142bea2/variables read:orgs/ddd100a11142bea2/scrapers write:orgs/ddd100a11142bea2/scrapers read:orgs/ddd100a11142bea2/secrets write:orgs/ddd100a11142bea2/secrets read:orgs/ddd100a11142bea2/labels write:orgs/ddd100a11142bea2/labels read:orgs/ddd100a11142bea2/views write:orgs/ddd100a11142bea2/views read:orgs/ddd100a11142bea2/documents write:orgs/ddd100a11142bea2/documents read:orgs/ddd100a11142bea2/notificationRules write:orgs/ddd100a11142bea2/notificationRules read:orgs/ddd100a11142bea2/notificationEndpoints write:orgs/ddd100a11142bea2/notificationEndpoints read:orgs/ddd100a11142bea2/checks write:orgs/ddd100a11142bea2/checks read:orgs/ddd100a11142bea2/dbrp write:orgs/ddd100a11142bea2/dbrp read:orgs/ddd100a11142bea2/notebooks write:orgs/ddd100a11142bea2/notebooks read:orgs/ddd100a11142bea2/annotations write:orgs/ddd100a11142bea2/annotations read:orgs/ddd100a11142bea2/remotes write:orgs/ddd100a11142bea2/remotes read:orgs/ddd100a11142bea2/replications write:orgs/ddd100a11142bea2/replications]
influx auth list
$ influx auth list
ID                      Description     Token                                                                                          User Name        User ID                 Permissions
09a6bfd5ff9db000                        554dt0NVvu3Rj63NXjo9tFt-Qf8Rn1E5gj7sGuIsclk1og0OvO3NLzqHJjJmNpsl3U3EXg19GfVeRNcHS2ggMQ==       tadmin           09a6b50112ddb000        [read:orgs/ddd100a11142bea2/authorizations write:orgs/ddd100a11142bea2/authorizations read:orgs/ddd100a11142bea2/buckets write:orgs/ddd100a11142bea2/buckets read:orgs/ddd100a11142bea2/dashboards write:orgs/ddd100a11142bea2/dashboards read:/orgs/ddd100a11142bea2 read:orgs/ddd100a11142bea2/sources write:orgs/ddd100a11142bea2/sources read:orgs/ddd100a11142bea2/tasks write:orgs/ddd100a11142bea2/tasks read:orgs/ddd100a11142bea2/telegrafs write:orgs/ddd100a11142bea2/telegrafs read:/users/09a6b50112ddb000 write:/users/09a6b50112ddb000 read:orgs/ddd100a11142bea2/variables write:orgs/ddd100a11142bea2/variables read:orgs/ddd100a11142bea2/scrapers write:orgs/ddd100a11142bea2/scrapers read:orgs/ddd100a11142bea2/secrets write:orgs/ddd100a11142bea2/secrets read:orgs/ddd100a11142bea2/labels write:orgs/ddd100a11142bea2/labels read:orgs/ddd100a11142bea2/views write:orgs/ddd100a11142bea2/views read:orgs/ddd100a11142bea2/documents write:orgs/ddd100a11142bea2/documents read:orgs/ddd100a11142bea2/notificationRules write:orgs/ddd100a11142bea2/notificationRules read:orgs/ddd100a11142bea2/notificationEndpoints write:orgs/ddd100a11142bea2/notificationEndpoints read:orgs/ddd100a11142bea2/checks write:orgs/ddd100a11142bea2/checks read:orgs/ddd100a11142bea2/dbrp write:orgs/ddd100a11142bea2/dbrp read:orgs/ddd100a11142bea2/notebooks write:orgs/ddd100a11142bea2/notebooks read:orgs/ddd100a11142bea2/annotations write:orgs/ddd100a11142bea2/annotations read:orgs/ddd100a11142bea2/remotes write:orgs/ddd100a11142bea2/remotes read:orgs/ddd100a11142bea2/replications write:orgs/ddd100a11142bea2/replications]

-

influx setup --username tadmin --password 'admin12#$' --org scbyun.com --bucket telegraf --retention 1w --force
$ influx setup --username tadmin --password 'admin12#$' --org scbyun.com --bucket telegraf --retention 1w --force
User    Organization    Bucket
tadmin  scbyun.com      telegraf
influx auth list
$ influx auth list
ID                      Description     Token                                                                                           User Name       User ID                 Permissions
09a6b5012a5db000        tadmin's Token  BozErr0Oxxq4H4_sRfSDilgT7VDVfJgKWS3TkNxbnZYS0SblCY3LUoji3l637dlqRmley4seXqMTMi7dmnF3iA==        tadmin          09a6b50112ddb000        [read:/authorizations write:/authorizations read:/buckets write:/buckets read:/dashboards write:/dashboards read:/orgs write:/orgs read:/sources write:/sources read:/tasks write:/tasks read:/telegrafs write:/telegrafs read:/users write:/users read:/variables write:/variables read:/scrapers write:/scrapers read:/secrets write:/secrets read:/labels write:/labels read:/views write:/views read:/documents write:/documents read:/notificationRules write:/notificationRules read:/notificationEndpoints write:/notificationEndpoints read:/checks write:/checks read:/dbrp write:/dbrp read:/notebooks write:/notebooks read:/annotations write:/annotations read:/remotes write:/remotes read:/replications write:/replications]

influxdb UI  설정하기

http://{Server-IP}:8086

 

 

 

 

참고

- https://docs.influxdata.com/influxdb/v2.3/install/

 

728x90

'리눅스' 카테고리의 다른 글

[명령어] glances 명령어  (0) 2022.07.12
[리눅스] influxdb, grafana, telegraf 연동  (0) 2022.07.10
[리눅스] influxdb 설치(influxdb 2.x)  (0) 2022.07.10
[리눅스] grafana 설치  (0) 2022.07.06
[리눅스] telegraf 설치  (0) 2022.07.06
[리눅스] influxdb 설치  (0) 2022.07.06