Failed to connect to IP STATIC port 9200: Connexion refusée


(Abdellkrim) #1

Hi all,
I have this message :"connect to IP STATIC port 9200: Connexion refusée" when I try to connect to Elasticsearch with static ip address in elastecsearch.yml as below:

network.host: 10.10.10.50

but when I put localhost instead of the ip address, it works and I can connect locally:
curl http: // localhost: 9200

Did you have any idea about this issue ?


(David Pilato) #2

Could you share your full elasticsearch logs?

As for elastecsearch.yml I guess you meant elasticsearch.yml, right?


(Abdellkrim) #3

yes sûre.
Elstaicsearch.yml file when is don't work :

---------------------------------- Cluster -----------------------------------

Use a descriptive name for your cluster:

cluster.name: Asa_ELK

------------------------------------ Node ------------------------------------

Use a descriptive name for the node:

node.name: srvl-elk-01

Add custom attributes to the node:

#node.attr.rack: r1

----------------------------------- Paths ------------------------------------

Path to directory where to store the data (separate multiple locations by comma):

path.data: /var/lib/elasticsearch

Path to log files:

path.logs: /var/log/elasticsearch

----------------------------------- Memory -----------------------------------

Lock the memory on startup:

#bootstrap.memory_lock: true

Make sure that the heap size is set to about half the memory available

on the system and that the owner of the process is allowed to use this

limit.

Elasticsearch performs poorly when the system is swapping the memory.

---------------------------------- Network -----------------------------------

Set the bind address to a specific IP (IPv4 or IPv6):

network.host: 10.255.30.50

Set a custom port for HTTP:

http.port: 9200

transport.tcp.port: 9300
transport.bind_host: 10.255.30.50

For more information, consult the network module documentation.

--------------------------------- Discovery ----------------------------------

Pass an initial list of hosts to perform discovery when new node is started:

The default list of hosts is ["127.0.0.1", "[::1]"]

discovery.zen.ping.unicast.hosts: ["10.255.30.51","10.255.30.50"]

Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

discovery.zen.minimum_master_nodes: 1

For more information, consult the zen discovery module documentation.

---------------------------------- Gateway -----------------------------------

Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

For more information, consult the gateway module documentation.

---------------------------------- Various -----------------------------------

Require explicit names when deleting indices:

#action.destructive_requires_name: true
########################################


(Abdellkrim) #4

sorry, I mean elasticsearch.yml config file

Thx


(Abdellkrim) #5

Below the error message when I try to restart the elasticsearch service:

systemctl status elasticsearch.service

● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2018-04-09 16:25:39 CEST; 25min ago
Docs: http://www.elastic.co
Process: 1034 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited,
Main PID: 1034 (code=exited, status=78)

avril 09 16:25:33 SRVL-ELK-01 systemd[1]: Started Elasticsearch.
avril 09 16:25:39 SRVL-ELK-01 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=78/n/a
avril 09 16:25:39 SRVL-ELK-01 systemd[1]: elasticsearch.service: Unit entered failed state.
avril 09 16:25:39 SRVL-ELK-01 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.


(Abdellkrim) #6

For your information, i have 2 machine (VM) in the same subnet: 10.255.30.0/24
and they are clustered : Asa_ELK


(David Pilato) #7

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

Also please share elasticsearch logs. Not the system logs.


(Abdellkrim) #8

Ok, Sorry; it is my first post; I'll try to correct this.
Please find below my elasticsearch.yml config file:

_###  CODE BEGINING  ###_

_ network.host: 10.255.30.50_
_ #_
_ # Set a custom port for HTTP:_
_ #_
_ http.port: 9200_
_ #_
_ transport.tcp.port: 9300_
_ transport.bind_host: 10.255.30.50_
_ discovery.zen.ping.unicast.hosts: ["10.255.30.51","10.255.30.50"] _
_ discovery.zen.minimum_master_nodes: 1_

_ ### CODE END ###_

Could you please indicate me where I can find the elasticsearch logs ?


(David Pilato) #9

Please read carefully the link I pasted and edit your posts.

this is the icon to use:


(Abdellkrim) #10

### Begining of elsaticserch.yml file config :

 path.data: /var/lib/elasticsearch
 path.logs: /var/log/elasticsearch
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 10.255.30.50
#
# Set a custom port for HTTP:
#
http.port: 9200
#
transport.tcp.port: 9300
transport.bind_host: 10.255.30.50
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["10.255.30.51","10.255.30.50"] 
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 1 
#

####### End Of elasticsearch.yml file config ##########################


