Intro How To Install Elastic Stack
這篇介紹How To Install Elastic Stack.
Add User ELK
1
| $ sudo adduser -U -p somepasswords elk
|
Install Zulu JDK
1 2 3 4
| $ cd /usr/local $ wget https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-jdk8.0.332-linux_x64.tar.gz $ tar zxvf zulu8.62.0.19-ca-jdk8.0.332-linux_x64.tar.gz $ ln -sfn zulu8.62.0.19-ca-jdk8.0.332-linux_x64 java
|
Install ElasticSearch 7.3.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| $ mkdir /home/elk/binary-7.3.2 $ mkdir /var/data/elasticsearch-7.3.2 $ cd /home/elk/binary-7.3.2 $ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.2-linux-x86_64.tar.gz $ tar zxvf elasticsearch-7.3.2-linux-x86_64.tar.gz
/* add env variable */ $ vi /etc/sysctl.conf [ vm.max_map_count=655360 ] $ sysctl -p
/* check nofile more than 65535 */ $ vi /etc/security/limits.conf [ elk soft nofile 65536 elk hard nofile 65536 ]
/* change folder previlige */ $ chown -R elk:elk /home/elk/binary-7.3.2 $ chown -R elk:elk /var/data/elasticsearch-7.3.2
|
Modify config/elasticsearch.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| cluster.name: nv-es
node.name: node1
path.data: /var/data/elasticsearch-7.3.2
network.host: 0.0.0.0
network.publish_host: 192.168.x.x
http.port: 9200
transport.tcp.port: 9300
discovery.seed_hosts: ["someIP:9300"]
cluster.initial_master_nodes: ["someIP"]
xpack.security.enabled: true xpack.security.transport.ssl.enabled: true
xpack.monitoring.collection.enabled: true
|
Modify config/jvm.options
Startup ElasticSearch in daemon mode
1 2
| $ cd /home/elk/binary-7.3.2/elasticsearch-7.3.2 $ ./bin/elasticsearch -d
|
Setup buildin user password
1
| $ ./bin/elasticsearch-setup-passwords interactive
|
Kibana installation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Download kibana $ cd /home/elk/binary-7.3.2 $ wget https://artifacts.elastic.co/downloads/kibana/kibana-7.3.2-linux-x86_64.tar.gz $ tar zxvf kibana-7.3.2-linux-x86_64.tar.gz
Modify config/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://127.0.0.1:9200"] elasticsearch.username: "kibana" elasticsearch.password: "somepasswords"
logging.dest: logs/kibana.log
Startup kibana in daemon mode $ ./bin/kibana &
|