728x90
InfluxDB 설치
binary 설치 파일을 이용하여 설치 수행 ( https://docs.influxdata.com/influxdb/v1.8/introduction/install/#verify-the-authenticity-of-downloaded-binary-optional )
dashboard@server01:/$ cd /apps
dashboard@server01:/apps$ sudo mkdir influxDB
dashboard@server01:/apps/influxDB$
dashboard@server01:/apps/influxDB$ sudo wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0_linux_amd64.tar.gz
/apps/influxDB$ curl -sL https://repos.influxdata.com/influxdb.key | gpg --import
/apps/influxDB$ wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.0_linux_amd64.tar.gz.asc
/apps/influxDB$ gpg --verify influxdb-1.8.0_linux_amd64.tar.gz.asc influxdb-1.8.0_linux_amd64.tar.gz
influxDB 설정
influxdb.conf 파일 수정 ( https://docs.influxdata.com/influxdb/v1.8/introduction/install/#configuring-influxdb-oss )
/apps/influxDB/influxdb-1.8.0-1/etc/influxdb/influxdb.conf
dir 경로 수정( meta, data, wal )
[meta]
# Where the metadata/raft database is stored
#dir = "/var/lib/influxdb/meta"
dir = "/apps/influxDB/influxdb-1.8.0-1/db/meta"
[data]
# The directory where the TSM storage engine stores TSM files.
#dir = "/var/lib/influxdb/data"
dir = "/apps/influxDB/influxdb-1.8.0-1/db/data"
# The directory where the TSM storage engine stores WAL files.
#wal-dir = "/var/lib/influxdb/wal"
wal-dir = "/apps/influxDB/influxdb-1.8.0-1/db/wal"
influxDB 기동/중지
/apps/influxDB/influxdb-1.8.0-1$ cat startup.sh
./usr/bin/influxd -config ./etc/influxdb/influxdb.conf &
# 사용자 권한
# chown dashboard:dashboard startup.sh
# 실행 권한
# chmod 777 startup.sh
root@server01:/apps/influxDB/influxdb-1.8.0-1# ./startup.sh
root@server01:/apps/influxDB/influxdb-1.8.0-1#
8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"
2020-06-22T06:51:17.983588Z info InfluxDB starting {"log_id": "0NYh_6Nl000", "version": "1.8.0", "branch": "1.8", "commit": "781490de48220d7695a05c29e5a36f550a4568f5"}
2020-06-22T06:51:17.983605Z info Go runtime {"log_id": "0NYh_6Nl000", "version": "go1.13.8", "maxprocs": 2}
2020-06-22T06:51:18.096166Z info Using data dir {"log_id": "0NYh_6Nl000", "service": "store", "path": "/apps/influxDB/influxdb-1.8.0-1/db/data"}
2020-06-22T06:51:18.096353Z info Compaction settings {"log_id": "0NYh_6Nl000", "service": "store", "max_concurrent_compactions": 1, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2020-06-22T06:51:18.096376Z info Open store (start) {"log_id": "0NYh_6Nl000", "service": "store", "trace_id": "0NYh_6p0000", "op_name": "tsdb_open", "op_event": "start"}
2020-06-22T06:51:18.096411Z info Open store (end) {"log_id": "0NYh_6Nl000", "service": "store", "trace_id": "0NYh_6p0000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "0.037ms"}
2020-06-22T06:51:18.096434Z info Opened service {"log_id": "0NYh_6Nl000", "service": "subscriber"}
2020-06-22T06:51:18.099444Z info Starting monitor service {"log_id": "0NYh_6Nl000", "service": "monitor"}
2020-06-22T06:51:18.099460Z info Registered diagnostics client {"log_id": "0NYh_6Nl000", "service": "monitor", "name": "build"}
2020-06-22T06:51:18.099465Z info Registered diagnostics client {"log_id": "0NYh_6Nl000", "service": "monitor", "name": "runtime"}
2020-06-22T06:51:18.099469Z info Registered diagnostics client {"log_id": "0NYh_6Nl000", "service": "monitor", "name": "network"}
2020-06-22T06:51:18.099476Z info Registered diagnostics client {"log_id": "0NYh_6Nl000", "service": "monitor", "name": "system"}
2020-06-22T06:51:18.099551Z info Starting precreation service {"log_id": "0NYh_6Nl000", "service": "shard-precreation", "check_interval": "10m", "advance_period": "30m"}
2020-06-22T06:51:18.099659Z info Starting snapshot service {"log_id": "0NYh_6Nl000", "service": "snapshot"}
2020-06-22T06:51:18.099677Z info Starting continuous query service {"log_id": "0NYh_6Nl000", "service": "continuous_querier"}
2020-06-22T06:51:18.099683Z info Starting HTTP service {"log_id": "0NYh_6Nl000", "service": "httpd", "authentication": false}
2020-06-22T06:51:18.099688Z info opened HTTP access log {"log_id": "0NYh_6Nl000", "service": "httpd", "path": "stderr"}
2020-06-22T06:51:18.099749Z info Listening on HTTP {"log_id": "0NYh_6Nl000", "service": "httpd", "addr": "[::]:8086", "https": false}
2020-06-22T06:51:18.099771Z info Starting retention policy enforcement service {"log_id": "0NYh_6Nl000", "service": "retention", "check_interval": "30m"}
2020-06-22T06:51:18.100431Z info Listening for signals {"log_id": "0NYh_6Nl000"}
2020-06-22T06:51:18.101082Z info Sending usage statistics to usage.influxdata.com {"log_id": "0NYh_6Nl000"}
2020-06-22T06:51:18.099847Z info Storing statistics {"log_id": "0NYh_6Nl000", "service": "monitor", "db_instance": "_internal", "db_rp": "monitor", "interval": "10s"}
[httpd] 127.0.0.1 - - [22/Jun/2020:06:57:18 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 9cf49533-b455-11ea-8001-0800278bb39b 85
2020-06-22T06:57:30.477753Z info Executing query {"log_id": "0NYh_6Nl000", "service": "query", "query": "SHOW DATABASES"}
[httpd] 127.0.0.1 - - [22/Jun/2020:06:57:30 +0000] "POST /query?chunked=true&db=&epoch=ns&q=show+DATABASES HTTP/1.1" 200 110 "-" "InfluxDBShell/1.8.0" a3fe0993-b455-11ea-8002-0800278bb39b 2007
2020-06-22T06:57:41.469638Z info Executing query {"log_id": "0NYh_6Nl000", "service": "query", "query": "CREATE DATABASE prometheus_db"}
[httpd] 127.0.0.1 - - [22/Jun/2020:06:57:41 +0000] "POST /query?chunked=true&db=&epoch=ns&q=CREATE+DATABASE+prometheus_db HTTP/1.1" 200 57 "-" "InfluxDBShell/1.8.0" aa8b4041-b455-11ea-8003-0800278bb39b 5161
2020-06-22T06:57:46.029909Z info Executing query {"log_id": "0NYh_6Nl000", "service": "query", "query": "SHOW DATABASES"}
[httpd] 127.0.0.1 - - [22/Jun/2020:06:57:46 +0000] "POST /query?chunked=true&db=&epoch=ns&q=show+DATABASES HTTP/1.1" 200 122 "-" "InfluxDBShell/
InfluxDB DATABASE 생성
prometheus에서 사용할 Database를 생성 ( https://docs.influxdata.com/influxdb/v1.8/introduction/get-started/#creating-a-database )
https://docs.influxdata.com/influxdb/v1.8
root@server01:/apps/influxDB/influxdb-1.8.0-1/usr/bin# ./influx
Connected to http://localhost:8086 version 1.8.0
InfluxDB shell version: 1.8.0
> show DATABASES
name: databases
name
----
_internal
> CREATE DATABASE prometheus_db
> show DATABASES
name: databases
name
----
_internal
prometheus_db
>quit
트러블슈팅
#prometheus 도 그랬지만 influxdb도 tar 파일 압축해제시 error 발생.(파일깨짐) 어떤 이유에서인지 모르겠지만 wget으로 받는 파일이 계속 깨지는 현상 발생. -> 해당 url로 windows 다운 받아서 sftp를 통해 파일업로드 후 압축해제시 정상. |
728x90
'클라우드 > prometheus' 카테고리의 다른 글
kubernetes service discover 설정 (0) | 2021.10.04 |
---|---|
prometheus 사용가이드 (0) | 2021.10.03 |
Remote Storage 설정하기 (0) | 2021.10.01 |
prometheus - gitlab metrics 설정하기 (0) | 2021.09.30 |
prometheus - keycloak Metrics 설정하기 (0) | 2021.09.29 |
댓글