(David Pilato) #11

Be careful with indentation in yml file.

path.data is not at the same level as other settings.

Also please share elasticsearch logs. The default path for logs depends on how you installed elasticsearch.
The installation guide says where logs are located by default depending on the package.


(Abdellkrim) #12

Thank David for your reply
Please find below the Elasticsearch logs from the test I make it today at 20h07:
I'mobliget to post it on 2 parts for the numbers of characters by post:

[2018-04-09T20:09:04,311][WARN ][o.e.b.Natives            ] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/linux-x86/libjnidispatch.so) not found in resource path ([file:/usr/share/elasticsearch/lib/lucene-misc-7.2.1.jar, file:/usr/share/elasticsearch/lib/lucene-grouping-7.2.1.jar, file:/usr/share/elasticsearch/lib/joda-time-2.9.9.jar, file:/usr/share/elasticsearch/lib/log4j-1.2-api-2.9.1.jar, file:/usr/share/elasticsearch/lib/lucene-analyzers-common-7.2.1.jar, file:/usr/share/elasticsearch/lib/plugin-classloader-6.2.3.jar, file:/usr/share/elasticsearch/lib/lucene-core-7.2.1.jar, file:/usr/share/elasticsearch/lib/log4j-api-2.9.1.jar, file:/usr/share/elasticsearch/lib/lucene-spatial-extras-7.2.1.jar, file:/usr/share/elasticsearch/lib/plugin-cli-6.2.3.jar, file:/usr/share/elasticsearch/lib/lucene-spatial3d-7.2.1.jar, file:/usr/share/elasticsearch/lib/lucene-join-7.2.1.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-smile-2.8.10.jar, file:/usr/share/elasticsearch/lib/snakeyaml-1.17.jar, file:/usr/share/elasticsearch/lib/hppc-0.7.1.jar, file:/usr/share/elasticsearch/lib/jackson-core-2.8.10.jar, file:/usr/share/elasticsearch/lib/lucene-sandbox-7.2.1.jar, file:/usr/share/elasticsearch/lib/lucene-spatial-7.2.1.jar, file:/usr/share/elasticsearch/lib/securesm-1.2.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-cbor-2.8.10.jar, file:/usr/share/elasticsearch/lib/lucene-memory-7.2.1.jar, file:/usr/share/elasticsearch/lib/elasticsearch-launchers-6.2.3.jar, file:/usr/share/elasticsearch/lib/HdrHistogram-2.1.9.jar, file:/usr/share/elasticsearch/lib/t-digest-3.0.jar, file:/usr/share/elasticsearch/lib/lucene-queries-7.2.1.jar, file:/usr/share/elasticsearch/lib/jts-1.13.jar, file:/usr/share/elasticsearch/lib/elasticsearch-6.2.3.jar, file:/usr/share/elasticsearch/lib/log4j-core-2.9.1.jar, file:/usr/share/elasticsearch/lib/lucene-highlighter-7.2.1.jar, file:/usr/share/elasticsearch/lib/elasticsearch-core-6.2.3.jar, file:/usr/share/elasticsearch/lib/lucene-queryparser-7.2.1.jar, file:/usr/share/elasticsearch/lib/jackson-dataformat-yaml-2.8.10.jar, file:/usr/share/elasticsearch/lib/lucene-suggest-7.2.1.jar, file:/usr/share/elasticsearch/lib/elasticsearch-cli-6.2.3.jar, file:/usr/share/elasticsearch/lib/lucene-backward-codecs-7.2.1.jar, file:/usr/share/elasticsearch/lib/spatial4j-0.6.jar, file:/usr/share/elasticsearch/lib/jopt-simple-5.0.2.jar, file:/usr/share/elasticsearch/lib/jna-4.5.1.jar])
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:962) ~[jna-4.5.1.jar:4.5.1 (b0)]
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922) ~[jna-4.5.1.jar:4.5.1 (b0)]
        at com.sun.jna.Native.<clinit>(Native.java:190) ~[jna-4.5.1.jar:4.5.1 (b0)]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_162]
        at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_162]
        at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:104) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-6.2.3.jar:6.2.3]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) [elasticsearch-6.2.3.jar:6.2.3]

(Abdellkrim) #13

