CLI에서 보다 중점적으로 InfluxDB를 사용해보고자 하였다..
결론부터 말하자면....
In any version, flux queries will work in UI and not in CLI
후....
그래도 Flux 쿼리가 작동되지 않는거지 기본적인 명령어들을 사용할 수 있으므로
사용했던 해당 내용들에 대해 정리해보겠다.
Windows Binaries (64-bit) -using PowerShell 기준 InfluxDB 2.X 다운로드 명령어
wget https://download.influxdata.com/influxdb/releases/influxdb2-2.7.10-windows.zip -UseBasicParsing -OutFile influxdb2-2.7.10-windows.zip
Expand-Archive .\influxdb2-2.7.10-windows.zip -DestinationPath 'C:\Program Files\InfluxData\influxdb\'
(윈도우환경이라면, 환경변수 설정해주는 것을 까먹지 말자..!)
원래 InfluxDB를 설치하면 InfluxDB CLI도 함께 설치가 되는 것으로 알고 있는데,
필자는 설치가 되어있지 않기에 따로 설치해주었다.
아래 사이트를 참고하자.
Install and use the influx CLI | InfluxDB OSS v2 Documentation
Thank you for your feedback! Let us know what we can do better:
docs.influxdata.com
CLI 폴더 압축해제
> Expand-Archive .\influxdb2-client-2.7.5-windows-amd64.zip -DestinationPath 'C:\Program Files\InfluxData\'
> mv 'C:\Program Files\InfluxData\influxdb2-client-2.7.5-windows-amd64' 'C:\Program Files\InfluxData\influx'
환경 설정 관련 명령어
# 현재 설정된 InfluxDB CLI 설정 목록을 출력
influx config ls
# 새로운 InfluxDB CLI 설정을 생성하고 활성화
influx config create --config-name <name> --host-url <url> --org <organization> --token <token> --active
# 특정 설정을 삭제
influx config rm <config-name>
# 특정 설정을 기본으로 활성화
influx config use <config-name>
버킷 확인 및 생성/삭제
# 현재 존재하는 모든 버킷 목록을 조회
influx bucket list
# 새로운 버킷을 생성하고 보존 기간을 설정
influx bucket create --name <bucket-name> --org <organization> --retention <duration>
# 특정 버킷을 삭제
influx bucket delete --name <bucket-name> --org <organization>
조직 관리
# 현재 존재하는 모든 조직 목록을 조회
influx org list
# 새로운 조직을 생성
influx org create --name <organization-name>
# 특정 조직에 새로운 사용자를 생성하고 비밀번호 설정
influx user create --name <user-name> --org <organization> --password <password>
# 현재 존재하는 모든 사용자 목록을 조회
influx user list
권한 관리
# 현재 존재하는 모든 인증 토큰 목록을 조회
influx auth list
# 특정 조직과 사용자에 대해 버킷 쓰기 권한을 가진 토큰 생성
influx auth create --org <organization> --user <user> --write-bucket <bucket-name>
# 특정 조직과 사용자에 대해 모든 권한을 가진 토큰 생성
influx auth create --org <organization> --user <user> --all-access
# 특정 토큰을 삭제
influx auth delete --id <token-id>
설치 및 서버 상태 확인
# InfluxDB 서버의 상태를 확인 (서버가 실행 중인지 확인하는 Ping 명령)
influx ping
# 현재 설치된 InfluxDB CLI의 버전을 확인
influx version
굳이 InfluxDB UI를 사용하지 않고, 억지로 cli를 사용하려고 할 필요는 없을 것 같다...