3. ElasticSearch6 클러스터 설치
13587 단어 ElasticSearch6배우다
1. ElasticSearch 중지
[payment@gameServer elasticsearch-6.2.4]$ jps
29963 Jps
29196 Elasticsearch
[payment@gameServer elasticsearch-6.2.4]$ kill -9 29196
[payment@gameServer elasticsearch-6.2.4]$
[payment@gameServer elasticsearch-6.2.4]$ jps
29978 Jps
2. 데이터 지우기
주: 잘 모르면 집단이 만들어지면 틀릴 수 있어요.
[payment@gameServer elasticsearch-6.2.4]$ pwd
/home/payment/elasticSearch/elasticsearch-6.2.4
[payment@gameServer elasticsearch-6.2.4]$ ll
240
drwxr-xr-x. 2 payment payment 4096 6 5 21:16 bin
drwxr-xr-x. 3 payment payment 4096 6 6 13:08 config
drwxrwxr-x. 2 payment payment 4096 6 6 14:12 data
drwxr-xr-x. 2 payment payment 4096 4 13 04:39 lib
-rw-r--r--. 1 payment payment 11358 4 13 04:33 LICENSE.txt
drwxr-xr-x. 2 payment payment 4096 6 6 10:21 logs
drwxr-xr-x. 16 payment payment 4096 4 13 04:39 modules
-rw-r--r--. 1 payment payment 191887 4 13 04:38 NOTICE.txt
drwxr-xr-x. 3 payment payment 4096 6 6 13:08 plugins
-rw-r--r--. 1 payment payment 9268 4 13 04:33 README.textile
[payment@gameServer elasticsearch-6.2.4]$ rm -rf data/* logs/*
3. ElasticSearch 복사
[payment@gameServer elasticsearch-6.2.4]$ cd ..
[payment@gameServer elasticSearch]$ ll
28380
drwxr-xr-x. 9 payment payment 4096 6 6 10:21 elasticsearch-6.2.4
-rw-rw-r--. 1 payment payment 29056810 5 15 12:56 elasticsearch-6.2.4.tar.gz
[payment@gameServer elasticSearch]$
[payment@gameServer elasticSearch]$ cp -r elasticsearch-6.2.4 elasticsearch-6.2.4-2
[payment@gameServer elasticSearch]$ cp -r elasticsearch-6.2.4 elasticsearch-6.2.4-3
[payment@gameServer elasticSearch]$ mv elasticsearch-6.2.4 elasticsearch-6.2.4-1
[payment@gameServer elasticSearch]$ ll
28388
drwxr-xr-x. 9 payment payment 4096 6 6 10:21 elasticsearch-6.2.4-1
drwxr-xr-x. 9 payment payment 4096 6 6 14:13 elasticsearch-6.2.4-2
drwxr-xr-x. 9 payment payment 4096 6 6 14:13 elasticsearch-6.2.4-3
4. 프로필 수정
3개의 노드에 대한 구성 파일 수정
[payment@gameServer ~]$ grep '^[a-z]' elasticSearch/elasticsearch-6.2.4-1/config/elasticsearch.yml
cluster.name: dev_elastic_cluster
node.name: node-1
node.master: true
node.data: true
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 172.17.63.15
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["172.17.63.15:9300", "172.17.63.15:9301", "172.17.63.15:9302"]
[payment@gameServer ~]$ grep '^[a-z]' elasticSearch/elasticsearch-6.2.4-2/config/elasticsearch.yml
cluster.name: dev_elastic_cluster
node.name: node-2
node.master: true
node.data: true
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 172.17.63.15
http.port: 9201
transport.tcp.port: 9301
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["172.17.63.15:9300", "172.17.63.15:9301", "172.17.63.15:9302"]
[payment@gameServer ~]$ grep '^[a-z]' elasticSearch/elasticsearch-6.2.4-3/config/elasticsearch.yml
cluster.name: dev_elastic_cluster
node.name: node-3
node.master: true
node.data: true
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 172.17.63.15
http.port: 9202
transport.tcp.port: 9302
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["172.17.63.15:9300", "172.17.63.15:9301", "172.17.63.15:9302"]
5. 클러스터 시작
1. 세 노드 시작
/home/payment/elasticSearch/elasticsearch-6.2.4-1/bin/elasticsearch -d
/home/payment/elasticSearch/elasticsearch-6.2.4-2/bin/elasticsearch -d
/home/payment/elasticSearch/elasticsearch-6.2.4-3/bin/elasticsearch -d
2. 감청 로그:
elasticSearch 설치 디렉터리에 있는logs 폴더에 있는 로그 파일 감청 (그룹 이름.log)
[payment@gameServer logs]$ tail -f ~/elasticSearch/elasticsearch-6.2.4-1/logs/dev_elastic_cluster.log
[2018-06-06T14:23:58,818][INFO ][o.e.n.Node ] [node-1] initializing ...
[2018-06-06T14:23:58,986][INFO ][o.e.e.NodeEnvironment ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [402.7gb], net total_space [442.7gb], types [rootfs]
[2018-06-06T14:23:58,986][INFO ][o.e.e.NodeEnvironment ] [node-1] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-06-06T14:23:58,987][INFO ][o.e.n.Node ] [node-1] node name [node-1], node ID [QCOxIqY7Tua3gFpNeUiupA]
[2018-06-06T14:23:58,988][INFO ][o.e.n.Node ] [node-1] version[6.2.4], pid[30202], build[ccec39f/2018-04-12T20:37:28.497551Z], OS[Linux/2.6.32-696.28.1.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_161/25.161-b12]
[2018-06-06T14:23:58,988][INFO ][o.e.n.Node ] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.RExwmCgI, -XX:+HeapDumpOnOutOfMemoryError, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/home/payment/elasticSearch/elasticsearch-6.2.4-1, -Des.path.conf=/home/payment/elasticSearch/elasticsearch-6.2.4-1/config]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [aggs-matrix-stats]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [analysis-common]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [ingest-common]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-expression]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-mustache]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [lang-painless]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [mapper-extras]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [parent-join]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [percolator]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [rank-eval]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [reindex]
[2018-06-06T14:23:59,596][INFO ][o.e.p.PluginsService ] [node-1] loaded module [repository-url]
[2018-06-06T14:23:59,597][INFO ][o.e.p.PluginsService ] [node-1] loaded module [transport-netty4]
[2018-06-06T14:23:59,597][INFO ][o.e.p.PluginsService ] [node-1] loaded module [tribe]
[2018-06-06T14:23:59,597][INFO ][o.e.p.PluginsService ] [node-1] loaded plugin [analysis-ik]
[2018-06-06T14:24:02,376][INFO ][o.e.d.DiscoveryModule ] [node-1] using discovery type [zen]
[2018-06-06T14:24:02,907][INFO ][o.e.n.Node ] [node-1] initialized
[2018-06-06T14:24:02,907][INFO ][o.e.n.Node ] [node-1] starting ...
[2018-06-06T14:24:03,150][INFO ][o.e.t.TransportService ] [node-1] publish_address {172.17.63.15:9300}, bound_addresses {172.17.63.15:9300}
[2018-06-06T14:24:03,158][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2018-06-06T14:24:06,235][INFO ][o.e.c.s.MasterService ] [node-1] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {node-1}{QCOxIqY7Tua3gFpNeUiupA}{XNjZ-E_tQ--mPyFZi9E2eA}{172.17.63.15}{172.17.63.15:9300}
[2018-06-06T14:24:06,240][INFO ][o.e.c.s.ClusterApplierService] [node-1] new_master {node-1}{QCOxIqY7Tua3gFpNeUiupA}{XNjZ-E_tQ--mPyFZi9E2eA}{172.17.63.15}{172.17.63.15:9300}, reason: apply cluster state (from master [master {node-1}{QCOxIqY7Tua3gFpNeUiupA}{XNjZ-E_tQ--mPyFZi9E2eA}{172.17.63.15}{172.17.63.15:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2018-06-06T14:24:06,273][INFO ][o.e.h.n.Netty4HttpServerTransport] [node-1] publish_address {172.17.63.15:9200}, bound_addresses {172.17.63.15:9200}
[2018-06-06T14:24:06,273][INFO ][o.e.n.Node ] [node-1] started
[2018-06-06T14:24:06,395][INFO ][o.e.g.GatewayService ] [node-1] recovered [0] indices into cluster_state
[2018-06-06T14:24:11,182][INFO ][o.e.c.s.MasterService ] [node-1] zen-disco-node-join[{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301}], reason: added {{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301},}
[2018-06-06T14:24:11,381][INFO ][o.e.c.s.ClusterApplierService] [node-1] added {{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301},}, reason: apply cluster state (from master [master {node-1}{QCOxIqY7Tua3gFpNeUiupA}{XNjZ-E_tQ--mPyFZi9E2eA}{172.17.63.15}{172.17.63.15:9300} committed version [3] source [zen-disco-node-join[{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301}]]])
[2018-06-06T14:24:11,385][WARN ][o.e.d.z.ElectMasterService] [node-1] value for setting "discovery.zen.minimum_master_nodes" is too low. This can result in data loss! Please set it to at least a quorum of master-eligible nodes (current value: [-1], total number of master-eligible nodes used for publishing in this round: [2])
[2018-06-06T14:24:14,698][INFO ][o.e.c.s.MasterService ] [node-1] zen-disco-node-join[{node-3}{WdB0vdTWTK2Xb_-Ixl6R0Q}{JXU3ZRdWTdSaVN_LDgmj_w}{172.17.63.15}{172.17.63.15:9302}], reason: added {{node-3}{WdB0vdTWTK2Xb_-Ixl6R0Q}{JXU3ZRdWTdSaVN_LDgmj_w}{172.17.63.15}{172.17.63.15:9302},}
[2018-06-06T14:24:14,904][INFO ][o.e.c.s.ClusterApplierService] [node-1] added {{node-3}{WdB0vdTWTK2Xb_-Ixl6R0Q}{JXU3ZRdWTdSaVN_LDgmj_w}{172.17.63.15}{172.17.63.15:9302},}, reason: apply cluster state (from master [master {node-1}{QCOxIqY7Tua3gFpNeUiupA}{XNjZ-E_tQ--mPyFZi9E2eA}{172.17.63.15}{172.17.63.15:9300} committed version [4] source [zen-disco-node-join[{node-3}{WdB0vdTWTK2Xb_-Ixl6R0Q}{JXU3ZRdWTdSaVN_LDgmj_w}{172.17.63.15}{172.17.63.15:9302}]]])
위 일지에서 봤어요.
zen-disco-node-join[{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301}], reason: added {{node-2}{Q3m2buqsQ7O3RDOabPng6g}{v8PAwZFjT-OGbCbdsazLpA}{172.17.63.15}{172.17.63.15:9301},}
클러스터에 노드가 추가되었으며 노드가 자동으로 추가되지 않은 경우es 디렉터리에서 데이터가 비워졌는지 확인하십시오. 비워지지 않으면 가입할 수 없습니다
3. 각 노드의 시작 상태를 검사한다.
[payment@gameServer logs]$ curl "172.17.63.15:9200"
{
"name" : "node-1",
"cluster_name" : "dev_elastic_cluster",
"cluster_uuid" : "_iUYTJZpQUGDadjbiDtzaw",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
[payment@gameServer logs]$ curl "172.17.63.15:9201"
{
"name" : "node-2",
"cluster_name" : "dev_elastic_cluster",
"cluster_uuid" : "_iUYTJZpQUGDadjbiDtzaw",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
[payment@gameServer logs]$ curl "172.17.63.15:9202"
{
"name" : "node-3",
"cluster_name" : "dev_elastic_cluster",
"cluster_uuid" : "_iUYTJZpQUGDadjbiDtzaw",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
[payment@gameServer logs]$
4. 클러스터 상태 보기
[payment@gameServer logs]$ curl "172.17.63.15:9200/_cat/health?v"
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1528502937 08:08:57 dev_elastic_cluster green 3 3 0 0 0 0 0 0 - 100.0%
node가 보입니다.total과 node.데이터 수 OK 클러스터 구성 OK
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
QV 라이브러리 학습텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.