Logs suit... :

    [2018-04-09T20:09:04,318][WARN ][o.e.b.Natives            ] cannot check if running as root because JNA is not available
    [2018-04-09T20:09:04,318][WARN ][o.e.b.Natives            ] cannot install system call filter because JNA is not available
    [2018-04-09T20:09:04,319][WARN ][o.e.b.Natives            ] cannot register console handler because JNA is not available
    [2018-04-09T20:09:04,320][WARN ][o.e.b.Natives            ] cannot getrlimit RLIMIT_NPROC because JNA is not available
    [2018-04-09T20:09:04,320][WARN ][o.e.b.Natives            ] cannot getrlimit RLIMIT_AS beacuse JNA is not available
    [2018-04-09T20:09:04,320][WARN ][o.e.b.Natives            ] cannot getrlimit RLIMIT_FSIZE because JNA is not available
    [2018-04-09T20:09:04,484][INFO ][o.e.n.Node               ] [srvl-elk-01] initializing ...
    [2018-04-09T20:09:04,545][INFO ][o.e.e.NodeEnvironment    ] [srvl-elk-01] using [1] data paths, mounts [[/ (/dev/mapper/SRVL--ELK--01--vg-root)]], net usable_space [87.5gb], net total_space [93.7gb], types [ext4]
    [2018-04-09T20:09:04,545][INFO ][o.e.e.NodeEnvironment    ] [srvl-elk-01] heap size [1011.2mb], compressed ordinary object pointers [unknown]
    [2018-04-09T20:09:04,546][INFO ][o.e.n.Node               ] [srvl-elk-01] node name [srvl-elk-01], node ID [nvv-moR7SxaCofkw3gRlYQ]
    [2018-04-09T20:09:04,546][INFO ][o.e.n.Node               ] [srvl-elk-01] version[6.2.3], pid[1676], build[c59ff00/2018-03-13T10:06:29.741383Z], OS[Linux/4.9.0-3-686-pae/i386], JVM[Oracle Corporation/OpenJDK Server VM/1.8.0_162/25.162-b12]
    [2018-04-09T20:09:04,547][INFO ][o.e.n.Node               ] [srvl-elk-01] 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.wA8eCDCL, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch]
    [2018-04-09T20:09:05,370][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [aggs-matrix-stats]
    [2018-04-09T20:09:05,370][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [analysis-common]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [ingest-common]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [lang-expression]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [lang-mustache]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [lang-painless]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [mapper-extras]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [parent-join]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [percolator]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [rank-eval]
    [2018-04-09T20:09:05,371][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [reindex]
    [2018-04-09T20:09:05,372][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [repository-url]
    [2018-04-09T20:09:05,372][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [transport-netty4]
    [2018-04-09T20:09:05,372][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] loaded module [tribe]
    [2018-04-09T20:09:05,372][INFO ][o.e.p.PluginsService     ] [srvl-elk-01] no plugins loaded
    [2018-04-09T20:09:08,393][INFO ][o.e.d.DiscoveryModule    ] [srvl-elk-01] using discovery type [zen]
    [2018-04-09T20:09:09,309][INFO ][o.e.n.Node               ] [srvl-elk-01] initialized
    [2018-04-09T20:09:09,309][INFO ][o.e.n.Node               ] [srvl-elk-01] starting ...
    [2018-04-09T20:09:09,456][INFO ][o.e.t.TransportService   ] [srvl-elk-01] publish_address {10.255.30.50:9300}, bound_addresses {10.255.30.50:9300}
    [2018-04-09T20:09:09,468][INFO ][o.e.b.BootstrapChecks    ] [srvl-elk-01] bound or publishing to a non-loopback address, enforcing bootstrap checks
    [2018-04-09T20:09:09,471][ERROR][o.e.b.Bootstrap          ] [srvl-elk-01] node validation exception
    [1] bootstrap checks failed
    [1]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
    [2018-04-09T20:09:09,473][INFO ][o.e.n.Node               ] [srvl-elk-01] stopping ...
    [2018-04-09T20:09:09,511][INFO ][o.e.n.Node               ] [srvl-elk-01] stopped
    [2018-04-09T20:09:09,512][INFO ][o.e.n.Node               ] [srvl-elk-01] closing ...
    [2018-04-09T20:09:09,522][INFO ][o.e.n.Node               ] [srvl-elk-01] closed

(Abdellkrim) #14

I can see the bootstrap checks failed in the log.
I don't know why the check is failed
Any idea ?
Thanks for your help


(David Pilato) #15

Please read https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html


(Abdellkrim) #16

Thanks David for your help.
I solved this issue by disabling this option in elasticsearch.yml file :
bootstrap.system_call_filter: false
Now It's works for my 3 elsasticsearch servers.

Thanks


(system) closed #17

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.