How to configure client & elasticsearch when machine has no internet access (no IP address)

Hi,

I have configured ES (server) and client with ("network.host") to be able
to work on a machine without internet access (no ip address) but that fails

2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: initialized
2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: starting ...
2013-08-08 16:01:40,316 [main ] INFO transport

  • [Quasimodo] bound_address {inet[/127.0.0.1:9301]}, publish_address
    {inet[/127.0.0.1:9301]}
    2013-08-08 16:02:10,330 [main ] WARN discovery
  • [Quasimodo] waited for 30s and no initial state was set by the
    discovery
    2013-08-08 16:02:10,330 [main ] INFO discovery
  • [Quasimodo] KARAF/BM2IA3HFRkmvIhbSM-lYNQ
    2013-08-08 16:02:10,337 [main ] INFO http
  • [Quasimodo] bound_address {inet[/127.0.0.1:9201]}, publish_address
    {inet[/127.0.0.1:9201]}
    2013-08-08 16:02:10,337 [main ] INFO node
  • [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: started
    Exception in thread "main"
    org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m]
    at
    org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)
    at
    org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:377)
    at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

Client

    // Configure Node Instance (= Client)
    NodeBuilder builder = nodeBuilder()
            .local(false)
            .data(false)
            .client(true)
            .clusterName("KARAF");

    Settings settings = settingsBuilder()
            .put("network.host", "127.0.0.1")
            .build();

    builder.settings(settings);

    // Get the Node and start it
    Node node = builder.node();

    Client client = node.client();

Server

    String settingsSource = getClass().getName().replace('.', '/') + 

".yml";
Settings finalSettings = settingsBuilder()
.loadFromClasspath(settingsSource)
//.put(defaultSettings)
//.put(settings)
//.put("cluster.name", "test-cluster-" +
NetworkUtils.getLocalAddress().getHostName())
.put("cluster.name","KARAF")
.put("http.enabled", "true")
.put("node.data", true)
.put("path.data", DEFAULT_DATA_DIRECTORY)
.put("path.plugins",pluginDir.getAbsolutePath())
.put("name", id)
.put("discovery.type", "zen")
.put("discovery.zen.multicast.enabled", false)
.put("discovery.zen.ping.unicast.enabled", true)
.put("discovery.zen.unicast.hosts", "127.0.0.1")
.put("network.host","127.0.0.1")
.build();

    if (finalSettings.get("gateway.type") == null) {
        // default to non gateway
        finalSettings = 

settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
}

    if (finalSettings.get("cluster.routing.schedule") != null) {
        // decrease the routing schedule so new nodes will be added 

quickly
finalSettings =
settingsBuilder().put(finalSettings).put("cluster.routing.schedule",
"50ms").build();
}

    Node node = nodeBuilder()
            .settings(finalSettings)
            .local(false)
            .build();

What should be the config in that case ?

Regards,

Charles

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Does it have a network adapter at all? You might need to install a loop
back adapter so that you've got a network adapter to bind to 127.0.0.1
(I've not done this with ES, but I have had to do this with other software
on a machine with no network card).

On Thursday, August 8, 2013 3:06:16 PM UTC+1, Charles Moulliard wrote:

Hi,

I have configured ES (server) and client with ("network.host") to be able
to work on a machine without internet access (no ip address) but that fails

2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: initialized
2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: starting ...
2013-08-08 16:01:40,316 [main ] INFO transport
- [Quasimodo] bound_address {inet[/127.0.0.1:9301]}, publish_address
{inet[/127.0.0.1:9301]}
2013-08-08 16:02:10,330 [main ] WARN discovery
- [Quasimodo] waited for 30s and no initial state was set by the
discovery
2013-08-08 16:02:10,330 [main ] INFO discovery
- [Quasimodo] KARAF/BM2IA3HFRkmvIhbSM-lYNQ
2013-08-08 16:02:10,337 [main ] INFO http
- [Quasimodo] bound_address {inet[/127.0.0.1:9201]}, publish_address
{inet[/127.0.0.1:9201]}
2013-08-08 16:02:10,337 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: started
Exception in thread "main"
org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m]
at
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)
at
org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:377)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Client

    // Configure Node Instance (= Client)
    NodeBuilder builder = nodeBuilder()
            .local(false)
            .data(false)
            .client(true)
            .clusterName("KARAF");

    Settings settings = settingsBuilder()
            .put("network.host", "127.0.0.1")
            .build();

    builder.settings(settings);

    // Get the Node and start it
    Node node = builder.node();

    Client client = node.client();

