tar -zxvf elasticsearch-6.2.2.tar.gz -C /opt/install
3.启动
#创建新用户es
groupadd es
useradd es -g es
passwd es
#赋予权限
chown -R es:es elasticsearch-6.2.2
#切换到es用户
su es
#启动es
./bin/elasticsearch
#本地连接测试
curl -i "http://localhost:9200"
4.配置es远程连接
vi config/elasticsearch.yml
cluster.name: li-application #集群名称,可以自行修改
node.name: linux-2 #节点名称,自行修改
network.host: 172.16.1.177 #主机地址,这里写本机IP
http.port: 9200 #端口
#修改linux相关参数达到es启动配置要求
vi /etc/security/limits.conf
#*代表全部用户名
* soft nofile 65536
* hard nofile 131072
* soft nproc 65536
* hard nproc 65536
#修改句柄数
vi /etc/sysctl.conf
#在文末添加
vm.max_map_count=262144
注意:配置完成后,需要重新加载相关配置,或者重启才能生效
5.es安装x-park插件
#下载x-park插件安装包
wget https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-6.2.2.zip
#安装 全部输入y
./bin/elasticsearch-plugin install file:/opt/models/x-pack-6.2.2.zip
6.关闭x-park权限认证
vi ./config/elasticsearch.yml
#文末加
xpack.security.enabled: false
- logstash安装
1.下载https://artifacts.elastic.co/downloads/logstash/logstash-6.6.2.tar.gz
2.安装
tar -zxvf logstash-6.6.2.tar.gz -C /opt/install
3.测试
bin/logstash -e 'input { stdin { } } output { stdout {} }'
启动后输入hello word 然后观察日志,看安装是否成功
4.配置测试写入es
input {
file {
#日志文件路径
path => "/suns/log/messages/appr*.log"
type => "tomcat-access-log-ceshi"
start_position => "beginning"
stat_interval => "2"
}
}
output {
elasticsearch {
hosts => ["192.168.19.10:9200"]
index => "app-%{+YYYY.MM.dd}"
}
}
启动logstash看es中是否生成对应的index
./bin/logstash -f ./config/test_syslog.conf
tar -zxvf kibana-6.2.2-linux-x86_64.tar.gz -C /opt/install
3.修改es配置
vi ./config/kibana.yml
server.port: 5601 #端口
server.host: 0.0.0.0 #服务ip
server.name: "knode01" #服务名称
elasticsearch.url: "http://172.30.154.74:9200" #es集群url
elasticsearch.username: "elastic" #kibana用户名
elasticsearch.password: "changeme" #kibana密码
4.启动
./bin/kibana
注意:未安装x-pack插件的kibana只具有基本功能,Monitoring、Graph等功能不能使用。
5.安装x-park插件
在线安装:
./bin/kibana-plugin install x-pack
离线安装:
wget https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-6.2.2.zip
./bin/kibana-plugin install file:///path/to/file/x-pack-6.2.2.zip
6.关闭x-park权限验证
vi ./config/kibana.yml
#文末加
xpack.security.enabled: false