文档手册
v3版本文档全部使用
后续会放到微信公众号:ops-soldier
1)组件启动报错,比如fail: 'addr:10.32.0.49' not ip
etc目录下有个identity.yml,里边配置了一条shell获取ip,这个shell未必能兼容所有的机器环境,这个报错就是典型,
说明这个shell打印的output多了一个addr:前缀,解决办法有两个,一个是修改这个identity.yml里的shell,用awk或cut切掉addr:;
另一个是直接把ip写死指定在specify里
shell: ifconfig eth0|awk -F '[ :]+' 'NR==2 {print $4}'
2)获取磁盘空间为0G 的情况
vi etc/agent.yml
disk: df -m|awk '{sum +=$1}END{printf "%dGi", sum/1024}' //取 $1或$2 的值,此情形只存在 Centos6的系统平台
https://n9e.didiyun.com/
https://gitee.com/cnperl/Nightingale
https://studygolang.com/dl
go download
wget https://xxx.xxx/goxxx.tar.gx
tar xf goxxx.tar.gx -C /usr/local/
vi /etc/profile
export GOROOT=/usr/local/go
export GOPATH=/usr/local/gopath
PATH=$GOROOT/bin:$GOPATH/bin:$PATH:$HOME/bin
source /etc/profile
mkdir -p /usr/local/gopath/src/github.com/didi
cd /usr/local/gopath/src/github.com/didi
https://github.com/didi/nightingale
git clone https://github.com/didi/nightingale.git
cd nightingale
./control build
yum install -y mariadb* redis nginx
systemctl start mariadb.service
systemctl enable mariadb.service
systemctl status mariadb.service
mysql_secure_installation
systemctl start redis
systemctl enable redis
vi /etc/redis.conf
#requirepass foobared
requirepass passwordxxx
systemctl restart redis
vi /etc/my.cnf
bind-address=127.0.0.1
vi /etc/mysql.yaml
cd /nightingale/sql
mysql -u root -p < n9e_hbs.sql
mysql -u root -p < n9e_mon.sql
mysql -u root -p < n9e_uic.sql
cd /root/gopath/src/github.com/didi/nightingale/etc
cp nginx.conf /etc/nginx/nginx.conf
cd /root/gopath/src/github.com/didi/nightingale/pub
systemctl start nginx
systemctl status nginx
systemctl enable nginx
cd /root/gopath/src/github.com/didi/nightingale
./control start all
./control status
ss -tlnp |grep 58
nginx root;
http://ip
root root.2020
Nightingale 爬坑经历:v3.3.1
cd nightingale/etc
vi mysql.yml 修改数据库连接密码
vi monapi.yml 修改redis 密码
1、MySQL更新 nightingale/sql n9e_ams_3.1.6.sql n9e_rdb_3.3.0.sql root登入mariadb
use 对应的库,,,drop table table_name; 再粘贴sql脚本语句进来;
2、下载并解压 pub-11-23.tar.gz 到nightingale/ 修改/etc/nignx/nginx.conf root 路径;
3、
cd nightingale/
mkdir -p tmp/etc
cd tmp
cp ../etc/address.yml agent.yml identity.yml etc/
cp ../etc/service/agent.service .
cd etc/
vi agent.yml
# physical:物理机,virtual:虚拟机,container:容器,switch:交换机
#cate: physical
cate: virtual
vi address.yml
---
rdb:
http: 0.0.0.0:8000
addresses:
- 127.0.0.1
ams:
http: 0.0.0.0:8002
addresses:
- 172.33.20.xxx//加服务端IP地址
job:
http: 0.0.0.0:8004
rpc: 0.0.0.0:8005
addresses:
- 172.33.20.xxx//加服务端IP地址
monapi:
http: 0.0.0.0:8006
addresses:
- 172.33.20.xxx//加服务端IP地址
transfer:
http: 0.0.0.0:8008
rpc: 0.0.0.0:8009
addresses:
- 172.33.20.xxx//加服务端IP地址
tsdb:
http: 0.0.0.0:8010
rpc: 0.0.0.0:8011
index:
http: 0.0.0.0:8012
rpc: 0.0.0.0:8013
addresses:
- 127.0.0.1
judge:
http: 0.0.0.0:8014
rpc: 0.0.0.0:8015
addresses:
- 127.0.0.1
agent:
http: 0.0.0.0:2080
cd ../tmp
tar cvfz n9e-agent.tar.gz *
cp n9e-agent.tar.gz ../pub
客户端:
#!/bin/bash
#
mkdir -p /home/n9e
cd /home/n9e
wget 172.33.20.xxx/n9e-agent.tar.gz
tar xf n9e-agent.tar.gz
cp agent.service /usr/lib/systemd/system
systemctl enable agent.service
systemctl start agent.service
iptables -I INPUT 6 -s 172.33.20.xxx -j ACCEPT
/etc/init.d/iptables save