美文网首页
ElasticSearch-集群搭建

ElasticSearch-集群搭建

作者: ssttIsme | 来源:发表于2021-07-22 22:14 被阅读0次

https://www.elastic.co/cn/downloads/past-releases/elasticsearch-7-8-0

[server@hadoop102 ~]$ cd /opt/software/
[server@hadoop102 software]$ ll
总用量 282008
-rw-rw-r--. 1 server server 288775500 7月  18 11:52 elasticsearch-7.4.2-linux-x86_64.tar.gz
[server@hadoop102 software]$ tar -zxvf elasticsearch-7.4.2-linux-x86_64.tar.gz 

[server@hadoop102 elasticsearch-7.4.2]$ vim bin/elasticsearch-env 
#!/bin/bash

JAVA_HOME="/opt/software/elasticsearch-7.4.2/jdk"

[server@hadoop102 elasticsearch-7.4.2]$ vim config/jvm.options 
## GC configuration
#-XX:+UseConcMarkSweepGC
-XX:+UseG1GC

[server@hadoop102 elasticsearch-7.4.2]$ vim config/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
 cluster.name: es-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
 node.name: es-cluster01
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
 network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
 http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
 discovery.seed_hosts: ["hadoop102", "hadoop103","hadoop104"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
 cluster.initial_master_nodes: ["es-cluster01", "es-cluster02","es-cluster03"]
 client.transport.ping_timeout: 60s
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

 http.cors.enabled: true
 http.cors.allow-origin: "*"

[server@hadoop102 elasticsearch-7.4.2]$ sudo vim /etc/profile
export ES_HOME=/opt/software/elasticsearch-7.4.2
export PATH=$ES_HOME/bin:$PATH
[server@hadoop102 elasticsearch-7.4.2]$ su root
密码:
[root@hadoop102 elasticsearch-7.4.2]# source /etc/profile
[root@hadoop102 elasticsearch-7.4.2]# vim /etc/security/limits.conf
*        soft    nofile          65535
*        hard    nofile          65535
*        soft    nproc           4096
*        hard    nproc           4096
[root@hadoop102 elasticsearch-7.4.2]# vim /etc/sysctl.conf 
vm.max_map_count = 262144
[root@hadoop102 elasticsearch-7.4.2]# sysctl -p

[root@hadoop102 elasticsearch-7.4.2]# scp -r /opt/software/elasticsearch-7.4.2 root@hadoop103:/opt/software/
[root@hadoop102 elasticsearch-7.4.2]# scp -r /opt/software/elasticsearch-7.4.2 root@hadoop104:/opt/software/

[root@hadoop102 elasticsearch-7.4.2]# scp -r /etc/profile root@hadoop103:/etc/profile
[root@hadoop102 elasticsearch-7.4.2]# scp -r /etc/profile root@hadoop104:/etc/profile

[root@hadoop102 elasticsearch-7.4.2]# source /etc/profile
[server@hadoop103 elasticsearch-7.4.2]$ su root
密码:
[root@hadoop103 elasticsearch-7.4.2]# source /etc/profile
[server@hadoop104 ~]$ su root
密码:
[root@hadoop104 server]# source /etc/profile
[root@hadoop102 elasticsearch-7.4.2]# scp /etc/security/limits.conf root@hadoop103:/etc/security/limits.conf
root@hadoop103's password: 
limits.conf 
[root@hadoop102 elasticsearch-7.4.2]# scp /etc/security/limits.conf root@hadoop104:/etc/security/limits.conf
root@hadoop104's password: 
limits.conf  
[root@hadoop102 elasticsearch-7.4.2]# scp /etc/sysctl.conf root@hadoop103:/etc/sysctl.conf
root@hadoop103's password: 
sysctl.conf                                                                                    100%  477   223.8KB/s   00:00    
[root@hadoop102 elasticsearch-7.4.2]# scp /etc/sysctl.conf root@hadoop104:/etc/sysctl.conf
root@hadoop104's password: 
sysctl.conf  
[root@hadoop102 elasticsearch-7.4.2]# sysctl -p
[root@hadoop103 elasticsearch-7.4.2]# sysctl -p
vm.max_map_count = 262144
[root@hadoop104 server]# sysctl -p
vm.max_map_count = 262144
[root@hadoop103 elasticsearch-7.4.2]# pwd
/opt/software/elasticsearch-7.4.2
[root@hadoop103 elasticsearch-7.4.2]# vim config/elasticsearch.yml 
[root@hadoop104 elasticsearch-7.4.2]# pwd
/opt/software/elasticsearch-7.4.2
[root@hadoop104 elasticsearch-7.4.2]# vim config/elasticsearch.yml 

[root@hadoop102 server]# chown -Rf server:server /opt/software/elasticsearch-7.4.2
[root@hadoop103 elasticsearch-7.4.2]# chown -Rf server:server /opt/software/elasticsearch-7.4.2
[root@hadoop104 elasticsearch-7.4.2]# chown -Rf server:server /opt/software/elasticsearch-7.4.2

[server@hadoop102 elasticsearch-7.4.2]$ elasticsearch
[server@hadoop103 elasticsearch-7.4.2]$ elasticsearch
[server@hadoop104 elasticsearch-7.4.2]$ elasticsearch



相关文章

网友评论

      本文标题:ElasticSearch-集群搭建

      本文链接:https://www.haomeiwen.com/subject/cmrapltx.html