Issue with limits with elasticsearch - elasticsearch

I have installed elasticsearch on my server having this ip address W.X.Y.Z
I am able to run
./elasticsearch-6.3.2/bin/elasticsearch
The elasticsearch service is accessible on localhost (remote server) but I can't access it from my locale machine with the browser at this address http://W.X.Y.Z:9200/
Then I tried to change the elasticsearch-6.3.2/config/elasticsearch.yml file by adding the following lines (please see the attached screenshot)
network.host: 0.0.0.0
http.port: 9200
And at this time, I'm not able to run
./elasticsearch-6.3.2/bin/elasticsearch
I have updated /etc/security/limits.conf file by adding
elasticsearch - nofile 65536
elasticsearch - nproc 4096
this command ulimit -a still showing me this screen
And always, I'm not able to run ./elasticsearch command, I'm getting this result
[2018-11-22T09:50:06,714][INFO ][o.e.n.Node ] [] initializing ...
[2018-11-22T09:50:06,866][INFO ][o.e.e.NodeEnvironment ] [b1qDVeW] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [14.2gb], net total_space [17.2gb], types [rootfs]
[2018-11-22T09:50:06,871][INFO ][o.e.e.NodeEnvironment ] [b1qDVeW] heap size [1015.6mb], compressed ordinary object pointers [true]
[2018-11-22T09:50:06,873][INFO ][o.e.n.Node ] [b1qDVeW] node name derived from node ID [b1qDVeW5RRWfC58mHtWaKQ]; set [node.name] to override
[2018-11-22T09:50:06,873][INFO ][o.e.n.Node ] [b1qDVeW] version[6.3.2], pid[15624], build[default/tar/053779d/2018-07-20T05:20:23.451332Z], OS[Linux/3.16.0-5-amd64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_191/25.191-b12]
[2018-11-22T09:50:06,875][INFO ][o.e.n.Node ] [b1qDVeW] 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.Z9qppca6, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/home/developer/elasticsearch-6.3.2, -Des.path.conf=/home/developer/elasticsearch-6.3.2/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2018-11-22T09:50:12,367][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [aggs-matrix-stats]
[2018-11-22T09:50:12,373][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [analysis-common]
[2018-11-22T09:50:12,373][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [ingest-common]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-expression]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-mustache]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-painless]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [mapper-extras]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [parent-join]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [percolator]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [rank-eval]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [reindex]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [repository-url]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [transport-netty4]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [tribe]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-core]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-deprecation]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-graph]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-logstash]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-ml]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-monitoring]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-rollup]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-security]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-sql]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-upgrade]
[2018-11-22T09:50:12,380][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-watcher]
[2018-11-22T09:50:12,380][INFO ][o.e.p.PluginsService ] [b1qDVeW] no plugins loaded
[2018-11-22T09:50:21,545][INFO ][o.e.x.s.a.s.FileRolesStore] [b1qDVeW] parsed [0] roles from file [/home/developer/elasticsearch-6.3.2/config/roles.yml]
[2018-11-22T09:50:22,679][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/15672] [Main.cc#109] controller (64 bit): Version 6.3.2 (Build 903094f295d249) Copyright (c) 2018 Elasticsearch BV
[2018-11-22T09:50:23,497][DEBUG][o.e.a.ActionModule ] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2018-11-22T09:50:24,036][INFO ][o.e.d.DiscoveryModule ] [b1qDVeW] using discovery type [zen]
[2018-11-22T09:50:25,981][INFO ][o.e.n.Node ] [b1qDVeW] initialized
[2018-11-22T09:50:25,982][INFO ][o.e.n.Node ] [b1qDVeW] starting ...
[2018-11-22T09:50:26,351][INFO ][o.e.t.TransportService ] [b1qDVeW] publish_address {94.177.240.139:9300}, bound_addresses {[::]:9300}
[2018-11-22T09:50:26,407][INFO ][o.e.b.BootstrapChecks ] [b1qDVeW] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max number of threads [3903] for user [developer] is too low, increase to at least [4096]
[2018-11-22T09:50:26,445][INFO ][o.e.n.Node ] [b1qDVeW] stopping ...
[2018-11-22T09:50:26,483][INFO ][o.e.n.Node ] [b1qDVeW] stopped
[2018-11-22T09:50:26,484][INFO ][o.e.n.Node ] [b1qDVeW] closing ...
[2018-11-22T09:50:26,511][INFO ][o.e.n.Node ] [b1qDVeW] closed
[2018-11-22T09:50:26,521][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started

Your problem is not related to network address, but to limits.
Have a look at what returns the linux shell command :
ulimit -a
Look at values max user processes and virtual memory, there are too low for running Elasticsearch. Temporary raise them with the ulimit command :
> ulimit -u 4096
> ulimit -v 262144
or permanently modify them like this :
sysctl -w vm.max_map_count=262144
(as explained here : https://www.elastic.co/guide/en/elasticsearch/reference/master/vm-max-map-count.html)
and edit /etc/security/limits.conf
elasticsearch - nofile 65536
elasticsearch - nproc 4096
(as explained here : https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html)

Related

Elasticsearch start error:Native controller process has stopped - no new native processes can be started

When I install elasticsearch on my virtual machine, elasticsearch does not start properly.
I tried to do these:
vi /etc/security/limits.conf
soft nofile 65536
hard nofile 131072
soft nproc 2048
hard nproc 4096
vi /etc/security/limits.d/90-nproc.conf
soft nproc 4096
vi /etc/sysctl.conf
vm.max_map_count=655360
[es#test elasticsearch-7.3.1]$ ./bin/elasticsearch
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-09-10T22:52:12,836][INFO ][o.e.e.NodeEnvironment ] [test] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [35.4gb], net total_space [39.9gb], types [rootfs]
[2019-09-10T22:52:12,850][INFO ][o.e.e.NodeEnvironment ] [test] heap size [989.8mb], compressed ordinary object pointers [true]
[2019-09-10T22:52:12,856][INFO ][o.e.n.Node ] [test] node name [test], node ID [G5dWJVSFTOWAVpNseEPcsQ], cluster name [elasticsearch]
[2019-09-10T22:52:12,857][INFO ][o.e.n.Node ] [test] version[7.3.1], pid[19178], build[default/tar/4749ba6/2019-08-19T20:19:25.651794Z], OS[Linux/3.10.0-957.27.2.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/11.0.4/11.0.4+10-LTS]
[2019-09-10T22:52:12,859][INFO ][o.e.n.Node ] [test] JVM home [/opt/jdk-11.0.4]
[2019-09-10T22:52:12,859][INFO ][o.e.n.Node ] [test] 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-3827173686900523231, -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=/usr/local/elasticsearch/elasticsearch-7.3.1, -Des.path.conf=/usr/local/elasticsearch/elasticsearch-7.3.1/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2019-09-10T22:52:23,967][INFO ][o.e.p.PluginsService ] [test] loaded module [aggs-matrix-stats]
[2019-09-10T22:52:23,977][INFO ][o.e.p.PluginsService ] [test] loaded module [analysis-common]
[2019-09-10T22:52:23,978][INFO ][o.e.p.PluginsService ] [test] loaded module [data-frame]
[2019-09-10T22:52:23,979][INFO ][o.e.p.PluginsService ] [test] loaded module [flattened]
[2019-09-10T22:52:23,979][INFO ][o.e.p.PluginsService ] [test] loaded module [ingest-common]
[2019-09-10T22:52:23,980][INFO ][o.e.p.PluginsService ] [test] loaded module [ingest-geoip]
[2019-09-10T22:52:23,981][INFO ][o.e.p.PluginsService ] [test] loaded module [ingest-user-agent]
[2019-09-10T22:52:23,981][INFO ][o.e.p.PluginsService ] [test] loaded module [lang-expression]
[2019-09-10T22:52:23,982][INFO ][o.e.p.PluginsService ] [test] loaded module [lang-mustache]
[2019-09-10T22:52:23,983][INFO ][o.e.p.PluginsService ] [test] loaded module [lang-painless]
[2019-09-10T22:52:23,984][INFO ][o.e.p.PluginsService ] [test] loaded module [mapper-extras]
[2019-09-10T22:52:23,984][INFO ][o.e.p.PluginsService ] [test] loaded module [parent-join]
[2019-09-10T22:52:23,985][INFO ][o.e.p.PluginsService ] [test] loaded module [percolator]
[2019-09-10T22:52:23,986][INFO ][o.e.p.PluginsService ] [test] loaded module [rank-eval]
[2019-09-10T22:52:23,986][INFO ][o.e.p.PluginsService ] [test] loaded module [reindex]
[2019-09-10T22:52:23,987][INFO ][o.e.p.PluginsService ] [test] loaded module [repository-url]
[2019-09-10T22:52:23,987][INFO ][o.e.p.PluginsService ] [test] loaded module [transport-netty4]
[2019-09-10T22:52:23,988][INFO ][o.e.p.PluginsService ] [test] loaded module [vectors]
[2019-09-10T22:52:23,988][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-ccr]
[2019-09-10T22:52:23,989][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-core]
[2019-09-10T22:52:23,989][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-deprecation]
[2019-09-10T22:52:23,990][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-graph]
[2019-09-10T22:52:23,990][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-ilm]
[2019-09-10T22:52:23,991][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-logstash]
[2019-09-10T22:52:23,991][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-ml]
[2019-09-10T22:52:23,992][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-monitoring]
[2019-09-10T22:52:23,992][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-rollup]
[2019-09-10T22:52:23,993][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-security]
[2019-09-10T22:52:23,993][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-sql]
[2019-09-10T22:52:23,994][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-voting-only-node]
[2019-09-10T22:52:23,994][INFO ][o.e.p.PluginsService ] [test] loaded module [x-pack-watcher]
[2019-09-10T22:52:23,995][INFO ][o.e.p.PluginsService ] [test] no plugins loaded
[2019-09-10T22:52:48,793][INFO ][o.e.x.s.a.s.FileRolesStore] [test] parsed [0] roles from file [/usr/local/elasticsearch/elasticsearch-7.3.1/config/roles.yml]
[2019-09-10T22:52:51,610][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [test] [controller/19279] [Main.cc#110] controller (64 bit): Version 7.3.1 (Build 1d93901e09ef43) Copyright (c) 2019 Elasticsearch BV
[2019-09-10T22:52:53,219][DEBUG][o.e.a.ActionModule ] [test] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2019-09-10T22:52:55,389][INFO ][o.e.d.DiscoveryModule ] [test] using discovery type [zen] and seed hosts providers [settings]
[2019-09-10T22:53:03,862][INFO ][o.e.n.Node ] [test] initialized
[2019-09-10T22:53:03,886][INFO ][o.e.n.Node ] [test] starting ...
[2019-09-10T22:53:05,370][INFO ][o.e.t.TransportService ] [test] publish_address {10.1.2.91:9301}, bound_addresses {[::]:9301}
[2019-09-10T22:53:05,397][INFO ][o.e.b.BootstrapChecks ] [test] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2019-09-10T22:53:05,451][INFO ][o.e.n.Node ] [test] stopping ...
[2019-09-10T22:53:05,531][INFO ][o.e.n.Node ] [test] stopped
[2019-09-10T22:53:05,531][INFO ][o.e.n.Node ] [test] closing ...
[2019-09-10T22:53:05,588][INFO ][o.e.n.Node ] [test] closed
[2019-09-10T22:53:05,593][INFO ][o.e.x.m.p.NativeController] [test] Native controller process has stopped - no new native processes can be started
I want it to start normally, but it always shows this error: [2019-09-10T22:53:05,593][INFO ][o.e.x.m.p.NativeController] [test] Native controller process has stopped - no new native processes can be startedenter code here
Here is the problem :
[max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
That work for me :
sudo sysctl -w vm.max_map_count=280530
I think this is related to this error:
[2019-09-10T22:53:05,397][INFO ][o.e.b.BootstrapChecks ] [test] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
see https://www.elastic.co/guide/en/elasticsearch/reference/7.1/discovery-settings.html
May be specifying these three things correctly may solve your error trace.
1) Change the network.host in elastic configuration (elasticsearch.yml), look for the line containing network.host and uncomment it and set it to 0.0.0.0.
2) Change the JVM options, if you are using a zip file locate jvm.options in the config/ folder.
3) Set discovery.seed_hosts: also if any error still persists.
https://www.elastic.co/guide/en/elasticsearch/reference/master/jvm-options.html

