最简单的docker方式安装就不介绍了,这里讲一下我在装m3db单机多实例集群时遇到的问题和爬坑过程node
为了搭配exporter + prometheus + grafana使用,prometheus暂不支持分片。使用federate方式来作的话,架构比较复杂git
这里使用m3db官方网站上的架构图github
首先咱们下载etcd,而后执行就能够,这里咱们暂时不使用集群docker
nohup ./etcd &> /dev/null &
这里附上第一个节点的配置文件,须要注意的地方我会在下面用注释的方式指出 数据库
coordinator: listenAddress: type: "config" value: "0.0.0.0:7201" # 交互端口 local: namespaces: - namespace: default # 数据要存入的表 type: unaggregated # 数据类型 retention: 48h # 数据保存时间 metrics: # coordinator自己的metric scope: prefix: "coordinator" prometheus: handlerPath: /metrics listenAddress: 0.0.0.0:7203 # until https://github.com/m3db/m3/issues/682 is resolved sanitization: prometheus samplingRate: 1.0 extended: none tagOptions: # Configuration setting for generating metric IDs from tags. idScheme: quoted # 这个必须 db: logging: level: info metrics: prometheus: handlerPath: /metrics sanitization: prometheus samplingRate: 1.0 extended: detailed hostID: # 这里实测后,其实能够理解为nodeID resolver: config # 单机多实例,这里必须设置为config,从文件中读取 value: node1 # 这个实例的Id config: # config段的配置都是和etcd相关的 service: env: default_env zone: embedded service: m3db # 服务名。能够按照consul中的service进行理解 cacheDir: /data1/m3db/cache etcdClusters: - zone: embedded endpoints: - 127.0.0.1:2379 listenAddress: 0.0.0.0:9000 clusterListenAddress: 0.0.0.0:9001 httpNodeListenAddress: 0.0.0.0:9002 httpClusterListenAddress: 0.0.0.0:9003 debugListenAddress: 0.0.0.0:9004 client: writeConsistencyLevel: majority # 写一致性级别 readConsistencyLevel: unstrict_majority gcPercentage: 100 writeNewSeriesAsync: true writeNewSeriesLimitPerSecond: 1048576 writeNewSeriesBackoffDuration: 2ms bootstrap: bootstrappers: # 启动顺序 - filesystem - commitlog - peers - uninitialized_topology fs: numProcessorsPerCPU: 0.125 cache: series: policy: lru postingsList: size: 262144 commitlog: flushMaxBytes: 524288 flushEvery: 1s blockSize: 10m queue: calculationType: fixed size: 2097152 fs: filePathPrefix: /data1/m3db # m3dbnode数据目录