Server

    String settingsSource = getClass().getName().replace('.', '/') + 

".yml";
Settings finalSettings = settingsBuilder()
.loadFromClasspath(settingsSource)
//.put(defaultSettings)
//.put(settings)
//.put("cluster.name", "test-cluster-" +
NetworkUtils.getLocalAddress().getHostName())
.put("cluster.name","KARAF")
.put("http.enabled", "true")
.put("node.data", true)
.put("path.data", DEFAULT_DATA_DIRECTORY)
.put("path.plugins",pluginDir.getAbsolutePath())
.put("name", id)
.put("discovery.type", "zen")
.put("discovery.zen.multicast.enabled", false)
.put("discovery.zen.ping.unicast.enabled", true)
.put("discovery.zen.unicast.hosts", "127.0.0.1")
.put("network.host","127.0.0.1")
.build();

    if (finalSettings.get("gateway.type") == null) {
        // default to non gateway
        finalSettings = 

settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
}

    if (finalSettings.get("cluster.routing.schedule") != null) {
        // decrease the routing schedule so new nodes will be added 

quickly
finalSettings =
settingsBuilder().put(finalSettings).put("cluster.routing.schedule",
"50ms").build();
}

    Node node = nodeBuilder()
            .settings(finalSettings)
            .local(false)
            .build();

What should be the config in that case ?

Regards,

Charles

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

lo0 is defined by default on MacBook

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128

& more /etc/hosts contains a mapping

127.0.0.1 localhost

On Thursday, August 8, 2013 4:06:16 PM UTC+2, Charles Moulliard wrote:

Hi,

I have configured ES (server) and client with ("network.host") to be able
to work on a machine without internet access (no ip address) but that fails

2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: initialized
2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: starting ...
2013-08-08 16:01:40,316 [main ] INFO transport
- [Quasimodo] bound_address {inet[/127.0.0.1:9301]}, publish_address
{inet[/127.0.0.1:9301]}
2013-08-08 16:02:10,330 [main ] WARN discovery
- [Quasimodo] waited for 30s and no initial state was set by the
discovery
2013-08-08 16:02:10,330 [main ] INFO discovery
- [Quasimodo] KARAF/BM2IA3HFRkmvIhbSM-lYNQ
2013-08-08 16:02:10,337 [main ] INFO http
- [Quasimodo] bound_address {inet[/127.0.0.1:9201]}, publish_address
{inet[/127.0.0.1:9201]}
2013-08-08 16:02:10,337 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: started
Exception in thread "main"
org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m]
at
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)
at
org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:377)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Client

    // Configure Node Instance (= Client)
    NodeBuilder builder = nodeBuilder()
            .local(false)
            .data(false)
            .client(true)
            .clusterName("KARAF");

    Settings settings = settingsBuilder()
            .put("network.host", "127.0.0.1")
            .build();

    builder.settings(settings);

    // Get the Node and start it
    Node node = builder.node();

    Client client = node.client();

Server

    String settingsSource = getClass().getName().replace('.', '/') + 

