ELK-7.2.0 클러스터 구축 - elasticsearch

28546 단어
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/index.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
시간 동기화, 방화벽 닫기, 비밀 로그인 면제, 호스트 매핑
환경 기반:
CentOS-7-x86_64-Minimal-1810.iso

jdk-11.0.3_linux-x64_bin.rpm
Hadoop-2.5.1-tar.gz
zookeeper-3.4.6.tar.gz

ELK
elasticsearch-7.2.0-linux-x86_64.tar.gz
logstash-7.2.0.tar.gz
kibana-7.2.0-linux-x86_64.tar.gz

——elasticsearch-7.x jdk12, Hadoop 

 
IP
NN
DN
ZK
ZKFC
JN
RM
NM(작업 관리)
ES
Kibana
master
192.168.25.180
Y
 
Y
Y
 
 Y
 
마스터 노드
Y
slave1
192.168.25.181
Y
Y
Y
Y
Y
Y
Y
노드에서
 
slave2
192.168.25.182
 
Y
Y
 
Y
 
Y
노드에서
 
slave3
192.168.25.183
 
Y
 
 
Y
 
Y
노드에서
 
#  

systemctl disable firewalld.service

#  

systemctl enable ntpd

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

date

1. vim/etc/hosts
192.168.25.180 master
192.168.25.181 slave1
192.168.25.182 slave2
192.168.25.183 slave3

2. elasticsearch-7.2.0]#viconfig/elasticsearch.yml
cd /home

mkdir elastic,mkdir elastic/data,mkdir elastic/logs

master 구성
#  
cluster.name: chenkl
#  
node.name: master
#  , 
path.data: /home/elastic/data
#  , 
path.logs: /home/elastic/logs
#  IP
network.host: 192.168.25.180
# tcp 
transport.tcp.port: 9300
# http 
http.port: 9200
#  , IP seed_hosts 
discovery.seed_hosts: ["192.168.25.180","192.168.25.181","192.168.25.182","192.168.25.183"]
#  , , 
cluster.initial_master_nodes: ["master"]
#  
node.master: true
node.data: false
node.ingest: false
node.ml: false
cluster.remote.connect: false
#  
http.cors.enabled: true
http.cors.allow-origin: "*"
cluster.name: chenkl
node.name: master

path.data: /home/elastic/data
path.logs: /home/elastic/logs

network.host: 192.168.25.180
transport.tcp.port: 9300
http.port: 9200

discovery.seed_hosts: ["192.168.25.180","192.168.25.181","192.168.25.182","192.168.25.183"]
cluster.initial_master_nodes: ["master"]

node.master: true
node.data: false
node.ingest: false
node.ml: false
cluster.remote.connect: false

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

slave1
cluster.name: chenkl
node.name: slave1

path.data: /home/elastic/data
path.logs: /home/elastic/logs

network.host: 192.168.25.181
transport.tcp.port: 9300
http.port: 9200

discovery.seed_hosts: ["192.168.25.180","192.168.25.181","192.168.25.182","192.168.25.183"]
cluster.initial_master_nodes: ["master"]

node.master: false
node.data: true
node.ingest: false
node.ml: false
cluster.remote.connect: false

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

slave2
cluster.name: chenkl
node.name: slave2

path.data: /home/elastic/data
path.logs: /home/elastic/logs

network.host: 192.168.25.182
transport.tcp.port: 9300
http.port: 9200

discovery.seed_hosts: ["192.168.25.180","192.168.25.181","192.168.25.182","192.168.25.183"]
cluster.initial_master_nodes: ["master"]

node.master: false
node.data: true
node.ingest: false
node.ml: false
cluster.remote.connect: false

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

slave3
cluster.name: chenkl
node.name: slave3

path.data: /home/elastic/data
path.logs: /home/elastic/logs

network.host: 192.168.25.183
transport.tcp.port: 9300
http.port: 9200

discovery.seed_hosts: ["192.168.25.180","192.168.25.181","192.168.25.182","192.168.25.183"]
cluster.initial_master_nodes: ["master"]

node.master: false
node.data: true
node.ingest: false
node.ml: false
cluster.remote.connect: false

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

3. 모든 노드가 사용자를 만들고 먼저 노드에서 시작하고 마스터를 시작합니다
adduser bigdata

elasticsearch-7.2.0]# chown -R bigdata:bigdata ../

