# Bootstrapping cluster locally - nodes not finding one another

**URL:** <https://discuss.akka.io/t/bootstrapping-cluster-locally-nodes-not-finding-one-another/9766>\
**Category:** Akka Libraries\
**Tags:** java, akka-cluster, akka-management\
**Created:** [May 15, 2022, 4:25pm UTC](https://discuss.akka.io/t/bootstrapping-cluster-locally-nodes-not-finding-one-another/9766 "2022-05-15T16:25:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AND2797](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/and2797/32/2616_2.png) [@AND2797](https://discuss.akka.io/u/AND2797)\
**Post date:** [May 15, 2022, 4:25pm UTC](https://discuss.akka.io/t/bootstrapping-cluster-locally-nodes-not-finding-one-another/9766/1 "2022-05-15T16:25:49Z")

</div>

I am trying to use akka-management and akka-boostrap to boostrap a cluster. But I’m unable to understand where I’m going wrong after having consulted the documentation several times, most likely I am missing something very obvious.

To start off - my akka-management and boostrap config looks something like this,

```auto
#discovery
akka.discovery {
  config.services = {
    local-cluster = {
      endpoints = [
        {
          host = "10.42.105.131"
          post = 2550
        }
        {
          host = "10.42.105.131"
          port = 2551
        },
        {
          host = "10.42.105.131"
          port = 2552
        }
      ]
    }
  }
}
#discovery

#bootstrap
akka.management {
  cluster.bootstrap {
    contact-point-discovery {
      service-name = "local-cluster"
      discovery-method = config
      required-contact-point-nr = 1
    }
  }
}
#bootstrap

```

Since I am testing locally, the host I assume will be the same, my intention is to start three processes which find each other and form a cluster. As opposed to the static config, my understanding is that the boostrap does not have a “strong leader”, meaning any node can be started up and any node can become leader.

In the main class of my application I have this -

```java
        ActorSystem<SpawnProtocol.Command> system = ActorSystem.create(getRootBehavior(), "local-cluster", config);
        AkkaManagement.get(system).start();
        ClusterBootstrap.get(system).start();
        log.info("Created actor system {}", system.address());

        // Create singleton actors
        createSingletonActors(system, config);

        // Log cluster state from this node
        Cluster cluster = Cluster.get(system);

```

```java
    private static Behavior<SpawnProtocol.Command> getRootBehavior() {
        return Behaviors.setup(context -> {
            // Create an actor that handles cluster domain events
            context.spawn(ClusterListener.create(), "ClusterListener");
            return SpawnProtocol.create();
        });
    }

```

In the logs I see this -  
Node 1

```auto
[] Using self contact point address: http://10.42.105.131:8558
[] Including HTTP management routes for HealthCheckRoutes
[] Initiating bootstrap procedure using config method...
[] Bootstrap using `akka.discovery` method: config
[] Bound Akka Management (HTTP) endpoint to: 10.42.105.131:8558
.
.
.
Located service members based on: [Lookup(local-cluster,None,Some(tcp))]: [ResolvedTarget(10.42.105.131,None,None), ResolvedTarget(10.42.105.131,Some(2551),None), ResolvedTarget(10.42.105.131,Some(2552),None)], filtered to []
[] Discovered [0] contact points, confirmed [0], which is less than the required [1], retrying

```

Almost the exact is printed in Node 2, but there is an exception in binding the Akka Management port -

```auto
[] Bind failed for TCP channel on endpoint [/10.42.105.131:8558]

```

Does each node need to have a separate AkkaManagement port? How do I handle this if I’m starting the nodes on the same machine - not sure if this is the reason why bootstrap is failing
