Nightingale——滴滴夜莺部署【一】

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: Nightingale——滴滴夜莺部署【一】

前言

!> 这个项目已经从滴滴抽离了,一些主程也开办自己的公司了,而且现在支持docker直接部署,具体的访问nightingale代码仓库吧。

夜莺(Nightingale)是滴滴基础平台联合滴滴云研发和开源的企业级监控解决方案。旨在满足云原生时代企业级的监控需求。Nightingale在产品完成度、系统高可用、以及用户体验方面,达到了企业级的要求,可满足不同规模用户的场景,小到几台服务,大到数十万都可以完美支撑。兼顾云原生和裸金属,支持应用监控和系统监控,插件机制灵活,插件丰富完善,具有高度的灵活性和可扩展性。

Nightingale 在 Open-Falcon 的基础上,结合滴滴内部的最佳实践,在性能、可维护性、易用性方面做了大量的改进,作为集团统一的监控解决方案,支撑了滴滴内部数十亿监控指标,覆盖了从系统、容器、到应用等各层面的监控需求,周活跃用户数千。

我们简单快捷,直接使用all-in-one来安装部署夜莺的这套监控系统~

步骤

下载n9e-1.3.0-438ec4a.el7.x86_64.rpm-bundle.tar.gz并进行解压和安装

wget https://dl.cactifans.com/n9e/1.3.0/n9e-1.3.0-438ec4a.el7.x86_64.rpm-bundle.tar.gz && tar -zxvf n9e-1.3.0-438ec4a.el7.x86_64.rpm-bundle.tar.gz && yum install n9e-* -y

安装相应的nginx和mysql

推荐使用oneinstack直接一键安装~

wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --nginx_option 1 --db_option 2 --dbinstallmethod 1 --dbrootpwd oneinstack --memcached  --reboot

mysql 导入表结构并创建相应的用户

mysql -uroot -p </usr/local/n9e/sql/n9e_hbs.sql
mysql -uroot -p </usr/local/n9e/sql/n9e_mon.sql
mysql -uroot -p </usr/local/n9e/sql/n9e_uic.sql

安全考虑,建议为 n9e 独立建立 mysql 用户,在 mysql 里创建 n9e 用户并授权

mysql>create user n9e@127.0.0.1 identified by '你的密码';
mysql>grant all on n9e_hbs.* to n9e@127.0.0.1;
mysql>grant all on n9e_mon.* to n9e@127.0.0.1;
mysql>grant all on n9e_uic.* to n9e@127.0.0.1;
mysql> flush privileges;

修改配置文件mysql.yml中的密码,通过sed或者手动都可以

vi /usr/local/n9e/etc/mysql.yml
---
uic:
  addr: "n9e:你的密码@tcp(127.0.0.1:3306)/n9e_uic?charset=utf8&parseTime=True&loc=Asia%2FShanghai"
  max: 16
  idle: 4
  debug: false
mon:
  addr: "n9e:你的密码@tcp(127.0.0.1:3306)/n9e_mon?charset=utf8&parseTime=True&loc=Asia%2FShanghai"
  max: 16
  idle: 4
  debug: false
hbs:
  addr: "n9e:你的密码@tcp(127.0.0.1:3306)/n9e_hbs?charset=utf8&parseTime=True&loc=Asia%2FShanghai"
  max: 16
  idle: 4
  debug: false

修改Nginx的配置文件

cat /usr/local/n9e/etc/nginx.conf 
   #放到http中
    proxy_connect_timeout   500ms;
    proxy_send_timeout      1000ms;
    proxy_read_timeout      3000ms;
    proxy_buffers           64 8k;
    proxy_busy_buffers_size    128k;
    proxy_temp_file_write_size 64k;
    proxy_redirect off;
    proxy_next_upstream error invalid_header timeout http_502 http_504;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-Port $remote_port;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# server内容
     upstream n9e.monapi {
        server 127.0.0.1:5800;
        keepalive 10;
    }
    upstream n9e.index {
        server 127.0.0.1:5830;
        keepalive 10;
    }
    upstream n9e.transfer {
        server 127.0.0.1:5810;
        keepalive 10;
    }
    server {
        listen      52000; #监听端口改成自己对外的接口
        server_name  _;
        root         /usr/share/nginx/html;
        # Load configuration files for the default server block.
        location / {
            root /usr/local/n9e/pub;
        }
        location /api/portal {
            proxy_pass http://n9e.monapi;
        }
        location /api/index {
            proxy_pass http://n9e.index;
        }
        location /api/transfer {
            proxy_pass http://n9e.transfer;
        }
    }

