# install-statsd **Repository Path**: coderxiaojian/install-statsd ## Basic Information - **Project Name**: install-statsd - **Description**: No description available - **Primary Language**: Shell - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-11-10 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 部署单个statsd进程 a) ./setup.sh b) ./run.sh start 脚本会在/home/statsd目录安装statsd. 1. 安装nodejs 2. 安装git, 并clone最新的statsd库. 3. 增加config.js配置文件. ## 部署statsd集群 a) 集群介绍 - ref: https://anomaly.io/scaling-statsd/ - 一句话概括: 启一系列proxy进程(通过nodejs cluster模块)接收消息, 通过hash发送给后端多个statsd进程. b) ./cluster_setup.sh 安装成功后目录结构如下: ``` /home/statsd ├── cluster_run_statsd.sh ├── config-normal # 集群normal配置 │ ├── normal-config1.js │ ├── normal-config2.js │ └── normal-proxyConfig.js ├── config-http # 集群http配置. │ ├── http-config1.js │ ├── http-config2.js │ └── http-proxyConfig.js ├── logs │ ├── normal.log │ └── normal-proxy.log └── statsd ``` 注: 1. 如果graphite-carbon有多个relay进程, 在config.js配置中最好配置多个relay地址, 防止单个statsd集群全往同一个relay进程发消息. 2. 每新增一个config.js, 需要在proxyConfig.js配置nodes中增加相应节点. c) ./cluster_run_statsd.sh start {cluster_name}