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