elasticseatrch安装完成后 curl walker001:9200进行验证时报如下错误
[walker001@walker002 elasticsearch-6.4.2]$ curl walker001:9200
curl: (7) Failed to connect to walker001 port 9200: 拒绝连接
异常原因可查看logs目录下es_cluster.log进行查看
[root@walker001 logs]# more es_cluster.log
[2020-05-19T16:46:25,071][INFO ][o.e.n.Node ] [es-walker001] initializing ...
[2020-05-19T16:46:25,558][INFO ][o.e.e.NodeEnvironment ] [es-walker001] using [1] data paths, mounts [[/ (/dev/mapper/cl-root)]], net usable_space [5.3gb], net total_space [16.9gb], types [xfs]
[2020-05-19T16:46:25,559][INFO ][o.e.e.NodeEnvironment ] [es-walker001] heap size [1015.6mb], compressed ordinary object pointers [true]
[2020-05-19T16:46:25,562][INFO ][o.e.n.Node ] [es-walker001] node name [es-walker001], node ID [f3IT8cJzSjuVWHRniK4K0g]
[2020-05-19T16:46:25,562][INFO ][o.e.n.Node ] [es-walker001] version[6.4.2], pid[2284], build[default/tar/04711c2/2018-09-26T13:34:09.098244Z], OS[Linux/4.18.0-147.el8.x86_64/amd64], JVM[Oracle
Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_144/25.144-b01]
[2020-05-19T16:46:25,562][INFO ][o.e.n.Node ] [es-walker001] 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.recyc
ler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.bd5kgJjr, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=l
ogs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=3
2, -XX:GCLogFileSize=64m, -Des.path.home=/home/walker001/app/elasticsearch-6.4.2, -Des.path.conf=/home/walker001/app/elasticsearch-6.4.2/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2020-05-19T16:46:34,741][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [aggs-matrix-stats]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [analysis-common]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [ingest-common]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [lang-expression]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [lang-mustache]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [lang-painless]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [mapper-extras]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [parent-join]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [percolator]
[2020-05-19T16:46:34,742][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [rank-eval]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [reindex]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [repository-url]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [transport-netty4]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [tribe]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-core]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-deprecation]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-graph]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-logstash]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-ml]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-monitoring]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-rollup]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-security]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-sql]
[2020-05-19T16:46:34,743][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-upgrade]
[2020-05-19T16:46:34,744][INFO ][o.e.p.PluginsService ] [es-walker001] loaded module [x-pack-watcher]
[2020-05-19T16:46:34,744][INFO ][o.e.p.PluginsService ] [es-walker001] no plugins loaded
[2020-05-19T16:46:45,759][INFO ][o.e.x.s.a.s.FileRolesStore] [es-walker001] parsed [0] roles from file [/home/walker001/app/elasticsearch-6.4.2/config/roles.yml]
[2020-05-19T16:46:47,792][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/2308] [Main.cc@109] controller (64 bit): Version 6.4.2 (Build 660eefe6f2ea55) Copyright (c) 2018 Elasticsearch BV
[2020-05-19T16:46:49,577][DEBUG][o.e.a.ActionModule ] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2020-05-19T16:46:50,392][INFO ][o.e.d.DiscoveryModule ] [es-walker001] using discovery type [zen]
[2020-05-19T16:46:53,053][INFO ][o.e.n.Node ] [es-walker001] initialized
[2020-05-19T16:46:53,053][INFO ][o.e.n.Node ] [es-walker001] starting ...
[2020-05-19T16:46:54,738][INFO ][o.e.t.TransportService ] [es-walker001] publish_address {192.168.220.129:9300}, bound_addresses {192.168.220.129:9300}
[2020-05-19T16:46:54,818][INFO ][o.e.b.BootstrapChecks ] [es-walker001] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2020-05-19T16:46:54,845][ERROR][o.e.b.Bootstrap ] [es-walker001] node validation exception
[1] bootstrap checks failed
[1]: max number of threads [2048] for user [walker001] is too low, increase to at least [4096]
[2020-05-19T16:46:54,856][INFO ][o.e.n.Node ] [es-walker001] stopping ...
[2020-05-19T16:46:54,958][INFO ][o.e.n.Node ] [es-walker001] stopped
[2020-05-19T16:46:54,958][INFO ][o.e.n.Node ] [es-walker001] closing ...
[2020-05-19T16:46:55,047][INFO ][o.e.n.Node ] [es-walker001] closed
[2020-05-19T16:46:55,075][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
可以发现
[1]: max number of threads [2048] for user [walker001] is too low, increase to at least [4096]
进程数太小,最小需设置4096
修改/etc/security/limits.conf 文件,添加如下配置
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 8192
* soft memlock unlimited
* hard memlock unlimited
nofile 允许打开文件最大数
nproc 允许启动进程最大数
memlock 最大锁定内存
*表示对所有用户有效,soft代表软限制,警告级别,hard代表硬限制
修改完重启机器后重新启动es再测试
[walker001@walker001 elasticsearch-6.4.2]$ curl walker001:9200
{
"name" : "es-walker001",
"cluster_name" : "es_cluster",
"cluster_uuid" : "v_kHCCccRfG5eLSOvd75Dw",
"version" : {
"number" : "6.4.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "04711c2",
"build_date" : "2018-09-26T13:34:09.098244Z",
"build_snapshot" : false,
"lucene_version" : "7.4.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
验证通过