首先确保安装了JDK1.8及以上版本
[root@VM_234_23_centos ~]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
下载安装 Elasticsearch
linux: 从Elasticsearch官方地址下载(也可以下载完,通过ftp之类的工具传上去),gz文件的话通过tar进行解压缩,然后进入bin目录下运行软件
[root@VM_234_23_centos app]# curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz
[root@VM_234_23_centos app]# tar -zxvf elasticsearch-6.2.4.tar.gz
[root@VM_234_23_centos app]# cd elasticsearch-6.2.4
[root@VM_234_23_centos elasticsearch-6.2.4]# ./bin/elasticsearch
修改配置文件:
vi elasticsearch-6.2.4/config/elasticsearch.yml
network.host: 0.0.0.0
http.port: 9200
vim elasticsearch-6.2.4/config/jvm.options,将-Xms1g -Xmx1g修改为
-Xms512m
-Xmx512m
后台启动 ./bin/elasticsearch -d
注意:Elasticsearch不用以root用户启动
下载安装 Logstash
[root@VM_234_23_centos app]# curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-6.3.2.tar.gz
[root@VM_234_23_centos app]# tar -zxvf logstash-6.3.2.tar.gz
修改配置文件:
vi logstash-6.3.2/conf/logstash.yml
http.host: "0.0.0.0"
vim logstash-6.3.2/config/jvm.options,将-Xms1g -Xmx1g修改为
-Xms512m
-Xmx512m
vim /etc/logstash.conf
启动:
bin/logstash -f /etc/logstash.conf -d
或者下面命令
nohup bin/logstash -f /etc/logstash.conf --path.data=/home/logstash-6.3.2/data/ &
下载安装 Kibana
curl -L -O https://artifacts.elastic.co/downloads/kibana/kibana-6.3.2-linux-x86_64.tar.gz
修改 kibana-6.3.2-linux-x86_64/config/kibana.yml 配置文件,设置 elasticsearch.url 指向 Elasticsearch 实例。
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.url: "http://localhost:9200"
网友评论