最簡單的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數據目錄