Nightingale官网说明http://n9e.didiyun.com/docs/install/compile/
Nightingale安装教程
一、 安装准备环境
1. 安装nginx
yum install nginx -y
2. 安装mysql和redis
yum install mariadb-server mariadb redis -y
1) 启动mariadb并开机自启动
systemctl start mariadb
systemctl enable mariadb
2) 启动mysql安全配置向导
mysql_secure_installation
默认配置回车即可,root密码设为1234
3) 修改mariadb监听IP地址
vim /etc/my.cnf
添加一行
bind-address=127.0.0.1
4) 重启mariadb
systemctl restart mariadb
5) 启动redis并开机自启动
systemctl start redis
systemctl enable redis
默认redis密码为空
3. 安装golang
1) 下载并解压
cd ~
wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
tar zxvf go1.14.1.linux-amd64.tar.gz
2) 修改环境变量
vim ~/.bash_profile
修改、添加以下内容
export GOROOT=/root/go
export GOPATH=/root/gopath
PATH=$GOROOT/bin:$GOPATH/bin:$PATH:$HOME/bin
3) 使配置立即生效
source ~/.bash_profile
二、 源码编译安装
mkdir -p $GOPATH/src/github.com/didi
cd $GOPATH/src/github.com/didi
git clone https://github.com/didi/nightingale.git
cd nightingale
./control build
./control pack
三、 修改mysql配置文件
cd /root/gopath/src/github.com/didi/nightingale
vim etc/mysql.yml
修改mysql用户名和密码部分与服务器mysql相同
默认为用户root,密码1234
四、 导入数据库
cd /root/gopath/src/github.com/didi/nightingale/sql
mysql -uroot -p < n9e_hbs.sql
mysql -uroot -p < n9e_mon.sql
mysql -uroot -p < n9e_uic.sql
五、 修改nginx配置文件
cp /root/gopath/src/github.com/didi/nightingale/etc/nginx.conf /etc/nginx/nginx.conf
vim /etc/nginx/nginx.conf
更改pub目录的真实路径/root/gopath/src/github.com/didi/nightingale/pub
六、 启动nginx
systemctl start nginx
systemctl enable nginx
七、 启动Nightingale
cd /root/gopath/src/github.com/didi/nightingale
./control start all
查看状态
./control status
一共6个模块均需启动
八、 登录Nightingale
浏览器输入http://ip
web页面账号root密码root