How to install InfluxDB using Docker

 

mkdir influxdb
cd influxdb
vim docker-compose.yml
version: '3.8'

services:
  influxdb:
    image: quay.io/influxdb/influxdb:v2.0.4
    ports:
      - "8086:8086"
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=adminpassword
      - DOCKER_INFLUXDB_INIT_ORG=mycompany
      - DOCKER_INFLUXDB_INIT_BUCKET=geoip2influx
    volumes:
      - ./influxdb-data:/var/lib/influxdb2
    networks:
      - influxdb-net

networks:
  influxdb-net:

Install InfluxDB Client

wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-linux-amd64.tar.gz
tar xvzf influxdb2-client-2.7.3-linux-amd64.tar.gz
sudo cp influx /usr/local/bin/

Create config influxDB client

influx config create --config-name defaul-config --host-url http://localhost:8086 --org mycompany --token KIRocbUKK8dQ1knGakgs_QUtXqsbzH0b_YACP83Jqzl8nyc6Pye_dVK_yFO6RK_GX53kRwqu2ddxqHXEXG-b7nUQ==  --active

 













Leave a Reply

Your email address will not be published. Required fields are marked *