su bigdata

cd /home/elasticsearch-7.2.0

elasticsearch-7.2.0]$ bin/elasticsearch

넷째, 첫 번째 시작 실패 - 로그
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-07-09T15:31:45,663][INFO ][o.e.n.Node               ] [master] stopping ...
[2019-07-09T15:31:45,687][INFO ][o.e.n.Node               ] [master] stopped
[2019-07-09T15:31:45,687][INFO ][o.e.n.Node               ] [master] closing ...
[2019-07-09T15:31:45,706][INFO ][o.e.n.Node               ] [master] closed

ERROR: [2] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
# root 
vi /etc/security/limits.conf

#  bigdata 
bigdata hard nofile 65536
bigdata soft nofile 65536

# bigdata , , 65536 
ulimit -Hn

[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
# root 
vi /etc/sysctl.conf

# 
vm.max_map_count=262144

#  sysctl -p  
sysctl -p

5. 다시 시작
 

cd /home/elasticsearch-7.2.0/

su bigdata

 

$ bin/elasticsearch -d

시작 성공--로그--master
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-07-13T13:21:47,164][INFO ][o.e.e.NodeEnvironment    ] [master] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [8.6gb], net total_space [12.4gb], types [rootfs]
[2019-07-13T13:21:47,168][INFO ][o.e.e.NodeEnvironment    ] [master] heap size [1007.3mb], compressed ordinary object pointers [true]
[2019-07-13T13:21:47,200][INFO ][o.e.n.Node               ] [master] node name [master], node ID [faJ7qPFyR1CHcgKPnuDpUg], cluster name [chenkl]
[2019-07-13T13:21:47,206][INFO ][o.e.n.Node               ] [master] version[7.2.0], pid[28984], build[default/tar/508c38a/2019-06-20T15:54:18.811730Z], OS[Linux/3.10.0-957.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/11.0.3/11.0.3+12-LTS]
[2019-07-13T13:21:47,208][INFO ][o.e.n.Node               ] [master] JVM home [/usr/java/jdk-11.0.3]
[2019-07-13T13:21:47,211][INFO ][o.e.n.Node               ] [master] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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-2281642436467986982, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -Dio.netty.allocator.type=unpooled, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/home/elasticsearch-7.2.0, -Des.path.conf=/home/elasticsearch-7.2.0/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2019-07-13T13:21:54,404][INFO ][o.e.p.PluginsService     ] [master] loaded module [aggs-matrix-stats]
[2019-07-13T13:21:54,405][INFO ][o.e.p.PluginsService     ] [master] loaded module [analysis-common]
[2019-07-13T13:21:54,405][INFO ][o.e.p.PluginsService     ] [master] loaded module [data-frame]
[2019-07-13T13:21:54,406][INFO ][o.e.p.PluginsService     ] [master] loaded module [ingest-common]
[2019-07-13T13:21:54,407][INFO ][o.e.p.PluginsService     ] [master] loaded module [ingest-geoip]
[2019-07-13T13:21:54,407][INFO ][o.e.p.PluginsService     ] [master] loaded module [ingest-user-agent]
[2019-07-13T13:21:54,408][INFO ][o.e.p.PluginsService     ] [master] loaded module [lang-expression]
[2019-07-13T13:21:54,409][INFO ][o.e.p.PluginsService     ] [master] loaded module [lang-mustache]
[2019-07-13T13:21:54,409][INFO ][o.e.p.PluginsService     ] [master] loaded module [lang-painless]
[2019-07-13T13:21:54,410][INFO ][o.e.p.PluginsService     ] [master] loaded module [mapper-extras]
[2019-07-13T13:21:54,411][INFO ][o.e.p.PluginsService     ] [master] loaded module [parent-join]
[2019-07-13T13:21:54,411][INFO ][o.e.p.PluginsService     ] [master] loaded module [percolator]
[2019-07-13T13:21:54,412][INFO ][o.e.p.PluginsService     ] [master] loaded module [rank-eval]
[2019-07-13T13:21:54,413][INFO ][o.e.p.PluginsService     ] [master] loaded module [reindex]
[2019-07-13T13:21:54,414][INFO ][o.e.p.PluginsService     ] [master] loaded module [repository-url]
[2019-07-13T13:21:54,416][INFO ][o.e.p.PluginsService     ] [master] loaded module [transport-netty4]
[2019-07-13T13:21:54,417][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-ccr]
[2019-07-13T13:21:54,418][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-core]
[2019-07-13T13:21:54,420][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-deprecation]
[2019-07-13T13:21:54,421][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-graph]
[2019-07-13T13:21:54,422][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-ilm]
[2019-07-13T13:21:54,422][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-logstash]
[2019-07-13T13:21:54,423][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-ml]
[2019-07-13T13:21:54,424][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-monitoring]
[2019-07-13T13:21:54,425][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-rollup]
[2019-07-13T13:21:54,426][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-security]
[2019-07-13T13:21:54,426][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-sql]
[2019-07-13T13:21:54,428][INFO ][o.e.p.PluginsService     ] [master] loaded module [x-pack-watcher]
[2019-07-13T13:21:54,429][INFO ][o.e.p.PluginsService     ] [master] loaded plugin [analysis-icu]
[2019-07-13T13:21:54,430][INFO ][o.e.p.PluginsService     ] [master] loaded plugin [analysis-ik]
[2019-07-13T13:22:07,470][INFO ][o.e.x.s.a.s.FileRolesStore] [master] parsed [0] roles from file [/home/elasticsearch-7.2.0/config/roles.yml]
[2019-07-13T13:22:09,996][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [master] [controller/29080] [Main.cc@110] controller (64 bit): Version 7.2.0 (Build 65aefcbfce449b) Copyright (c) 2019 Elasticsearch BV
[2019-07-13T13:22:11,520][DEBUG][o.e.a.ActionModule       ] [master] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-13T13:22:12,983][INFO ][o.e.d.DiscoveryModule    ] [master] using discovery type [zen] and seed hosts providers [settings]
[2019-07-13T13:22:16,166][INFO ][o.e.n.Node               ] [master] initialized
[2019-07-13T13:22:16,167][INFO ][o.e.n.Node               ] [master] starting ...
[2019-07-13T13:22:16,720][INFO ][o.e.t.TransportService   ] [master] publish_address {192.168.25.180:9300}, bound_addresses {192.168.25.180:9300}
[2019-07-13T13:22:16,744][INFO ][o.e.b.BootstrapChecks    ] [master] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-07-13T13:22:16,806][INFO ][o.e.c.c.Coordinator      ] [master] cluster UUID [7ENIUW8FTyCgAVIc5HYPlw]
[2019-07-13T13:22:17,308][INFO ][o.e.c.s.MasterService    ] [master] elected-as-master ([1] nodes joined)[{master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 2, version: 22, reason: master node changed {previous [], current [{master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true}]}
[2019-07-13T13:22:17,549][INFO ][o.e.c.s.ClusterApplierService] [master] master node changed {previous [], current [{master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true}]}, term: 2, version: 22, reason: Publication{term=2, version=22}
[2019-07-13T13:22:17,769][INFO ][o.e.c.s.MasterService    ] [master] node-join[{slave3}{Z22731KSRnqHghLbs_V_GA}{DdrH0xhHQM2DtfhX1rpnDQ}{192.168.25.183}{192.168.25.183:9300}{xpack.installed=true} join existing leader, {slave2}{NX_j78UyQbKPAIRuiV79mA}{ShpiYdPnScyk9EJaPp560g}{192.168.25.182}{192.168.25.182:9300}{xpack.installed=true} join existing leader, {slave1}{tm_GLIQsTtOqRw7r1bjrug}{YZc1au7hSvi1hkh99e1MNg}{192.168.25.181}{192.168.25.181:9300}{xpack.installed=true} join existing leader], term: 2, version: 23, reason: added {{slave2}{NX_j78UyQbKPAIRuiV79mA}{ShpiYdPnScyk9EJaPp560g}{192.168.25.182}{192.168.25.182:9300}{xpack.installed=true},{slave3}{Z22731KSRnqHghLbs_V_GA}{DdrH0xhHQM2DtfhX1rpnDQ}{192.168.25.183}{192.168.25.183:9300}{xpack.installed=true},{slave1}{tm_GLIQsTtOqRw7r1bjrug}{YZc1au7hSvi1hkh99e1MNg}{192.168.25.181}{192.168.25.181:9300}{xpack.installed=true},}
[2019-07-13T13:22:17,771][INFO ][o.e.h.AbstractHttpServerTransport] [master] publish_address {192.168.25.180:9200}, bound_addresses {192.168.25.180:9200}
[2019-07-13T13:22:17,789][INFO ][o.e.n.Node               ] [master] started
[2019-07-13T13:22:18,163][INFO ][o.e.c.s.ClusterApplierService] [master] added {{slave2}{NX_j78UyQbKPAIRuiV79mA}{ShpiYdPnScyk9EJaPp560g}{192.168.25.182}{192.168.25.182:9300}{xpack.installed=true},{slave3}{Z22731KSRnqHghLbs_V_GA}{DdrH0xhHQM2DtfhX1rpnDQ}{192.168.25.183}{192.168.25.183:9300}{xpack.installed=true},{slave1}{tm_GLIQsTtOqRw7r1bjrug}{YZc1au7hSvi1hkh99e1MNg}{192.168.25.181}{192.168.25.181:9300}{xpack.installed=true},}, term: 2, version: 23, reason: Publication{term=2, version=23}
[2019-07-13T13:22:19,643][INFO ][o.e.l.LicenseService     ] [master] license [1ef58c9c-81f1-4884-ae8c-05b3910a7c73] mode [basic] - valid
[2019-07-13T13:22:19,674][INFO ][o.e.g.GatewayService     ] [master] recovered [1] indices into cluster_state
[2019-07-13T13:22:21,917][INFO ][o.e.c.r.a.AllocationService] [master] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[test03][0]] ...]).
[2019-07-13T13:22:23,723][INFO ][o.e.c.r.a.AllocationService] [master] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[test03][0]] ...]).

