influxdb集群部署
環境準備
influxdb enterprise運行條件最低需要三個meta nodes節點以及兩個data nodes
Meta nodes之間使用TCP和Raft一致性協議通訊,默認埠為8089
Meta nodes對外暴露8091,用於influxd-ctl命令進行交互
Data nodes通過8088進行數據同步,8086對於用戶進行讀寫服務
在集群中,所有meta nodes節點必須要與data nodes節點保持通訊。
mata nodes主要保存以下所有的元數據資訊
- 集群中所有的節點以及角色
- 集群中所有存在的資料庫和保留策略(retention policy)
- 保存所有分片和分片組資訊
- 保存集群用戶許可權
data node保存所有原始時序數據以及元數據,包括
- measurement(數據表)
- tag key和value
- field key和value;
#wget //dl.influxdata.com/enterprise/releases/influxdb-meta_1.7.8-c1.7.8_amd64.deb
# dpkg -i influxdb-meta_1.7.8-c1.7.8_amd64.deb
influxdb-meda01
# egrep -v "#|^$" /etc/influxdb/influxdb-meta.conf hostname = "enterprise-meta-01" [enterprise] license-key = "224bca5e-514d-441e-b2c2-31b29dd79811" [meta] dir = "/var/lib/influxdb/meta" internal-shared-secret = "123.com"
influxdb-meda02
# egrep -v "#|^$" /etc/influxdb/influxdb-meta.conf hostname = "enterprise-meta-02" [enterprise] license-key = "224bca5e-514d-441e-b2c2-31b29dd79811" [meta] dir = "/var/lib/influxdb/meta" internal-shared-secret = "123.com"
influxdb-meda03
# egrep -v "#|^$" /etc/influxdb/influxdb-meta.conf hostname = "enterprise-meta-03" [enterprise] license-key = "224bca5e-514d-441e-b2c2-31b29dd79811" [meta] dir = "/var/lib/influxdb/meta" internal-shared-secret = "123.com"
# systemctl start influxdb-meta
# systemctl enable influxdb-meta
將meta node節點加入集群
#influxd-ctl add-meta enterprise-meta-02:8091
#influxd-ctl add-meta enterprise-meta-03:8091
【部署influxdb-node節點】
#wget //dl.influxdata.com/enterprise/releases/influxdb-data-1.8.2_c1.8.2.x86_64.rpm
#dpkg -i influxdb-data_1.8.2-c1.8.2_amd64.deb
#egrep -v “#|^$” /etc/influxdb/influxdb.conf
bind-address = "192.168.60.0:8088" hostname = "enterprise-data-01" [enterprise] license-key = "224bca5e-514d-441e-b2c2-31b29dd79811" [meta] dir = "/var/lib/influxdb/meta" meta-internal-shared-secret = "123.com" [data] dir = "/var/lib/influxdb/data" wal-dir = "/var/lib/influxdb/wal" cache-max-memory-size = "1g" cache-snapshot-memory-size = "25m" cache-snapshot-write-cold-duration = "10m" max-series-per-database = 0 max-values-per-tag = 0 max-index-log-file-size = "128k" [cluster] [hinted-handoff] dir = "/var/lib/influxdb/hh" [anti-entropy] [retention] [shard-precreation] [monitor] store-enabled = false [http] log-enabled = true [logging] [subscriber] [[graphite]] [[collectd]] [[opentsdb]] [[udp]] [continuous_queries] [tls]
# egrep -v “#|^$” /etc/influxdb/influxdb.conf
bind-address = "192.168.60.0:8088" hostname = "enterprise-data-02" [enterprise] license-key = "224bca5e-514d-441e-b2c2-31b29dd79811" [meta] dir = "/var/lib/influxdb/meta" meta-internal-shared-secret = "123.com" [data] dir = "/var/lib/influxdb/data" wal-dir = "/var/lib/influxdb/wal" cache-max-memory-size = "1g" cache-snapshot-memory-size = "25m" cache-snapshot-write-cold-duration = "10m" max-series-per-database = 0 max-values-per-tag = 0 max-index-log-file-size = "128k" [cluster] [hinted-handoff] dir = "/var/lib/influxdb/hh" [anti-entropy] [retention] [shard-precreation] [monitor] store-enabled = true [http] [logging] [subscriber] [[graphite]] [[collectd]] [[opentsdb]] [[udp]] [continuous_queries] log-enabled = true [tls]
#systemctl start influxd
#systemctl enable influxd
#將date node加入集群
#influxd-ctl add-data enterprise-data-01:8088
#influxd-ctl add-data enterprise-data-02:8088
最後我們在influxdb-meta節點上執行 influxd-ctl show查看集群節點狀態
截止目前influxdb集群部署完畢!END