当前位置: 首页 > news >正文

网站建设策划书模板wordpress教程 吾爱

网站建设策划书模板,wordpress教程 吾爱,小米发布会直播在线观看,视频在线制作网站1、作用 1、可以在本机收集日志2、也可以远程收集日志3、轻量级的日志收集系统,可以在非java环境运行。logstash是在jmv环境中运行,资源消耗很大,启动一个logstash要消耗500M左右的内存,filebeat只消耗10M左右的内存。收集nginx的…

1、作用

1、可以在本机收集日志2、也可以远程收集日志3、轻量级的日志收集系统,可以在非java环境运行。logstash是在jmv环境中运行,资源消耗很大,启动一个logstash要消耗500M左右的内存,filebeat只消耗10M左右的内存。收集nginx的日志

2、收集nginx日志

systemctl restart nginx
systemctl stop firewalld
setenforce 0#解压,将filebeat移到/usr/local下
tar -xf filebeat-6.7.2-linux-x86_64.tar.gz
mv filebeat-6.7.2-linux-x86_64 /usr/local/filebeat#备份
cd /usr/local/filebeat
cp filebeat.yml filebeat.yml.bak#修改配置文件
vim filebeat.yml
type: log
enabled: true
paths:- /usr/local/nginx/logs/access.log- /usr/local/nginx/logs/error.log
#开启日志收集,以及确定日志文本的路径,指定标签和发送到目标主机的logstashtags: ["nginx"]fields: service_name: 192.168.230.21_nginxlog_type_ nginxfrom: 192.168.230.21#output.elasticsearch:# Array of hosts to connect to.#hosts: ["localhost:9200"]outout elasticsearch
output.logsatsh:
hosts: ["192.168.230.30:5045"]
#5044是logstash默认的端口,只要是logstash主机上没有被占用的端口都可以使用,端口号要大于1024#修改从21接收的nginx日志文件
vim nginx_21.confinput {beats { port => "5045"}
}output {if "nginx" in [tags] {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "%{[fields][service_name]}-%{+YYYY.MM.dd}"}}
}#启动filebeat
nohup ./filebeat -e -c filebeat.yml > filebeat.out &
#-e:输出到标准输出-c:指定配置文件nohup:在系统的后台运行,不会因为终端的关闭导致程序停机运行;可以把运行的日志保存到指定文件#后后台运行
logstash -f nginx_61.conf --path.data /opt/test2 &

3、远程收集nginx、http、mysql日志

filebeat远程收集发送到logstash主机

展示的索引:

192.168.230.21_mysql-*

192.168.230.21_nginx-*

192.168.230.21_http-*

systemctl stop firewalld
setenforce 0#修改配置文件
vim /etc/my.cnf
添加:
general_log=ON
general_log_file=/usr/local/mysql/data/mysql_general.log#安装httpd、nginx
yum -y install httpd nginx#重启mysqld、httpd
systemctl restart mysqld
systemctl restart httpd#修改nginx的端口号
listen       85;
#listen       [::]:80;#重启nginx
systemctl restart nginx#浏览器访问nginx、httpd#将filebeat的安装包放到/opt目录下,并解压
tar -xf filebeat-6.7.2-linux-x86_64.tar.gz#将filebeat-6.7.2-linux-x86_64放到/opt命令下,改名为filebeat
mv filebeat-6.7.2-linux-x86_64 filebeat#修改filebeat的配置文件
vim filebeat.yml
- type: logenabled: truepaths:- /var/log/nginx/access.log- /var/log/nginx/error.logtags: ["nginx"]fields:service_name: 192.168.230.21_nginxlog_type: nginxfrom: 192.168.230.21- type: logenabled: truepaths:- /var/log/httpd/access_log- /var/log/httpd/error_logtags: ["httpd"]fields:service_name: 192.168.230.21_httpdlog_type: httpdfrom: 192.168.230.21- type: logenabled: truepaths:- /usr/local/mysql/data/mysql_general.logtags: ["mysqld"]fields:service_name: 192.168.230.21_mysqldlog_type: mysqldfrom: 192.168.230.21#output.elasticsearch:# Array of hosts to connect to.#hosts: ["localhost:9200"]output.logstash:# The Logstash hostshosts: ["192.168.230.30:5048"]vim nmh_21.confinput {beats { port => "5048"}
}output {if "nginx" in [tags] {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "%{[fields][service_name]}-%{+YYYY.MM.dd}"}}if "httpd" in [tags] {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "%{[fields][service_name]}-%{+YYYY.MM.dd}"}}if "mysqld" in [tags] {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "%{[fields][service_name]}-%{+YYYY.MM.dd}"}}
}#开启日志收集
nohup ./filebeat -e -c filebeat.yml > filebeat.out &#后台运行
logstash -f nmh_21.conf --path.data /opt/test3 &#多了httpd、nginx、mysqld的日志#到kibana可视化界面创建索引模式

在这里插入图片描述

4、收集http日志

#安装httpd
yum -y install httpdcd /etc/logstash
cd conf.d#配置文件
vim http.confinput {file {path => "/etc/httpd/logs/access_log"type => "access"start_position => "beginning"} file {path => "/etc/httpd/logs/error_log"type => "error"start_position => "beginning"}
}output {if [type] == "access" {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "apache_access-%{+YYYY.MM.dd}"} 
}if [type] == "error" {elasticsearch {hosts => ["192.168.230.10:9200","192.168.230.230:9200"]index => "apache_error-%{+YYYY.MM.dd}"}
}#启动logstash
logstash -f http.conf --path.data /opt/test1 &
显示:Successful started Logstash API endpoint {:port=>9601}
API接口:软件内部代码之间通信的接口,代码的连接点
端口是对外提供访问程序的内容接口#到kibana可视化界面创建索引模式
http://www.15wanjia.com/news/163746.html

相关文章:

  • 株洲做网站新手站长做装修网站
  • aspnet网站开发logo注册网站
  • 南昌网站建设优化公司排名网站开发用什么架构
  • 襄阳微信网站建设备案 个人网站名称
  • 网站服务器升级一般多久网站跟系统的区别是
  • 网站开发 技术问题微网站 地图
  • 自微网站襄阳网站推广优化技巧
  • 曼斯特(北京)网站建设公司免费外贸网站模板
  • 上海营销平台网站建设查询网站空间的服务商
  • 网站服务合同模板东莞英文网站设计
  • 松江做网站需要多少钱全自动推广软件
  • 福建网站开发公司电话新品发布会ppt
  • 做电影网站都需要什么工具176网站入口
  • 鼓楼徐州网站开发wordpress小说主题模板
  • 网站开发江西wordpress做门户
  • 宝洁公司网站做的怎么样移动端开发语言
  • 哪些网站用python做服务框架奥林匹克做校服的网站
  • ui设计的网站有哪些WordPress国外打赏
  • 二环建设部网站手机端关键词排名优化
  • 网站建设团队山西省经济建设投资公司网站
  • 关于旅行的网站怎样做网站建设课程的建议
  • 万网怎么建立网站wordpress文章导出
  • 架设个人网站二级域名免费发放
  • 上海网站建设021360甘肃做网站价格
  • 家居公司网站建设方案ppt专做美食的网站
  • 怎么给自己做个网站吗外贸推广服务公司
  • 长春网站制作机构wordpress 大图 主题
  • 中国工程建设招标网官方网站做产品类网站
  • 小公司做网站需要注意什么广州网站建设哪个平台好
  • 官网建站模板库上海网站建设熊掌号