Nightingale
夜莺(Nightingale)学习笔记
1、编译安装
mkdir -p $GOPATH/src/github.com/didi
cd $GOPATH/src/github.com/didi
# clone代码并编译打包,pack时会自动build,打包成一个tar.gz
git clone https://github.com/didi/nightingale.git
cd nightingale && ./control build && ./control pack
mysql -uroot -p < sql/n9e_hbs.sql
mysql -uroot -p < sql/n9e_mon.sql
mysql -uroot -p < sql/n9e_uic.sql
etc/address.yml
./control start all
# 安装nginx
yum install nginx -y
# 安装Redis和mysql
yum install mariadb-server mariadb redis -y
# 启动mariadb并开机自启动
systemctl start mariadb
systemctl enable mariadb
# 启动mysql安全配置向导
mysql_secure_installation
# 修改mariadb监听IP地址
vim /etc/my.cnf
msyqld下添加一行
bind-address=127.0.0.1
# 重启mariadb
systemctl restart mariadb
# 启动redis并开机自启动
systemctl start redis
systemctl enable redis
# 安装golang
cd ~
wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz
tar zxvf go1.14.1.linux-amd64.tar.gz
# 修改环境变量
vim ~/.bash_profile
修改、添加以下内容
export GOROOT=/root/go
export GOPATH=/root/gopath
PATH=$GOROOT/bin:$GOPATH/bin:$PATH:$HOME/bin
# source
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个模块均需启动
# 浏览器输入IP
# 账号root 密码root
浙公网安备 33010602011771号