how to change kernel parameters of a pod in Openshift?

Trying to run Elastic Search 6.2.4 on Openshift but it is not running and the container exits with the code 137.
[2018-06-01T14:24:58,148][INFO ][o.e.p.PluginsService ] [jge060C]
loaded module [ingest-common]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [lang-expression]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [lang-mustache]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [lang-painless]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [mapper-extras]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [parent-join]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [percolator]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [rank-eval]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [reindex]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [repository-url]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [transport-netty4]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService ] [jge060C] loaded module [tribe]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [ingest-geoip]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [ingest-user-agent]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-core]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-deprecation]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-graph]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-logstash]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-ml]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-monitoring]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-security]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-upgrade]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService ] [jge060C] loaded plugin [x-pack-watcher]
[2018-06-01T14:25:01,592][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/131] [Main.cc#128] controller (64 bit): Version 6.2.4 (Build 524e7fe231abc1) Copyright (c) 2018 Elasticsearch BV
[2018-06-01T14:25:03,271][INFO ][o.e.d.DiscoveryModule ] [jge060C] using discovery type [zen]
[2018-06-01T14:25:04,305][INFO ][o.e.n.Node ] initialized
[2018-06-01T14:25:04,305][INFO ][o.e.n.Node ] [jge060C] starting ...
[2018-06-01T14:25:04,497][INFO ][o.e.t.TransportService ] [jge060C] publish_address {10.131.3.134:9300}, bound_addresses {[::]:9300}
[2018-06-01T14:25:04,520][INFO ][o.e.b.BootstrapChecks ] [jge060C] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-06-01T14:25:04,531][INFO ][o.e.n.Node ] [jge060C] stopping ...
[2018-06-01T14:25:04,623][INFO ][o.e.n.Node ] [jge060C] stopped
[2018-06-01T14:25:04,624][INFO ][o.e.n.Node ] [jge060C] closing ...
[2018-06-01T14:25:04,634][INFO ][o.e.n.Node ] [jge060C] closed
As you can see from the logs, the vm max heap size has to be increased. As it turns out to be a kernel parameter, how to change that for the pod that is running ES?
Kernel command line parameters can't be changed per pod, but vm.max_map_count is parameter you can change via sysctl.
See these two similar SO question for a solution:
How to pass `sysctl` flags to docker from k8s?
Enabling net.ipv4.ip_forward for a container
There is also a more general explanation in the official Kubernetes documentation on sysctl
You cannot change kernel parameters for individual pods; they have to be fixed in the underlying operating system.

