[Excerise1: logstash] [Excerise2: elasticsearch] [Excerise3: elasticsearch]
sudo echo "158.108.8.148 artifacts.elastic.co" >> /etc/hosts
yum install java -y
rpm --import http://artifacts.elastic.co:8080/GPG-KEY-elasticsearch
echo '
[elk-6.x]
name=Elastic repository for 6.x packages
baseurl=http://artifacts.elastic.co:8080/packages/6.x/yum
gpgcheck=1
gpgkey=http://artifacts.elastic.co:8080/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
' > /etc/yum.repos.d/elastic.repo
sudo yum install logstash -y
#start logstash serivce with systemd
sudo systemctl start logstash
#check logstash service status
sudo systemctl status logstash
#enable logstash auto start onboot
sudo systemctl enable logstash
sudo yum -y install elasticsearch -y
#start service
sudo systemctl start elasticsearch
#check service status
sudo systemctl status elasticsearch
#enable elasticsearch start on boot
sudo systemctl enable elasticsearch
curl 127.0.0.1:9200
yum install kibana -y
# start kibana
sudo systemctl start kibana
# check kibana service status
sudo systemctl status kibana
# enable kibana start onboot
sudo systemctl enable kibana
curl 127.0.0.1:5601
yum install -y epel-release
yum install -y nginx
Open file “/etc/nginx/nginx.conf” and add reverse proxy config to session http { server { location / { [config] }}}
vim /etc/nginx/nginx.conf
Copy this configuration place in file nginx.conf
location / {
proxy_pass http://localhost:5601/;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
auth_basic "Username and Password Required";
auth_basic_user_file /etc/nginx/.htpasswd;
}
sudo yum install -y httpd-tools
htpasswd -c /etc/nginx/.htpasswd admin
# start nginx service
sudo systemctl start nginx
# check nginx service status
sudo systemctl status nginx
# enable nginx start onboot
sudo systemctl enable nginx
firewall-cmd --add-port 80/tcp --zone=public --permanent
firewall-cmd --reload