BK Componet Monitor
Apache
a) 启动服务前将监听地址改成0.0.0.0
b) 确认在文件“/etc/httpd/conf.modules.d/00-base.conf“中有加载mod_status模块
c) 新建文件“/etc/httpd/conf.modules.d/02-status.conf“,输入以下内容
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,Allow
Deny from all # 表示禁止任何来源访问
Allow from 127.0.0.1 # 表示只允许本机访问
</Location>
d) 重启服务
e) 开启监控
MySQL
a) 安装命令:yum install -y mariadb-server
b) 启动服务:systemctl start mariadb
c) 初始化: mysql_secure_installation(不要设置root密码)
d) 配置蓝鲸账户
e) 开启监控
Nginx
a) 安装rpm包
b) 在/etc/nginx/nginx.conf中添加以下内容:
location /nginx_status {
stub_status on;
}
如图所示:
c) 重启服务
d) 开启监控
Tomcat
a) 安装服务:yum install -y tomcat tomcat-webapps tomcat-admin-webapps
b) 修改配置文件:/etc/tomcat/server.xml,添加如下一行内容:
JAVA_OPTS="-Djava.net.preferIPv4Stack=true"
c) 修改配置文件:/etc/tomcat/server.xml
d) 启动服务
e) 开启监控
RabbitMQ
备注:仅限admin用户
a) 安装服务: yum install -y rabbitmq-server
b) 启动服务: systemctl start rabbitmq-server
c) Management Plugin服务开启: rabbitmq-plugins enable rabbitmq_management
d) 重启服务: systemctl restart rabbitmq-server
e) 默认用户: guest/guest
f) 开启监控
MongoDB
a) 安装服务: yum install -y mongodb mongodb-server python-pymongo
b) 修改配置文件“/etc/mongod.conf“
bind_ip = 0.0.0.0
port = 27017
httpinterface = true
auth = true
ipv6 = false
c) 启动服务: systemctl start mongod
d) 创建超级用户:
mongo 127.0.0.1/admin --eval 'db.createUser({user:"admin", pwd:"yovole.com", roles:["root"]})'
e) 验证用户是否创建成功:
mongo 127.0.0.1/admin -u admin -p yovole.com --eval "db.system.users.find().forEach(printjson)"
f) 创建监控用户:
mongo 127.0.0.1/admin -u admin -p yovole.com --eval 'db.createUser({user:" datadog", pwd:"yovole.com", roles:[ {role: "read", db: "admin" }, {role: "clusterMonitor", db: "admin"},{role: "read", db: "local" }]})'
g) 开启监控