elasticsearch5.3linux 클러스터

jdk8 이상 wget을 설치해야 합니다https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.zip
mkdir ela1
mkdir ela2
cp elasticsearch-5.3.0.zip  ela1
cp elasticsearch-5.3.0.zip  ela2
unzip elasticsearch-5.3.0.zip
vi/data1/elasticsearch/ela2/elasticsearch-5.3.0/config/elasticsearch.yml
보안 문제 때문에elasticsearch는 루트 사용자를 직접 실행하지 못하게 하기 때문에 새 사용자를 만듭니다.
첫 번째 단계: liunx에서 새 사용자adduser XXX를 만들고 만든 사용자에게 비밀번호를 추가합니다. passwd XXX에 비밀번호를 두 번 입력하십시오.
2단계: 방금 만든 사용자 su XXX를 전환하고 elasticsearch를 실행하면 Permission denied 권한이 부족합니다.
3단계: 새로 만든 XXX에 권한을 부여합니다.chmod 777*이것은 안 됩니다. 이 사용자 자체가 권한이 없기 때문에 자신에게 권한을 지불할 수 없습니다.그래서 루트 사용자 로그인으로 권한을 지불해야 합니다.
4단계: 루트는 XXX에 권한을 부여합니다. chown-R XXX/당신의elasticsearch 설치 디렉터리.
그리고 실행에 성공했습니다.
sudo chown -R noroot:noroot elasticsearch
/data1/elasticsearch/ela1/elasticsearch-5.3.0/bin/elasticsearch -d
/data1/elasticsearch/ela2/elasticsearch-5.3.0/bin/elasticsearch -d
노드 1 구성
# ======================== 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
node.master: true
discovery.zen.ping_timeout: 30s
#discovery.zen.ping.multicast.enabled: true
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# 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/data1
#
# Path to log files:
#
path.logs: /path/to/logs1
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.system_call_filter: false
bootstrap.memory_lock: false
#
# 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.7.204
#
# Set a custom port for HTTP:
#
http.port: 9201
transport.tcp.port: 9301
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.7.204:9302"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery 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

노드 2 구성
# ======================== 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
node.master: true
discovery.zen.ping_timeout: 30s
#discovery.zen.ping.multicast.enabled: true
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-2
#
# 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/data2
#
# Path to log files:
#
path.logs: /path/to/logs2
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
bootstrap.system_call_filter: false
#
# 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.7.204
transport.tcp.port: 9302
#
# Set a custom port for HTTP:
#
http.port: 9202
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.7.204:9301"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery 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

좋은 웹페이지 즐겨찾기