创建用户组 groupadd elsearch
创建用户 useradd elsearch -g elsearch -p 123456
用户切换: su elsearch
启动 sh xxx/elsearch目录/bin/ &
elasticsearch启动常见错误 https://www.jianshu.com/p/365db8b181cc
修改系统配置文件
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
配置生效:重新连接
vi /etc/sysctl.conf
vm.max_map_count = 655360
配置生效:执行 sysctl -p
elasticsearch.yml
最后增加
network.host: 0.0.0.0
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
取消注释保留一个节点
cluster.initial_master_nodes: ["node-1"]
最后可以启动后
CentOS7查看和关闭防火墙 https://blog.youkuaiyun.com/ytangdigl/article/details/79796961
查看防火墙状态
firewall-cmd --state
停止firewall
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
启动: ./kibana --allow-root &
kibana-6.4.2-linux-x86_64/config/ kibana.yml
添加
server.host: 0.0.0.0
启动: ./logstash -f ../config/logstash.conf &
添加配置文件 logstash.conf
input {
file {
type => "log"
path => "/logs/*.log"
start_position => "beginning"
}
}
output {
stdout {
codec => rubydebug { }
}
elasticsearch {
hosts => "127.0.0.1"
index => "log-%{+YYYY.MM.dd}"
}
}
删除索引熟悉 _index
curl -XDELETE "http://127.0.0.1:9200/索引名称"
kibana设置
系统时间 YYYY-MM-D HH:mm:ss.SSS