nginx的完整配置

cat /usr/local/nginx/conf/nginx.conf
user www www;
worker_processes auto;
error_log /data/wwwlogs/error_nginx.log crit;
pid /var/run/nginx.pid;
worker_rlimit_nofile 51200;
events {
  use epoll;
  worker_connections 51200;
  multi_accept on;
}
http {
  include mime.types;
  default_type application/octet-stream;
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 1024m;
  client_body_buffer_size 10m;
  sendfile on;
  tcp_nopush on;
  keepalive_timeout 120;
  server_tokens off;
  tcp_nodelay on;
  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;
  fastcgi_intercept_errors on;
    proxy_connect_timeout   500ms;
    proxy_send_timeout      1000ms;
    proxy_read_timeout      3000ms;
    proxy_buffers           64 8k;
    proxy_busy_buffers_size    128k;
    proxy_temp_file_write_size 64k;
    proxy_redirect off;
    proxy_next_upstream error invalid_header timeout http_502 http_504;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-Port $remote_port;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  
  #Gzip Compression
  gzip on;
  gzip_buffers 16 8k;
  gzip_comp_level 6;
  gzip_http_version 1.1;
  gzip_min_length 256;
  gzip_proxied any;
  gzip_vary on;
  gzip_types
    text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml
    text/javascript application/javascript application/x-javascript
    text/x-json application/json application/x-web-app-manifest+json
    text/css text/plain text/x-component
    font/opentype application/x-font-ttf application/vnd.ms-fontobject
    image/x-icon;
  gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  ##Brotli Compression
  #brotli on;
  #brotli_comp_level 6;
  #brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
  ##If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency.
  #open_file_cache max=1000 inactive=20s;
  #open_file_cache_valid 30s;
  #open_file_cache_min_uses 2;
  #open_file_cache_errors on;
######################## default ############################
  server {
    listen 80;
    server_name _;
    access_log /data/wwwlogs/access_nginx.log combined;
    root /data/wwwroot/default;
    index index.html index.htm index.php;
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    location /nginx_status {
      stub_status on;
      access_log off;
      allow 127.0.0.1;
      deny all;
    }
    location ~ [^/]\.php(/|$) {
      #fastcgi_pass remote_php_ip:9000;
      fastcgi_pass unix:/dev/shm/php-cgi.sock;
      fastcgi_index index.php;
      include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
      expires 30d;
      access_log off;
    }
    location ~ .*\.(js|css)?$ {
      expires 7d;
      access_log off;
    }
    location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) {
      deny all;
    }
  }
######################## nightingale ############################
   upstream n9e.monapi {
        server 127.0.0.1:5800;
        keepalive 10;
    }
    upstream n9e.index {
        server 127.0.0.1:5830;
        keepalive 10;
    }
    upstream n9e.transfer {
        server 127.0.0.1:5810;
        keepalive 10;
    }
    server {
        listen      52000;
        server_name  _;
        root         /usr/share/nginx/html;
        # Load configuration files for the default server block.
        location / {
            root /usr/local/n9e/pub;
        }
        location /api/portal {
            proxy_pass http://n9e.monapi;
        }
        location /api/index {
            proxy_pass http://n9e.index;
        }
        location /api/transfer {
            proxy_pass http://n9e.transfer;
        }
    }
