Nightingale essay: installation

Nightingale is a new generation of domestic intelligent monitoring system. It has good support for cloud native scenes and traditional physical machine virtual machine scenes. It is built in 10 minutes and familiar with the use in 1 hour. It has withstood the verification of massive data in didi production environment. It hopes to build a benchmark for domestic monitoring. At present, it is V5 0. From this version, it has done collaborative integration with Prometheus, VictoriaMetrics, Grafana, Telegraf and other ecosystems, and strive to build the best open source operation and maintenance monitoring system in China.


If it is only for quick testing, Docker deployment is the fastest, but many friends may not have Docker environment. In addition, in order to reduce the introduction of more technology stacks and enhance the stability of the production environment, some friends may not want to use Docker. This article will explain how to quickly deploy the stand-alone version. The supporting timing library of the stand-alone version uses Prometheus. If there are thousands of machines and hundreds of services to be monitored, and the capacity of the single version cannot be met, you can use the cluster version. It is recommended to use VictoriaMetrics or M3DB for the timing library of the cluster version. However, the architecture of M3DB is more complex and many friends can't handle it. Choosing simple VictoriaMetrics is enough for most companies. Let's take a look at the server architecture first:

  • Core module server: server is used for alarm. It will synchronize alarm rules from the database, and then read Prometheus data for alarm judgment. The server can also receive the monitoring data report, and then write to multiple timing libraries through the remote write protocol. The server also relies on redis, which stores the heartbeat information of the server itself and the monitoring object.
  • Core module webapi: provide restful api for interacting with front-end JavaScript, write some user configuration class information into mysql, use jwt for authentication, and use redis to store jwt's token. In the mode of stand-alone deployment, redis of server and redis of webapi can be reused.

Article environment

  • CentOS 8
  • Redis
  • Prometheus
  • VictoriaMetrics
  • Mariadb

Machine details in this document

  • Hua Weiyun
  • n9e(server/webapi/prometheus/mariadb/redis):
  • VictoriaMetrics:

Install front-end software (if any, please ignore)

dnf -y install vim git wget 

Install Prometheus

mkdir /opt/prometheus 
tar xf prometheus-2.33.0.linux-amd64.tar.gz
cp -far prometheus-2.33.0.linux-amd64/* /opt/prometheus/

Create Prometheus service file

cat <<EOF >/etc/systemd/system/prometheus.service


ExecStart=/opt/prometheus/prometheus  --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --enable-feature=remote-write-receiver --query.lookback-delta=2m 



Start Prometheus

systemctl enable prometheus
systemctl restart prometheus

mount this database

dnf -y install mariadb-server

Start the database and set the password

You can set the password yourself. This article is xiaoyu123

systemctl start mariadb
systemctl enable mariadb
mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('xiaoyu123');" 

Install redis and start

dnf -y install redis 
systemctl start redis 
systemctl enable redis 

Install Nightingale assembly

mkdir -p /opt/n9e && cd /opt/n9e
tar zxvf n9e-5.3.1.tar.gz

Import database file

mysql -uroot -pxiaoyu123 < docker/initsql/a-n9e.sql

Modify Nightingale related configuration

Since the database password of the default configuration file is 1234, it needs to be adjusted.

vim etc/server.conf
vim etc/webapi.conf

Create service file

It comes with by default. You only need to adjust the parameters, mainly the startup file path and working directory.

vim etc/service/n9e-server.service
cp etc/service/n9e-server.service /usr/lib/systemd/system/
systemctl start n9e-server
systemctl enable n9e-server
vim etc/service/n9e-webapi.service
cp etc/service/n9e-webapi.service /usr/lib/systemd/system
systemctl start n9e-webapi
systemctl enable n9e-webapi

Access test

The default username and password is root / root two thousand and twenty

Download and install VictoriaMetrics standalone

mkdir -p /opt/vm && cd /opt/vm
tar zxvf victoria-metrics-amd64-v1.72.0.tar.gz

Start database

The default stand-alone port number is 8428

mkdir /data
./victoria-metrics-prod -storageDataPath /data

Create daemon file

cat <<EOF >/etc/systemd/system/victoria.service


ExecStart=/opt/vm/victoria-metrics-prod -storageDataPath /data 



Start vm database

systemctl start victoria
systemctl enable victoria

Test interface


Modify configuration

N9e server writes to the timing library through the remote write interface. vm is an option of the timing library, and its remote write interface address is: , configure this address to server Conf, restart n9e-server after configuration.

vim /opt/n9e/etc/server.conf
vim /opt/n9e/etc/webapi.conf

prometheus add remote write module

vim /opt/prometheus/prometheus.yml

Restart needs to be checked

Write at the end

The overall installation process is relatively simple. The next article will bring about how to use telegraf and exporter to carry out monitoring tasks.

Added by arjay_comsci on Wed, 16 Feb 2022 13:46:47 +0200