http://mubanjiu.com/2016/05/05/Docker-K8S/
export MAVEN_HOME=/usr/local/maven
export PATH=.:$MAVEN_HOME/bin:$PATH
export ANT_HOME=/usr/local/ant
export PATH=.:$ANT_HOME/bin:$PATH
export JAVA_HOME=/usr/local/java/jdk1.8.0_65
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
ulimit -SHn 65535
centos7 关闭防火墙
/bin/bash
yum install net-tools -y
yum install firewalld -y
systemctl stop firewalld.service
systemctl disable firewalld.service
firewallstate=firewall-cmd --state
echo '$firewallstate' >>./fire.log
systemctl stop firewalld
systemctl mask firewalld
下载iptables包
yum install iptables-services -y
systemctl enable iptables
systemctl [stop|start|restart] iptables
systemctl restart iptables
service iptables save
/usr/libexec/iptables/iptables.init save
systemctl enable iptables
logshtash
收集tomcat日志:
更多ELK资料请访问 http://devops.taobao.com
input {
file {
type => 'tomcat'
path => "/usr/local/tomcat/logs/*"
start_position => "end"
}
}
filter {
if [type] == "tomcat" {
multiline {
patterns_dir => "/app/config/patterns"
pattern => "(%{TOMCAT_DATESTAMP})|(%{CATALINA_DATESTAMP})"
negate => true
what => "previous"
}
if "_grokparsefailure" in [tags] {
drop { }
}
grok {
patterns_dir => "/app/config/patterns"
match => [ "message", "%{TOMCATLOG}", "message", "%{CATALINALOG}" ]
}
date {
match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS Z", "MMM dd, yyyy HH:mm:ss a" ]
}
}
}
output {
elasticsearch_http {
host => "localhost"
}
}
github地址:https://github.com/sdd330/tomcat-elk
过滤nginx日志:
更多ELK资料请访问 http://devops.taobao.com
input {
file {
path => "/var/log/nginx/access"
}
}
filter {
mutate { replace => { "type" => "nginx_access" } }
grok {
patterns_dir => "/etc/logstash/patterns/"
match => { "message" => "%{NGINXACCESS}" }
}
date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
}
geoip {
source => "clientip"
}
}
output {
elasticsearch {
host => "localhost"
protocol => "http"
}
stdout { codec => rubydebug }
}
github地址:https://github.com/nbigot/openresty_nginx_logstash_kibana_elasticsearch_centos6
https://www.elastic.co/guide/en/logstash/current/config-examples.html
https://www.elastic.co/guide/en/logstash/current/config-examples.html#using-conditionals
filter https://www.elastic.co/guide/en/logstash/current/filter-plugins.html
input模块 https://www.elastic.co/guide/en/logstash/current/input-plugins.html
output模块 https://www.elastic.co/guide/en/logstash/current/output-plugins.html
中文文档 https://es.xiaoleilu.com/010_Intro/30_Tutorial_Search.html
基础语言配置http://www.bubuko.com/infodetail-524080.html
logstash操作使用 http://www.cnblogs.com/valor-xh/p/6292701.html
http://blog.163.com/liyangbbs@126/blog/static/1880097020119134457678/