1.0 背景介紹
最近在對開源的新型監(jiān)控做調(diào)研,發(fā)現(xiàn)Nightingale功能強(qiáng)大,使用效果還不錯,并對,并對目前監(jiān)控做了一個對比
夜鶯監(jiān)控( Nightingale )是一款國產(chǎn)、開源云原生監(jiān)控分析系統(tǒng),采用 All-In-One 的設(shè)計,集數(shù)據(jù)采集、可視化、監(jiān)控告警、數(shù)據(jù)分析于一體。于 2020 年 3 月 20 日,在 github 上發(fā)布 v1 版本,已累計迭代 60 多個版本。從 v5 版本開始與 Prometheus、VictoriaMetrics、Grafana、Telegraf、Datadog 等生態(tài)緊密協(xié)同集成,提供開箱即用的企業(yè)級監(jiān)控分析和告警能力,已有眾多企業(yè)選擇將 Prometheus + AlertManager + Grafana 的組合方案升級為使用夜鶯監(jiān)控。
2.0 安裝部署
2.1 安裝依賴組件
# 安裝 mysql 數(shù)據(jù)庫 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,并配置服務(wù)啟動參數(shù)
prometheus官網(wǎng)下載 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 下載不下來 用上面的網(wǎng)盤下載 后 上傳至服務(wù)器后解壓縮 tar xf prometheus-2.28.0.linux-amd64.tar.gz cp -far prometheus-2.28.0.linux-amd64/* /opt/prometheus/
2.3prometheus服務(wù)設(shè)置
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開啟服務(wù)及開機(jī)啟動設(shè)置
systemctl daemon-reload systemctl enable prometheus systemctl restart prometheus systemctl status prometheus
3.0安裝夜鶯并配置啟動(二進(jìn)制方式)
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 & 查看進(jìn)程 ps -ef | grep n9e server ps -ef | grep n9e webapi
配置啟動
vim /opt/n9e/etc/config.toml
下面更改mysql的信息的真實(shí)地址 更改為你的信息 我的是本機(jī)部署 不改動 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的地址的真實(shí)地址 我是本機(jī)部署 我不需要需要更改 [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的真實(shí)地址 我是本機(jī)部署 不更改 [[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
其他配置保持默認(rèn)即可,如果啟動成功,server 默認(rèn)會監(jiān)聽在 19000 端口,webapi 會監(jiān)聽在 18000 端口默認(rèn)用戶是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
下載二進(jìn)制包
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
我這里配置的是本機(jī)所以是127.0.0.1/其他機(jī)器請配置真實(shí)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
審核編輯:湯梓紅
-
監(jiān)控
+關(guān)注
關(guān)注
6文章
2162瀏覽量
55041 -
開源
+關(guān)注
關(guān)注
3文章
3215瀏覽量
42310 -
GitHub
+關(guān)注
關(guān)注
3文章
465瀏覽量
16359
原文標(biāo)題:Nightingale | 夜鶯監(jiān)控部署安裝和使用
文章出處:【微信號:magedu-Linux,微信公眾號:馬哥Linux運(yùn)維】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
相關(guān)推薦
評論