2021-04-15

1 环境准备:
A:配置主机名hostname node1
vim /etc/hosts
192.168.100.110 node1
192.168.100.111 node2
在这里插入图片描述

1 环境准备:
A:配置主机名hostname node1
vim /etc/hosts
192.168.100.110 node1
192.168.100.111 node2

systemctl stop firewalld.service
setenforce 0
在这里插入图片描述

scp /etc/hosts root@192.168.100.111:/etc/
在这里插入图片描述

B配置主机名hostname node2
vim /etc/hosts
bash
systemctl stop firewalld.service
setenforce 0

2 安装Elasticsearch
A:rpm -ivh elasticsearch-5.5.0.rpm
systemctl start elasticsearch.service
systemctl enable elasticsearch.service
systemctl daemon-reload

3 修改配置文件
A :vim /etc/elasticsearch/elasticsearch.yml
set nu
17myELK
23node1
33 /data/elk_data
37/var/log/elasticsearch/
43 false
55 192.168.100.110
59 9200
68 [node1/node2]

A :mkdir -p /data/elk_data
chown elasticsearch:elasticsearch /data/elk_data
systemctl restart elasticsearch.service
netstat -naptu |grep 9200

4 安装Elasticsearch-head 插件
A : ll
tar xf node-v8.2.2
cd node-v8.2.1/
./configure && make && make install
B:tar xf node-v8.2.1.tar.gz
cd node-v8.2.1/
./configure && make && make install

B phantomjs
tar xf phantomjs-2.1.1-linux-x86_64.tar.bz2
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/
在这里插入图片描述

C 安装 elasticsearch-head.tar.gz

tar xf elasticsearch-head.tar.gz
cd elasticsearch-head/
npm install

D修改配置文件
vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: “*”
在这里插入图片描述

重启服务
systemctl restart elasticsearch.service
npm run start &
netstat -naptu |grep 9200
netstat -naptu |grep 9100
访问192.168.100.110:9100
在这里插入图片描述

B vim /etc/elasticsearch/elasticsearch.yml
systemctl restart elasticsearch.service
在这里插入图片描述

netstat -naptu |grep 9200

在这里插入图片描述
在这里插入图片描述

5 安装logstash

B rpm -ivh logstash-5.5.1.rpm
mount /dev/cdrom /media/cdrom
yum list
yum -y install httpd
history
systemctl start logstash.service
ln -s /usr/share/logstash/bin/logstash /usr/local/bin/
echo ‘

hqhqhq

’ > /var/www/html/index.html
systemctl start httpd

5 配置logstash文件
C cd /etc/logstash/conf.d/
touch apache_log.conf
vim apache_log.conf

input {
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.100.110:9200”]
index => “apache_access-%{+YYYY.MM.dd}”
}
}
if [type] == “error” {
elasticsearch {
hosts => [“192.168.100.110:9200”]
index => “apache_error-%{+YYYY.MM.dd}”
}
}
}

/usr/share/logstash/bin/logstash -f apache_log.conf

systemctl restart logstash.service

6 安装kibana
A
rpm ivh kibana-5.5.5-x86.rpm
vim /etc/kibana/kibana.yml
2 5601
7 “0.0.0.0”
21 192.168.100.110
30 kibana

systemctl restart kibana.service

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

systemctl stop firewalld.service
setenforce 0

scp /etc/hosts root@192.168.100.111:/etc/

B配置主机名hostname node2
vim /etc/hosts
bash
systemctl stop firewalld.service
setenforce 0

2 安装Elasticsearch
A:rpm -ivh elasticsearch-5.5.0.rpm
systemctl start elasticsearch.service
systemctl enable elasticsearch.service
systemctl daemon-reload

3 修改配置文件
A :vim /etc/elasticsearch/elasticsearch.yml
set nu
17myELK
23node1
33 /data/elk_data
37/var/log/elasticsearch/
43 false
55 192.168.100.110
59 9200
68 [node1/node2]

A :mkdir -p /data/elk_data
chown elasticsearch:elasticsearch /data/elk_data
systemctl restart elasticsearch.service
netstat -naptu |grep 9200

4 安装Elasticsearch-head 插件
A : ll
tar xf node-v8.2.2
cd node-v8.2.1/
./configure && make && make install
B:tar xf node-v8.2.1.tar.gz
cd node-v8.2.1/
./configure && make && make install

B phantomjs
tar xf phantomjs-2.1.1-linux-x86_64.tar.bz2
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/

C 安装 elasticsearch-head.tar.gz

tar xf elasticsearch-head.tar.gz
cd elasticsearch-head/
npm install

D修改配置文件
vim /etc/elasticsearch/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: “*”

重启服务
systemctl restart elasticsearch.service
npm run start &
netstat -naptu |grep 9200
netstat -naptu |grep 9100
访问192.168.100.110:9100

B vim /etc/elasticsearch/elasticsearch.yml
systemctl restart elasticsearch.service

netstat -naptu |grep 9200

5 安装logstash

B rpm -ivh logstash-5.5.1.rpm
mount /dev/cdrom /media/cdrom
yum list
yum -y install httpd
history
systemctl start logstash.service
ln -s /usr/share/logstash/bin/logstash /usr/local/bin/
echo ‘

hqhqhq

’ > /var/www/html/index.html
systemctl start httpd

5 配置logstash文件
C cd /etc/logstash/conf.d/
touch apache_log.conf
vim apache_log.conf

input {
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.100.110:9200”]
index => “apache_access-%{+YYYY.MM.dd}”
}
}
if [type] == “error” {
elasticsearch {
hosts => [“192.168.100.110:9200”]
index => “apache_error-%{+YYYY.MM.dd}”
}
}
}

/usr/share/logstash/bin/logstash -f apache_log.conf

systemctl restart logstash.service

6 安装kibana
A
rpm ivh kibana-5.5.5-x86.rpm
vim /etc/kibana/kibana.yml
2 5601
7 “0.0.0.0”
21 192.168.100.110
30 kibana

systemctl restart kibana.service

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值