I have created a kubernetes cluster using minikube. created a helm chart of elasticsearch and installed it in the cluster.
I have also passed the environment variables from the chart's deployment file to configure elasticsearch:
env:
- name: ES_JAVA_OPTS
value: -Xms32m -Xmx32m
- name: bootstrap.memory_lock
value: "true"
- name: cluster.name
value: dynizer
- name: discovery.type
value: single-node
- name: network.bind_host
value: 0.0.0.0
- name: transport.host
value: elasticsearch
I have set the container resources as:
limits:
cpu: 100m
memory: 32Mi
requests:
cpu: 100m
memory: 32Mi
The pod is in running state. But the log of the pod displays :
[2018-10-04T09:57:24,790][WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12, reason=Cannot allocate memory
[2018-10-04T09:57:25,091][WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out.
[2018-10-04T09:57:25,092][WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[2018-10-04T09:57:25,092][WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example:
# allow user 'elasticsearch' mlockall
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
[2018-10-04T09:57:25,093][WARN ][o.e.b.JNANatives ] If you are logged in interactively, you will have to re-login for the new limits to take effect.
[2018-10-04T09:58:11,186][INFO ][o.e.n.Node ] [] initializing ...
[2018-10-04T09:58:24,183][INFO ][o.e.e.NodeEnvironment ] [aasoChh] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/sda1)]], net usable_space [58.9gb], net total_space [117.2gb], types [ext4]
[2018-10-04T09:58:24,220][INFO ][o.e.e.NodeEnvironment ] [aasoChh] heap size [30.9mb], compressed ordinary object pointers [true]
[2018-10-04T09:58:24,242][INFO ][o.e.n.Node ] node name [aasoChh] derived from node ID [aasoChh5T_ealf7pgyKqiQ]; set [node.name] to override
[2018-10-04T09:58:24,324][INFO ][o.e.n.Node ] version[6.2.2], pid[1], build[10b1edd/2018-02-16T19:01:30.685723Z], OS[Linux/4.4.0-137-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_161/25.161-b14]
[2018-10-04T09:58:24,590][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, -Djava.io.tmpdir=/tmp/elasticsearch.IFIs4dl0, -XX:+HeapDumpOnOutOfMemoryError, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.cgroups.hierarchy.override=/, -Xms32m, -Xmx32m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config]
[2018-10-04T10:18:52,761][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [aggs-matrix-stats]
[2018-10-04T10:18:53,090][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [analysis-common]
[2018-10-04T10:18:53,148][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [ingest-common]
[2018-10-04T10:18:53,165][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [lang-expression]
[2018-10-04T10:18:53,190][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [lang-mustache]
[2018-10-04T10:18:53,190][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [lang-painless]
[2018-10-04T10:18:53,190][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [mapper-extras]
[2018-10-04T10:18:53,190][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [parent-join]
[2018-10-04T10:18:53,191][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [percolator]
[2018-10-04T10:18:53,192][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [rank-eval]
[2018-10-04T10:18:53,208][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [reindex]
[2018-10-04T10:18:53,208][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [repository-url]
[2018-10-04T10:18:53,209][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [transport-netty4]
[2018-10-04T10:18:53,209][INFO ][o.e.p.PluginsService ] [aasoChh] loaded module [tribe]
[2018-10-04T10:18:53,425][INFO ][o.e.p.PluginsService ] [aasoChh] loaded plugin [ingest-geoip]
[2018-10-04T10:18:53,425][INFO ][o.e.p.PluginsService ] [aasoChh] loaded plugin [ingest-user-agent]
And also curl <ip>:<port>
returns :
curl: (7) Failed to connect to 10.107.2.180 port 9200: Connection refused
where 10.107.2.180 is the clusterIP of the service.
When trying to connect other service to this elasticsearch service, the log says that
`panic: PANIC Can't connect to elastic http://elasticsearch:9200 [health check timeout: Head http://elasticsearch:9200: dial tcp: lookup elasticsearch on 10.96.0.10:53: no such host: no Elasticsearch node available.
Why the service is not available at this port?