1.0 背景介紹
最近在對開源的新型監控做調研,發現Nightingale功能強大,使用效果還不錯,并對,并對目前監控做了一個對比
夜鶯監控( Nightingale )是一款國產、開源云原生監控分析系統,采用 All-In-One 的設計,集數據采集、可視化、監控告警、數據分析于一體。于 2020 年 3 月 20 日,在 github 上發布 v1 版本,已累計迭代 60 多個版本。從 v5 版本開始與 Prometheus、VictoriaMetrics、Grafana、Telegraf、Datadog 等生態緊密協同集成,提供開箱即用的企業級監控分析和告警能力,已有眾多企業選擇將 Prometheus + AlertManager + Grafana 的組合方案升級為使用夜鶯監控。
2.0 安裝部署
2.1 安裝依賴組件
# 安裝 mysql 數據庫 yum -y install mariadb* systemctl enable mariadb systemctl restart mariadb systemctl status mariadb mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1234');" # 安裝 redis yum install -y redis systemctl enable redis systemctl restart redis systemctl status redis
2.2安裝prometheus,并配置服務啟動參數
prometheus官網下載 https://prometheus.io/download/ 下載不下來用下面的 鏈接:https://pan.baidu.com/s/1KSwB0YTWYvnTGH_98dfC6g 提取碼:4xpo
mkdir -p /opt/prometheus wget https://github.com/prometheus/prometheus/releases/download/v2.28.0/prometheus-2.28.0.linux-amd64.tar.gz -O prometheus-2.28.0.linux-amd64.tar.gz 或者 wget https://s3-gz01.didistatic.com/n9e-pub/prome/prometheus-2.28.0.linux-amd64.tar.gz -O prometheus-2.28.0.linux-amd64.tar.gz 下載不下來 用上面的網盤下載 后 上傳至服務器后解壓縮 tar xf prometheus-2.28.0.linux-amd64.tar.gz cp -far prometheus-2.28.0.linux-amd64/* /opt/prometheus/
2.3prometheus服務設置
vim /etc/systemd/system/prometheus.service 如下 [Unit] Description="prometheus" Documentation=https://prometheus.io/ After=network.target [Service] Type=simple 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 Restart=on-failure SuccessExitStatus=0 LimitNOFILE=65536 StandardOutput=syslog StandardError=syslog SyslogIdentifier=prometheus [Install] WantedBy=multi-user.target
2.4prometheus開啟服務及開機啟動設置
systemctl daemon-reload systemctl enable prometheus systemctl restart prometheus systemctl status prometheus
3.0安裝夜鶯并配置啟動(二進制方式)
mkdir -p /opt/n9e && cd /opt/n9e # 去 https://github.com/didi/nightingale/releases 我下載的n9e-v6.6.1-linux-amd64.tar.gz tar zxvf n9e-v6.6.1-linux-amd64.tar.gz mysql -uroot -p1234 < docker/initsql/a-n9e.sql cd /opt/n9e nohup ./n9e server &> server.log & nohup ./n9e webapi &> webapi.log & 查看進程 ps -ef | grep n9e server ps -ef | grep n9e webapi
配置啟動
vim /opt/n9e/etc/config.toml
下面更改mysql的信息的真實地址 更改為你的信息 我的是本機部署 不改動 root密碼1234 和上面一樣 我也不改 [DB] # postgres: host=%s port=%s user=%s dbname=%s password=%s sslmode=%s # postgres: DSN="host=127.0.0.1 port=5432 user=root dbname=n9e_v6 password=1234 sslmode=disable" DSN="root:1234@tcp(127.0.0.1:3306)/n9e_v6?charset=utf8mb4&parseTime=True&loc=Local&allowNativePasswords=true" # enable debug mode or not Debug = false # mysql postgres DBType = "mysql" # unit: s
更改redis的地址的真實地址 我是本機部署 我不需要需要更改 [Redis] # address, ip:port or ip1:port,ip2:port for cluster and sentinel(SentinelAddrs) Address = "127.0.0.1:6379" # Username = "" # Password = "" # DB = 0 # UseTLS = false # TLSMinVersion = "1.2" # standalone cluster sentinel RedisType = "standalone" # Mastername for sentinel type # MasterName = "mymaster" # SentinelUsername = "" # SentinelPassword = ""
更改prometheus的真實地址 我是本機部署 不更改 [[Pushgw.Writers]] # Url = "http://127.0.0.1:8480/insert/0/prometheus/api/v1/write" Url = "http://127.0.0.1:9090/api/v1/write" # Basic auth username BasicAuthUser = "" # Basic auth password BasicAuthPass = "" # timeout settings, unit: ms Headers = ["X-From", "n9e"] Timeout = 10000 DialTimeout = 3000 TLSHandshakeTimeout = 30000 ExpectContinueTimeout = 1000 IdleConnTimeout = 90000
其他配置保持默認即可,如果啟動成功,server 默認會監聽在 19000 端口,webapi 會監聽在 18000 端口默認用戶是root,密碼是root.2020
http://10.10.201.222:17000/ netstat -tlnp | grep 17000
3.2配置采集器categraf
github地址
https://github.com/flashcatcloud/categraf/releases/tag/v0.2.35
下載二進制包
wge https://github.com/flashcatcloud/categraf/releases/download/v0.2.35/categraf-v0.2.35-linux-amd64.tar.gz tar zxvf categraf-0.2.35.tar.gz mv categraf-0.2.35 categraf vim /opt/n9e/categraf/conf/config.toml
我這里配置的是本機所以是127.0.0.1/其他機器請配置真實ip
[[writers]] url = "http://127.0.0.1:17000/prometheus/v1/write"
[heartbeat] enable = true # report os version cpu.util mem.util metadata url = "http://127.0.0.1:17000/v1/n9e/heartbeat"
配置systemd 啟動管理
vim /etc/systemd/system/categraf.service 如下 [Unit] Description="Categraf" After=network.target [Service] Type=simple ExecStart=/opt/n9e/categraf/categraf WorkingDirectory=/opt/n9e/categraf/ Restart=on-failure SuccessExitStatus=0 LimitNOFILE=65536 StandardOutput=syslog StandardError=syslog SyslogIdentifier=categraf [Install] WantedBy=multi-user.target
systemctl daemon-reload systemctl enable categraf systemctl enable categraf systemctl restart categraf systemctl status categraf
審核編輯:湯梓紅
-
監控
+關注
關注
6文章
2219瀏覽量
55280 -
開源
+關注
關注
3文章
3374瀏覽量
42598 -
GitHub
+關注
關注
3文章
473瀏覽量
16501
原文標題:Nightingale | 夜鶯監控部署安裝和使用
文章出處:【微信號:magedu-Linux,微信公眾號:馬哥Linux運維】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
評論