My single ElasticSearch node for local access on a VPS is closing down after bootstrap checks

408 Views Asked by At

I'm trying to run ElasticSearch on a VPS, Virtual Private Server. I'm not expecting many simultaneous search requests at this stage so I'm simply trying to run one single node and communicate with it locally inside the VPS using curl(localhost:9200) from PHP. So I imagine that I don't need any 'transport' connection on port 9300 for communication between nodes.

When I first tried to run ElasticSearch out of the box I got the following:

[2017-09-09T14:39:47,682][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9300-9400]]; nested: BindException[Cannot assign requested address];
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:127) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.5.2.jar:5.5.2]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to [9300-9400]
        at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:793) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:758) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:173) ~[?:?]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:69) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.transport.TransportService.doStart(TransportService.java:209) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.common.component.AbstractLifecycleComponent.startAbstractLifecycleComponent.java:69) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.node.Node.start(Node.java:692) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:277) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.5.2.jar:5.5.2]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.5.2.jar:5.5.2]
        ... 6 more
Caused by: java.net.BindException: Cannot assign requested address
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:433) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:425) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:128) ~[?:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:554) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1258) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501) ~[?:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486) ~[?:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:980) ~[?:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:250) ~[?:?]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:365) ~[?:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[?:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[?:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
[2017-09-09T14:39:48,471][INFO ][o.e.n.Node               ] [Ejdd-bH] stopping ...
[2017-09-09T14:39:48,474][INFO ][o.e.n.Node               ] [Ejdd-bH] stopped
[2017-09-09T14:39:48,474][INFO ][o.e.n.Node               ] [Ejdd-bH] closing ...
[2017-09-09T14:39:48,484][INFO ][o.e.n.Node               ] [Ejdd-bH] closed

So I tried setting in elasticsearch.yml

transport.type: local

But then I still got:

[2017-09-09T14:37:49,035][INFO ][o.e.t.TransportService   ] [Ejdd-bH] publish_address {local[1]}, bound_addresses {local[1]}
[2017-09-09T14:37:49,045][INFO ][o.e.b.BootstrapChecks    ] [Ejdd-bH] bound or publishing to a non-loopback or non-link-local 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]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2017-09-09T14:37:49,054][INFO ][o.e.n.Node               ] [Ejdd-bH] stopping ...
[2017-09-09T14:37:49,059][INFO ][o.e.n.Node               ] [Ejdd-bH] stopped
[2017-09-09T14:37:49,060][INFO ][o.e.n.Node               ] [Ejdd-bH] closing ...
[2017-09-09T14:37:49,072][INFO ][o.e.n.Node               ] [Ejdd-bH] closed

I can't change the setting for vm.max_map_count since that requires root access which I don't have on a VPS. But why is it saying "non-loopback or non-link-local address"? Is it because I am on a VPS instead of a dedicated server? I guess that it's not complaining about the transport which is solved. I guess that it's complaining about the 9200 that I need in order to build and search the index. Is there anything I can do?

I tried adding to elasticsearch.yml

http.host: localhost
network.host: localhost
transport.host: localhost
http.bind_host: localhost
http.publish_host: localhost

but those didn't cause any change.

Then for research purposes I tried

http.enabled: false

but even that didn't change anything; it still shut down with the same messages.

0

There are 0 best solutions below