########################## vhost #############################
  include vhost/*.conf;
}

验证配置是否正确

nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

重新载入nginx

service nginx reload

启动所有组件服务

systemctl enable --now n9e-collector n9e-tsdb n9e-transfer n9e-monapi n9e-judge n9e-index

查看服务状态

cd /usr/local/n9e/
#查看有哪些命令
./control -h
Usage: ./control {start|stop|restart|status|build|pack} <module>
#查看所有服务状态(一共6个) | 全部启动后就可以进行下一步, 若某一个没启动可到/usr/local/n9e/logs中去查看相关服务的日志
 ./control status
root      18322  0.1  0.1 996288 25792 ?        Sl   May08   2:27 /usr/local/n9e/n9e-index
root      18351  0.1  0.1 1069996 22916 ?       Sl   May08   2:50 /usr/local/n9e/n9e-judge
root      18381  0.2  0.1 1152172 28780 ?       Sl   May08   5:28 /usr/local/n9e/n9e-collector
n9e       66032  0.1  0.1 1408048 28484 ?       Ssl  May08   2:53 /usr/local/n9e/n9e-tsdb
n9e       66116  0.6  0.1 1061668 23156 ?       Ssl  May08  13:21 /usr/local/n9e/n9e-transfer
n9e       66131  0.6  0.1 1070460 29588 ?       Ssl  May08  13:13 /usr/local/n9e/n9e-monapi
#启动(单个模块/所有模块 )
./control start collector 
./control start all

访问

使用浏览器打开http://公网ip 即可访问,默认账号 root 密码 root

学无止境,谦卑而行.

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
5月前
|
存储 分布式计算 Hadoop
Hadoop:驭服数据洪流的利器
在当今信息大爆炸的时代,海量数据成为企业决策的重要依据。本文将介绍大规模数据处理框架Hadoop的概念与实践,探讨其在解决大数据应用中的重要性和优势。从分布式计算、高可靠性、扩展性等方面深入剖析Hadoop的工作原理,并结合实例说明如何利用Hadoop来处理海量数据,为读者提供了解和运用Hadoop的基础知识。
|
2月前
|
监控 机器人 Shell
Nightingale——夜莺监控系统部署企业微信机器人告警系【四】
Nightingale——夜莺监控系统部署企业微信机器人告警系【四】
73 1
Nightingale——夜莺监控系统部署企业微信机器人告警系【四】
|
人工智能 数据可视化 数据挖掘
Kyligence Zen产品体验——一站式指标平台泰酷辣~(下)
Kyligence Zen产品体验——一站式指标平台泰酷辣~(下)
257 0
|
机器学习/深度学习 人工智能 数据可视化
Kyligence Zen产品体验——一站式指标平台泰酷辣~(上)
Kyligence Zen产品体验——一站式指标平台泰酷辣~
204 0
|
消息中间件 存储 运维
《2023云原生实战案例集》——01 汽车/制造——车主无忧 Kafka商业版助力车主无忧系统稳健
《2023云原生实战案例集》——01 汽车/制造——车主无忧 Kafka商业版助力车主无忧系统稳健
|
运维 Prometheus 监控
【滴滴开源运维监控系统】夜莺V5版本部署实践
【滴滴开源运维监控系统】夜莺V5版本部署实践
1050 0
【滴滴开源运维监控系统】夜莺V5版本部署实践
|
运维 监控 持续交付
腾讯蓝鲸智云运维平台单机版本部署实践
腾讯蓝鲸智云运维平台单机版本部署实践
1150 0
腾讯蓝鲸智云运维平台单机版本部署实践
|
人工智能 Prometheus 运维
可观测公司新秀:OpsCruise介绍
可观测公司新秀:OpsCruise介绍
222 0
|
数据安全/隐私保护 开发者
新大陆云平台配置(2)
云平台登陆代码详解 开启应用 登陆云平台
386 0
新大陆云平台配置(2)
|
开发工具 Android开发
新大陆云平台配置(1)
下载云平台Android–SDK 云平台Android–SDK下载
368 0
新大陆云平台配置(1)
下一篇
无影云桌面