".yml";
Settings finalSettings = settingsBuilder()
.loadFromClasspath(settingsSource)
//.put(defaultSettings)
//.put(settings)
//.put("cluster.name", "test-cluster-" +
NetworkUtils.getLocalAddress().getHostName())
.put("cluster.name","KARAF")
.put("http.enabled", "true")
.put("node.data", true)
.put("path.data", DEFAULT_DATA_DIRECTORY)
.put("path.plugins",pluginDir.getAbsolutePath())
.put("name", id)
.put("discovery.type", "zen")
.put("discovery.zen.multicast.enabled", false)
.put("discovery.zen.ping.unicast.enabled", true)
.put("discovery.zen.unicast.hosts", "127.0.0.1")
.put("network.host","127.0.0.1")
.build();

    if (finalSettings.get("gateway.type") == null) {
        // default to non gateway
        finalSettings = 

settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
}

    if (finalSettings.get("cluster.routing.schedule") != null) {
        // decrease the routing schedule so new nodes will be added 

quickly
finalSettings =
settingsBuilder().put(finalSettings).put("cluster.routing.schedule",
"50ms").build();
}

    Node node = nodeBuilder()
            .settings(finalSettings)
            .local(false)
            .build();

What should be the config in that case ?

Regards,

Charles

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

If there is a lo0 interface, why does that not work ? Do we have to modify
NettyTransport code of ES ?

On Thursday, August 8, 2013 4:06:16 PM UTC+2, Charles Moulliard wrote:

Hi,

I have configured ES (server) and client with ("network.host") to be able
to work on a machine without internet access (no ip address) but that fails

2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: initialized
2013-08-08 16:01:40,255 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: starting ...
2013-08-08 16:01:40,316 [main ] INFO transport
- [Quasimodo] bound_address {inet[/127.0.0.1:9301]}, publish_address
{inet[/127.0.0.1:9301]}
2013-08-08 16:02:10,330 [main ] WARN discovery
- [Quasimodo] waited for 30s and no initial state was set by the
discovery
2013-08-08 16:02:10,330 [main ] INFO discovery
- [Quasimodo] KARAF/BM2IA3HFRkmvIhbSM-lYNQ
2013-08-08 16:02:10,337 [main ] INFO http
- [Quasimodo] bound_address {inet[/127.0.0.1:9201]}, publish_address
{inet[/127.0.0.1:9201]}
2013-08-08 16:02:10,337 [main ] INFO node
- [Quasimodo] {1.0.0.Beta1-SNAPSHOT}[33733]: started
Exception in thread "main"
org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [1m]
at
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:169)
at
org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:377)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

Client

    // Configure Node Instance (= Client)
    NodeBuilder builder = nodeBuilder()
            .local(false)
            .data(false)
            .client(true)
            .clusterName("KARAF");

    Settings settings = settingsBuilder()
            .put("network.host", "127.0.0.1")
            .build();

    builder.settings(settings);

    // Get the Node and start it
    Node node = builder.node();

    Client client = node.client();

Server

    String settingsSource = getClass().getName().replace('.', '/') + 

".yml";
Settings finalSettings = settingsBuilder()
.loadFromClasspath(settingsSource)
//.put(defaultSettings)
//.put(settings)
//.put("cluster.name", "test-cluster-" +
NetworkUtils.getLocalAddress().getHostName())
.put("cluster.name","KARAF")
.put("http.enabled", "true")
.put("node.data", true)
.put("path.data", DEFAULT_DATA_DIRECTORY)
.put("path.plugins",pluginDir.getAbsolutePath())
.put("name", id)
.put("discovery.type", "zen")
.put("discovery.zen.multicast.enabled", false)
.put("discovery.zen.ping.unicast.enabled", true)
.put("discovery.zen.unicast.hosts", "127.0.0.1")
.put("network.host","127.0.0.1")
.build();

    if (finalSettings.get("gateway.type") == null) {
        // default to non gateway
        finalSettings = 

settingsBuilder().put(finalSettings).put("gateway.type", "none").build();
}

    if (finalSettings.get("cluster.routing.schedule") != null) {
        // decrease the routing schedule so new nodes will be added 

quickly
finalSettings =
settingsBuilder().put(finalSettings).put("cluster.routing.schedule",
"50ms").build();
}

    Node node = nodeBuilder()
            .settings(finalSettings)
            .local(false)
            .build();

What should be the config in that case ?

Regards,

Charles

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.