1. prereqs
2. elasticsearch
yum -y install https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.1.rpm
cube /etc/elasticsearch/elasticsearch.yml '#bootstrap.memory_lock' with 'bootstrap.memory_lock'
cube /etc/elasticsearch/elasticsearch.yml '#network.host: 192.168.0.1' with '#network.host: localhost'
cube /etc/elasticsearch/elasticsearch.yml '#http.port: 9200' with 'http.port: 9200'
cube /usr/lib/systemd/system/elasticsearch.service '#LimitMEMLOCK=infinity' with 'LimitMEMLOCK=infinity'
cfgfile="/usr/lib/systemd/system/elasticsearch.service"
prvline="LimitNPROC=4096"
newline="LimitMEMLOCK=infinity"
grep -iq "${newline}" ${cfgfile} || sed -i "s/${prvline}/${prvline}\n${newline}/" ${cfgfile}
cube /etc/sysconfig/elasticsearch '#MAX_LOCKED_MEMORY=unlimited' with 'MAX_LOCKED_MEMORY=unlimited'
systemctl daemon-reload
systemctl enable elasticsearch
systemctl start elasticsearch
3. kibana
yum -y install https://artifacts.elastic.co/downloads/kibana/kibana-6.5.1-x86_64.rpm
cube /etc/kibana/kibana.yml '#server.port: 5601' with 'server.port: 5601'
cube /etc/kibana/kibana.yml '#server.host: "localhost"' with 'server.host: "localhost"'
cube /etc/kibana/kibana.yml '#elasticsearch.url: "http://localhost:9200"' with 'elasticsearch.url: "http://localhost:9200"'
systemctl enable kibana
systemctl start kibana
4. ngnix
yum -y install nginx httpd-tools
vi /etc/nginx/conf.d/d01.net.conf
#
server {
listen 80;
srv121 d01.net;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.kibana;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
htpasswd -c /etc/nginx/htpasswd.kibana admin
systemctl enable nginx
systemctl start nginx
5. logstash
yum -y install https://artifacts.elastic.co/downloads/logstash/logstash-6.5.1.rpm
systemctl restart logstash
systemctl enable logstash