创建一个Chronograf HA配置
要使用etcd集群作为共享数据存储来创建Chronograf高可用性(HA)配置,请执行以下操作:
- 安装并启动etcd
- 为Chronograf设置负载均衡器
- 开始 Chronograf
有一个现有的Chronograf配置存储,您想要与Chronograf HA配置一起使用?了解如何迁移您的Chronograf配置到共享数据存储。
架构
安装并启动etcd
启动Chronograf
运行以下命令以使用 etcd 作为存储层启动 Chronograf。语法取决于您是使用命令行标志还是 ETCD_ENDPOINTS 环境变量。
使用命令行标志定义etcd端点
# Syntax
chronograf --etcd-endpoints=<etcd-host>
# Examples
# Add a single etcd endpoint when starting Chronograf
chronograf --etcd-endpoints=localhost:2379
# Add multiple etcd endpoints when starting Chronograf
chronograf \
--etcd-endpoints=localhost:2379 \
--etcd-endpoints=192.168.1.61:2379 \
--etcd-endpoints=192.192.168.1.100:2379
使用 ETCD_ENDPOINTS 环境变量定义 etcd 端点
# Provide etcd endpoints in a comma-separated list
export ETCD_ENDPOINTS=localhost:2379,192.168.1.61:2379,192.192.168.1.100:2379
# Start Chronograf
chronograf
定义启用TLS的etcd端点
使用 --etcd-cert 标志来指定 etcd PEM 编码的公共证书文件的路径,使用 --etcd-key 标志来指定与 etcd 证书相关联的私钥的路径。
chronograf --etcd-endpoints=localhost:2379 \
--etcd-cert=path/to/etcd-certificate.pem \
--etcd-key=path/to/etcd-private-key.key
欲了解更多信息,请参见 Chronograf etcd 配置选项。