elasticsearch5.3linux 클러스터
7121 단어 전체 텍스트 검색
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
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
algolia: angular-instantsearch v2에서 v3로 업그레이드V2 문제 v3로 하면 사용할 수 있는 옵션이 늘어나므로 꼭 업그레이드하고 싶다. 예를 들어 현재는 스마트 폰에 대응할 수 없습니다. 실시간 검색이므로 문자 입력하면 순식간에 결과가 돌아오지만, 스마트 폰이라면 이런...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.