Elastic search failed to run after X-pack plugin enabled in Windows 10 64 bit machine?

I'm trying ELK 6.0.0 on Windows but I have a problem with X-Pack and Machine Learning.
I have installed the X-Pack plugin in command prompt.it successfully installed the plugin.
elasticsearch-plugin install x-pack
When I start Elasticsearch, I have an exception :
C:\\Users\ELK\6.0.0\elasticsearch\bin>elasticsearch
[2018-05-30T15:26:11,578][INFO ][o.e.n.Node ] [] initializing ...
[2018-05-30T15:26:11,703][INFO ][o.e.e.NodeEnvironment ] [Icp0LXw] using [1] data paths, mounts [[OSDISK (C:)]], net usable_space [107.8gb], net total_space [149.9gb], types [NTFS]
[2018-05-30T15:26:11,703][INFO ][o.e.e.NodeEnvironment ] [Icp0LXw] heap size [998.4mb], compressed ordinary object pointers [unknown]
[2018-05-30T15:26:12,054][INFO ][o.e.n.Node ] node name [Icp0LXw] derived from node ID [Icp0LXwiRfG4Rq-1z9cvDA]; set [node.name] to override
[2018-05-30T15:26:12,054][INFO ][o.e.n.Node ] version[6.0.0], pid[9800], build[8f0685b/2017-11-10T18:41:22.859Z], OS[Windows 10/10.0/x86], JVM[Oracle Corporation/Java HotSpot(TM) Server VM/1.8.0_144/25.144-b01]
[2018-05-30T15:26:12,054][INFO ][o.e.n.Node ] 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, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=C:\Users\41809\ELK\6.0.0\elasticsearch, -Des.path.conf=C:\Users\41809\ELK\6.0.0\elasticsearch\config]
[2018-05-30T15:26:13,546][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [aggs-matrix-stats]
[2018-05-30T15:26:13,546][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [analysis-common]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [ingest-common]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [lang-expression]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [lang-mustache]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [lang-painless]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [parent-join]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [percolator]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [reindex]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [repository-url]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [transport-netty4]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded module [tribe]
[2018-05-30T15:26:13,561][INFO ][o.e.p.PluginsService ] [Icp0LXw] loaded plugin [x-pack]
[2018-05-30T15:26:15,589][DEBUG][o.e.a.ActionModule ] Using REST wrapper from plugin org.elasticsearch.xpack.XPackPlugin
[2018-05-30T15:26:17,034][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[X-Pack is not supported and Machine Learning is not available for [windows-x86]; you can use the other X-Pack features (unsupported) by setting xpack.ml.enabled: false in elasticsearch.yml]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:134) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-6.0.0.jar:6.0.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-6.0.0.jar:6.0.0]
Platform Configuration:
Windows 10 Enterprise 64 Bit.
Please help to fix the issue.
Thanks Advance.

elasticsearch-head can't connection to elasticsearch with http://localhost:9200

elasticsearch version : elasticsearch-5.2.0
elasticsearch-head version : latest version
Start service successfully:
#### node1 ####
deMacBook-Pro:bin yyq$ ./elasticsearch
[2017-02-15T13:08:57,174][INFO ][o.e.n.Node ] [yml-es-node-1] initializing ...
[2017-02-15T13:08:57,303][INFO ][o.e.e.NodeEnvironment ] [yml-es-node-1] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [21.4gb], net total_space [232.6gb], spins? [unknown], types [hfs]
[2017-02-15T13:08:57,304][INFO ][o.e.e.NodeEnvironment ] [yml-es-node-1] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-02-15T13:08:57,355][INFO ][o.e.n.Node ] [yml-es-node-1] node name [yml-es-node-1], node ID [hqVAcDOdRu-LXuAgUEX9oQ]
[2017-02-15T13:08:57,358][INFO ][o.e.n.Node ] [yml-es-node-1] version[5.2.0], pid[93922], build[24e05b9/2017-01-24T19:52:35.800Z], OS[Mac OS X/10.11.6/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_25/25.25-b02]
[2017-02-15T13:08:58,802][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [aggs-matrix-stats]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [ingest-common]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [lang-expression]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [lang-groovy]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [lang-mustache]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [lang-painless]
[2017-02-15T13:08:58,803][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [percolator]
[2017-02-15T13:08:58,804][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [reindex]
[2017-02-15T13:08:58,804][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [transport-netty3]
[2017-02-15T13:08:58,804][INFO ][o.e.p.PluginsService ] [yml-es-node-1] loaded module [transport-netty4]
[2017-02-15T13:08:58,805][INFO ][o.e.p.PluginsService ] [yml-es-node-1] no plugins loaded
[2017-02-15T13:09:02,610][INFO ][o.e.n.Node ] [yml-es-node-1] initialized
[2017-02-15T13:09:02,610][INFO ][o.e.n.Node ] [yml-es-node-1] starting ...
[2017-02-15T13:09:02,953][INFO ][o.e.t.TransportService ] [yml-es-node-1] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}
[2017-02-15T13:09:06,125][INFO ][o.e.c.s.ClusterService ] [yml-es-node-1] detected_master {yml-es-node-2}{FWhiCkI7TV6hJOlmT_fgQg}{URIaxsK2T0aP7jRRe6TDfg}{127.0.0.1}{127.0.0.1:9301}, added {{yml-es-node-2}{FWhiCkI7TV6hJOlmT_fgQg}{URIaxsK2T0aP7jRRe6TDfg}{127.0.0.1}{127.0.0.1:9301},}, reason: zen-disco-receive(from master [master {yml-es-node-2}{FWhiCkI7TV6hJOlmT_fgQg}{URIaxsK2T0aP7jRRe6TDfg}{127.0.0.1}{127.0.0.1:9301} committed version [385]])
[2017-02-15T13:09:06,175][INFO ][o.e.h.HttpServer ] [yml-es-node-1] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}
[2017-02-15T13:09:06,175][INFO ][o.e.n.Node ] [yml-es-node-1] started
#### node2 ####
deMacBook-Pro:bin yyq$ ./elasticsearch
[2017-02-15T10:31:03,936][INFO ][o.e.n.Node ] [yml-es-node-2] initializing ...
[2017-02-15T10:31:04,087][INFO ][o.e.e.NodeEnvironment ] [yml-es-node-2] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [19.3gb], net total_space [232.6gb], spins? [unknown], types [hfs]
[2017-02-15T10:31:04,087][INFO ][o.e.e.NodeEnvironment ] [yml-es-node-2] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-02-15T10:31:04,104][INFO ][o.e.n.Node ] [yml-es-node-2] node name [yml-es-node-2], node ID [FWhiCkI7TV6hJOlmT_fgQg]
[2017-02-15T10:31:04,112][INFO ][o.e.n.Node ] [yml-es-node-2] version[5.2.0], pid[85158], build[24e05b9/2017-01-24T19:52:35.800Z], OS[Mac OS X/10.11.6/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_25/25.25-b02]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [aggs-matrix-stats]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [ingest-common]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [lang-expression]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [lang-groovy]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [lang-mustache]
[2017-02-15T10:31:05,830][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [lang-painless]
[2017-02-15T10:31:05,831][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [percolator]
[2017-02-15T10:31:05,831][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [reindex]
[2017-02-15T10:31:05,831][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [transport-netty3]
[2017-02-15T10:31:05,831][INFO ][o.e.p.PluginsService ] [yml-es-node-2] loaded module [transport-netty4]
[2017-02-15T10:31:05,832][INFO ][o.e.p.PluginsService ] [yml-es-node-2] no plugins loaded
[2017-02-15T10:31:09,871][INFO ][o.e.n.Node ] [yml-es-node-2] initialized
[2017-02-15T10:31:09,871][INFO ][o.e.n.Node ] [yml-es-node-2] starting ...
[2017-02-15T10:31:10,171][INFO ][o.e.t.TransportService ] [yml-es-node-2] publish_address {127.0.0.1:9301}, bound_addresses {[fe80::1]:9301}, {[::1]:9301}, {127.0.0.1:9301}
[2017-02-15T10:31:13,327][INFO ][o.e.c.s.ClusterService ] [yml-es-node-2] detected_master {yml-es-node-1}{hqVAcDOdRu-LXuAgUEX9oQ}{VrY6MUvhQNetUmbzcRnKMg}{127.0.0.1}{127.0.0.1:9300}, added {{yml-es-node-1}{hqVAcDOdRu-LXuAgUEX9oQ}{VrY6MUvhQNetUmbzcRnKMg}{127.0.0.1}{127.0.0.1:9300},}, reason: zen-disco-receive(from master [master {yml-es-node-1}{hqVAcDOdRu-LXuAgUEX9oQ}{VrY6MUvhQNetUmbzcRnKMg}{127.0.0.1}{127.0.0.1:9300} committed version [223]])
[2017-02-15T10:31:13,388][INFO ][o.e.h.HttpServer ] [yml-es-node-2] publish_address {127.0.0.1:9201}, bound_addresses {[fe80::1]:9201}, {[::1]:9201}, {127.0.0.1:9201}
[2017-02-15T10:31:13,388][INFO ][o.e.n.Node ] [yml-es-node-2] started
deMacBook-Pro:elasticsearch-head-master yyq$ grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100
When I opened the url:http://localhost:9100 and clicked [connect] button, but I'm unable to connect to elasticsearch.
Could anyone help me?
This is the screenshot
In your elasticsearch.yml configuration, you probably have the following setting:
http.port: 9201
This is also visible in your logs:
[...] publish_address {127.0.0.1:9201}, bound_addresses {[fe80::1]:9201}, {[::1]:9201}, {127.0.0.1:9201}
^
|
your HTTP port
So in your elasticsearch-head interface, you need to connect to localhost:9201 not localhost:9200.
UPDATE
You also need to add http.cors.enabled: true in your elasticsearch.yml configuration and restart your ES server
As mentioned in the previous post, to be able to run the head plugin to check the health status of the ElastiSearch cluster, you need to enable the CORS's environmental variables. One way is to mount the config file for ES as described here. Alternatively, you can define the environmental variables directly in your docker-compose as documented in this GitHub issue. I am adding the code below for completeness, which worked for me:
version: '3'
services:
# search engine
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.0.1
container_name: elasticsearch
environment:
- discovery.type=single-node
- http.port=9200
- http.cors.enabled=true
- http.cors.allow-origin=http://localhost:1358,http://127.0.0.1:1358
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
- bootstrap.memory_lock=true
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
ports:
- '9200:9200'
- '9300:9300'
# elasticsearch browser
dejavu:
image: appbaseio/dejavu:3.2.3
container_name: dejavu
ports:
- '1358:1358'
links:
- elasticsearch
Note that using - http.cors.allow-origin=* works and it could be handy for certain development setups.

How to access remotely to elasticsearch 5?

I want to access remotely to my elasticsearch version 5.
I tried to add this line in the elasticseach.yml file as I did with elassticsearch version 4 (which worked):
network.bind_host: 0.0.0.0
However, it doesn't work and elasticsearch displays an error and does not work.
[sagemcom#localhost bin]$ ./elasticsearch
[2016-11-07T12:17:58,432][INFO ][o.e.n.Node ] [] initializing ...
[2016-11-07T12:17:58,564][INFO ][o.e.e.NodeEnvironment ] [NqVMQ-B] using [1] data paths, mounts [[/home (/dev/mapper/centos-home)]], net usable_space [13.5gb], net total_space [23gb], spins? [possibly], types [xfs]
[2016-11-07T12:17:58,565][INFO ][o.e.e.NodeEnvironment ] [NqVMQ-B] heap size [1.9gb], compressed ordinary object pointers [true]
[2016-11-07T12:17:58,574][INFO ][o.e.n.Node ] [NqVMQ-B] node name [NqVMQ-B] derived from node ID; set [node.name] to override
[2016-11-07T12:17:58,577][INFO ][o.e.n.Node ] [NqVMQ-B] version[5.0.0], pid[3400], build[253032b/2016-10-26T04:37:51.531Z], OS[Linux/3.10.0-123.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_73/25.73-b02]
[2016-11-07T12:17:59,776][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [aggs-matrix-stats]
[2016-11-07T12:17:59,776][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [ingest-common]
[2016-11-07T12:17:59,776][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [lang-expression]
[2016-11-07T12:17:59,777][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [lang-groovy]
[2016-11-07T12:17:59,777][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [lang-mustache]
[2016-11-07T12:17:59,777][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [lang-painless]
[2016-11-07T12:17:59,778][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [percolator]
[2016-11-07T12:17:59,779][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [reindex]
[2016-11-07T12:17:59,779][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [transport-netty3]
[2016-11-07T12:17:59,780][INFO ][o.e.p.PluginsService ] [NqVMQ-B] loaded module [transport-netty4]
[2016-11-07T12:17:59,781][INFO ][o.e.p.PluginsService ] [NqVMQ-B] no plugins loaded
[2016-11-07T12:18:03,138][INFO ][o.e.n.Node ] [NqVMQ-B] initialized
[2016-11-07T12:18:03,139][INFO ][o.e.n.Node ] [NqVMQ-B] starting ...
[2016-11-07T12:18:03,349][INFO ][o.e.t.TransportService ] [NqVMQ-B] publish_address {127.0.0.1:9300}, bound_addresses {[::]:9300}
[2016-11-07T12:18:03,355][INFO ][o.e.b.BootstrapCheck ] [NqVMQ-B] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
[2016-11-07T12:18:03,364][INFO ][o.e.n.Node ] [NqVMQ-B] stopping ...
[2016-11-07T12:18:03,402][INFO ][o.e.n.Node ] [NqVMQ-B] stopped
[2016-11-07T12:18:03,402][INFO ][o.e.n.Node ] [NqVMQ-B] closing ...
[2016-11-07T12:18:03,417][INFO ][o.e.n.Node ] [NqVMQ-B] closed
If you look at the error error says
"ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
"
Solve this issue as
Development Mode: If you are running elastic search in development mode we don't need to set the max_map_count. Just run as follows
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:5.6.4
Production Mode: : I f you run in production you need to set the property as below.
Linux
The vm.max_map_count setting should be set permanently in /etc/sysctl.conf:
grep vm.max_map_count /etc/sysctl.conf
vm.max_map_count=262144
OR
sysctl -w vm.max_map_count=262144
Then Accessing it from remote is different case.

Resources