ELK简单安装
一、下载jdk(jdk1.8以上)
yum install -y java
或者编译安装
检查jdk安装情况
[root@master~]#java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
二、rpm安装ElasticSearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.rpm rpm -ivh elasticsearch-6.2.3.rpm
三、修改配置
vim /etc/elasticsearch/elasticsearch.yml cluster.name: my-application #ES集群名称 node.name: node-1 #节点名称 path.data: /path/to/data #数据存储的目录(多个目录使用逗号分隔) path.logs: /path/to/logs #日志格式 bootstrap.memory_lock: true #锁住es内存,保证内存不分配至交换分区 network.host: 127.0.0.1 #设置本机IP地址
http.port: 9200 #端口默认9200 #discovery.zen.ping.unicast.hosts: ["10.0.0.141"] #集群
创建目录并授权
mkdir /path/to/ -p
chown -R elasticsearch.elasticsearch /path
启动elasticsearch服务
systemctl start elasticsearch.servicee
四、rpm安装Logstash
rpm -ivh https://artifacts.elastic.co/downloads/logstash/logstash-6.2.3.rpm
五、rpm安装Kibana
wget https://artifacts.elastic.co/downloads/kibana/kibana-6.2.3-x86_64.rpm rpm -ivh kibana-6.2.3-x86_64.rpm
修改配置文件
grep "^[a-Z]" /etc/kibana/kibana.yml server.port: 5601 #端口,默认5601 server.host: "10.0.0.14" #主机 elasticsearch.url: "http://localhost:9200" #es地址 kibana.index: ".kibana" #kibana是一个小系统,自己也需要存储数据(将kibana的数据保存到.kibana的索引中,会在ES里面创建一个.kibana) # elasticsearch.username: "user" kibana中的es插件是需要收费的,所以无法使用 # elasticsearch.password: "pass"
启动
systemctl start kibana.service
查看端口
[root@master~]#ss -luntp|grep 5601
tcp LISTEN 0 128 *:5601 *:* users:(("node",pid=2115,fd=11))
浏览器访问
localhost:5601