Elasticsearch集羣安裝部署

Elasticsearch版本node

rpm -ivh elasticsearch-6.8.3.rpm

建立文件夾瀏覽器

mkdir /usr/share/elasticsearch/data
mkdir /usr/share/elasticsearch/logs

由於安全問題Elasticsearch不讓用root用戶直接運行,因此要建立新用戶安全

建立用戶命令
adduser es
修改用戶密碼
passwd es
將es解壓目錄的全部者授予此用戶
chown -R es:es *

修改elasticsearch.yml文件服務器

#vi /etc/elasticsearch/elasticsearch.yml
---------------------------------- Cluster -----------------------------------
cluster.name: es_cluster
------------------------------------ Node ------------------------------------
node.name: node_1
#----------------------------------- Paths ------------------------------------
path.data: /usr/share/elasticsearch/data
path.logs: /usr/share/elasticsearch/logs
#----------------------------------- Memory -----------------------------------
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
#--------------------------------- Discovery ----------------------------------
discovery.zen.ping.unicast.hosts: ["10.2.15.183", "10.2.15.169", "10.2.15.186"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 2
#---------------------------------- Various -----------------------------------
node.master: true
node.data: true
http.cors.enabled: true
http.cors.allow-origin: "*"

修改jvm.options文件cors

vi /etc/elasticsearch/jvm.options
-Xms4g
-Xmx4g

修改limits.conf文件jvm

vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096

修改sysctl.conf文件elasticsearch

vi /etc/sysctl.conf
vm.max_map_count=655360

將/elasticsearch 發送給其餘兩個服務器hadoop2, hadoop3tcp

scp -r /usr/local/elasticsearch hadoop2:/usr/local
scp -r /usr/local/elasticsearch hadoop3:/usr/local

切換至es用戶並啓動oop

su es
bin/elasticsearch

用瀏覽器訪問es所在機器的9200端口 http://hadoop1:9200code

相關文章
相關標籤/搜索