시작 성공--로그--slave1
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-07-13T13:22:03,533][INFO ][o.e.e.NodeEnvironment    ] [slave1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [9.6gb], net total_space [12.4gb], types [rootfs]
[2019-07-13T13:22:03,538][INFO ][o.e.e.NodeEnvironment    ] [slave1] heap size [1007.3mb], compressed ordinary object pointers [true]
[2019-07-13T13:22:03,661][INFO ][o.e.n.Node               ] [slave1] node name [slave1], node ID [tm_GLIQsTtOqRw7r1bjrug], cluster name [chenkl]
[2019-07-13T13:22:03,666][INFO ][o.e.n.Node               ] [slave1] version[7.2.0], pid[28885], build[default/tar/508c38a/2019-06-20T15:54:18.811730Z], OS[Linux/3.10.0-957.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/11.0.3/11.0.3+12-LTS]
[2019-07-13T13:22:03,681][INFO ][o.e.n.Node               ] [slave1] JVM home [/usr/java/jdk-11.0.3]
[2019-07-13T13:22:03,689][INFO ][o.e.n.Node               ] [slave1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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-7016455792488916778, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -Dio.netty.allocator.type=unpooled, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/home/elasticsearch-7.2.0, -Des.path.conf=/home/elasticsearch-7.2.0/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2019-07-13T13:22:10,641][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [aggs-matrix-stats]
[2019-07-13T13:22:10,642][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [analysis-common]
[2019-07-13T13:22:10,643][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [data-frame]
[2019-07-13T13:22:10,643][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [ingest-common]
[2019-07-13T13:22:10,644][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [ingest-geoip]
[2019-07-13T13:22:10,645][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [ingest-user-agent]
[2019-07-13T13:22:10,645][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [lang-expression]
[2019-07-13T13:22:10,646][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [lang-mustache]
[2019-07-13T13:22:10,647][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [lang-painless]
[2019-07-13T13:22:10,647][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [mapper-extras]
[2019-07-13T13:22:10,648][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [parent-join]
[2019-07-13T13:22:10,649][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [percolator]
[2019-07-13T13:22:10,650][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [rank-eval]
[2019-07-13T13:22:10,651][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [reindex]
[2019-07-13T13:22:10,652][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [repository-url]
[2019-07-13T13:22:10,670][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [transport-netty4]
[2019-07-13T13:22:10,676][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-ccr]
[2019-07-13T13:22:10,677][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-core]
[2019-07-13T13:22:10,678][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-deprecation]
[2019-07-13T13:22:10,697][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-graph]
[2019-07-13T13:22:10,697][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-ilm]
[2019-07-13T13:22:10,698][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-logstash]
[2019-07-13T13:22:10,699][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-ml]
[2019-07-13T13:22:10,699][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-monitoring]
[2019-07-13T13:22:10,705][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-rollup]
[2019-07-13T13:22:10,714][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-security]
[2019-07-13T13:22:10,738][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-sql]
[2019-07-13T13:22:10,788][INFO ][o.e.p.PluginsService     ] [slave1] loaded module [x-pack-watcher]
[2019-07-13T13:22:10,790][INFO ][o.e.p.PluginsService     ] [slave1] loaded plugin [analysis-icu]
[2019-07-13T13:22:10,791][INFO ][o.e.p.PluginsService     ] [slave1] loaded plugin [analysis-ik]
[2019-07-13T13:22:24,573][INFO ][o.e.x.s.a.s.FileRolesStore] [slave1] parsed [0] roles from file [/home/elasticsearch-7.2.0/config/roles.yml]
[2019-07-13T13:22:26,682][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [slave1] [controller/28981] [Main.cc@110] controller (64 bit): Version 7.2.0 (Build 65aefcbfce449b) Copyright (c) 2019 Elasticsearch BV
[2019-07-13T13:22:28,287][DEBUG][o.e.a.ActionModule       ] [slave1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-07-13T13:22:29,695][INFO ][o.e.d.DiscoveryModule    ] [slave1] using discovery type [zen] and seed hosts providers [settings]
[2019-07-13T13:22:32,845][INFO ][o.e.n.Node               ] [slave1] initialized
[2019-07-13T13:22:32,847][INFO ][o.e.n.Node               ] [slave1] starting ...
[2019-07-13T13:22:33,250][INFO ][o.e.t.TransportService   ] [slave1] publish_address {192.168.25.181:9300}, bound_addresses {192.168.25.181:9300}
[2019-07-13T13:22:33,295][INFO ][o.e.b.BootstrapChecks    ] [slave1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-07-13T13:22:33,378][INFO ][o.e.c.c.Coordinator      ] [slave1] cluster UUID [7ENIUW8FTyCgAVIc5HYPlw]
[2019-07-13T13:22:34,783][INFO ][o.e.c.s.ClusterApplierService] [slave1] master node changed {previous [], current [{master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true}]}, added {{slave3}{Z22731KSRnqHghLbs_V_GA}{DdrH0xhHQM2DtfhX1rpnDQ}{192.168.25.183}{192.168.25.183:9300}{xpack.installed=true},{master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true},{slave2}{NX_j78UyQbKPAIRuiV79mA}{ShpiYdPnScyk9EJaPp560g}{192.168.25.182}{192.168.25.182:9300}{xpack.installed=true},}, term: 2, version: 23, reason: ApplyCommitRequest{term=2, version=23, sourceNode={master}{faJ7qPFyR1CHcgKPnuDpUg}{VkBBnwJSQhGtdQCmr8otaQ}{192.168.25.180}{192.168.25.180:9300}{xpack.installed=true}}
[2019-07-13T13:22:35,082][INFO ][o.e.h.AbstractHttpServerTransport] [slave1] publish_address {192.168.25.181:9200}, bound_addresses {192.168.25.181:9200}
[2019-07-13T13:22:35,083][INFO ][o.e.n.Node               ] [slave1] started
[2019-07-13T13:22:36,117][INFO ][o.e.l.LicenseService     ] [slave1] license [1ef58c9c-81f1-4884-ae8c-05b3910a7c73] mode [basic] - valid
[2019-07-13T13:22:36,648][INFO ][o.e.x.s.a.TokenService   ] [slave1] refresh keys
[2019-07-13T13:22:37,063][INFO ][o.e.x.s.a.TokenService   ] [slave1] refreshed keys
[2019-07-13T13:22:37,324][INFO ][o.w.a.d.Monitor          ] [slave1] try load config from /home/elasticsearch-7.2.0/config/analysis-ik/IKAnalyzer.cfg.xml
[2019-07-13T13:22:37,326][INFO ][o.w.a.d.Monitor          ] [slave1] try load config from /home/elasticsearch-7.2.0/plugins/ik/config/IKAnalyzer.cfg.xml

6. 다음과 같은 정보가 있으면 집단 구축에 성공한다
클러스터 상태 보기(임의의 노드 실행): curl-XGET'192.168.25.180:9200/_cluster/health?pretty'
[bigdata@slave1 elasticsearch-7.2.0]$ curl  -XGET '192.168.25.180:9200/_cluster/health?pretty'
{
  "cluster_name" : "chenkl",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 4,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 10,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 0.0
}

각 노드의 정보 보기:curl-XGEThttp://192.168.25.180:9200/_nodes/process?pretty'
[bigdata@slave1 elasticsearch-7.2.0]$ curl  -XGET 'http://192.168.25.180:9200/_nodes/process?pretty'
{
  "_nodes" : {
    "total" : 4,
    "successful" : 4,
    "failed" : 0
  },
  "cluster_name" : "chenkl",
  "nodes" : {
    "4C-lXJJSSyGXWwjbsP_f0g" : {
      "name" : "master",
      "transport_address" : "192.168.25.180:9300",
      "host" : "192.168.25.180",
      "ip" : "192.168.25.180",
      "version" : "7.2.0",
      "build_flavor" : "default",
      "build_type" : "tar",
      "build_hash" : "508c38a",
      "roles" : [
        "master"
      ],
      "attributes" : {
        "xpack.installed" : "true"
      },
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 12988,
        "mlockall" : false
      }
    },
    "7cBobpzsQ4eWkZdKTd9O9A" : {
      "name" : "slave1",
      "transport_address" : "192.168.25.181:9300",
      "host" : "192.168.25.181",
      "ip" : "192.168.25.181",
      "version" : "7.2.0",
      "build_flavor" : "default",
      "build_type" : "tar",
      "build_hash" : "508c38a",
      "roles" : [
        "data"
      ],
      "attributes" : {
        "xpack.installed" : "true"
      },
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 11245,
        "mlockall" : false
      }
    },
    "ozi1yThBROyidOmeRVWj3A" : {
      "name" : "slave2",
      "transport_address" : "192.168.25.182:9300",
      "host" : "192.168.25.182",
      "ip" : "192.168.25.182",
      "version" : "7.2.0",
      "build_flavor" : "default",
      "build_type" : "tar",
      "build_hash" : "508c38a",
      "roles" : [
        "data"
      ],
      "attributes" : {
        "xpack.installed" : "true"
      },
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 11243,
        "mlockall" : false
      }
    },
    "rTBdN7rRTIeQcVoPpTc2-Q" : {
      "name" : "slave3",
      "transport_address" : "192.168.25.183:9300",
      "host" : "192.168.25.183",
      "ip" : "192.168.25.183",
      "version" : "7.2.0",
      "build_flavor" : "default",
      "build_type" : "tar",
      "build_hash" : "508c38a",
      "roles" : [
        "data"
      ],
      "attributes" : {
        "xpack.installed" : "true"
      },
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 11257,
        "mlockall" : false
      }
    }
  }
}

단일 노드 정보 보기:curl -XGEThttp://192.168.25.180:9200'
{
  "name" : "master",
  "cluster_name" : "chenkl",
  "cluster_uuid" : "7ENIUW8FTyCgAVIc5HYPlw",
  "version" : {
    "number" : "7.2.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "508c38a",
    "build_date" : "2019-06-20T15:54:18.811730Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

7. 모든 노드에 ES 플러그인을 설치하고 다음 명령을 수행합니다.
elasticsearch-7.2.0]# bin/elasticsearch-plugin install analysis-icu
8. IK 분사기 설치(중국어 분사기)
통과http://192.168.25.180:9200ES 버전을 보고 해당 IK 분사 플러그인을 다운로드한 후 다음을 수행합니다.
cd /home/elasticsearch-7.2.0/

mkdir plugins/ik

cd plugins/ik

unzip elasticsearch-analysis-ik-7.2.0.zip

scp -r ./ root@slave1:/home/elasticsearch-7.2.0/plugins/ik/

9. 지식 확장:
환경 구축 - 기초 지식 - 자바 조작 - 이상 총결산 등
ElasticSearch는 7.X 버전에서 type 빼기
10. 요약: ES7.x에서 type을 폐기했습니다. 만드는 과정에서 볼 수 있습니다. 기본 type은 모두 "_doc"입니다.동시에 index:analyzed는true나false로 대체합니다.집단을 구축하는 과정에서 설정 항목의 주종이 매우 중요하다.Java API 문서 호출
11. 다음 시작
 

cd /home/elasticsearch-7.2.0/

su bigdata

 

$ bin/elasticsearch -d

좋은 웹페이지 즐겨찾기