Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sample Cleanup: have Akka.Cluster.Sharding sample run on multiple nodes #3608

Closed
Aaronontheweb opened this issue Oct 2, 2018 · 7 comments · Fixed by #7494
Closed

Sample Cleanup: have Akka.Cluster.Sharding sample run on multiple nodes #3608

Aaronontheweb opened this issue Oct 2, 2018 · 7 comments · Fixed by #7494

Comments

@Aaronontheweb
Copy link
Member

We should change
https://github.com/akkadotnet/akka.net/tree/dev/src/examples/Cluster/ClusterSharding/ClusterSharding.Node to have it actually run on multiple nodes instead of just a single node, since that's more illustrative of real-world behavior than the single-node mode it uses right now.

Looks like that can be configured via the SQLite database, but it'd be easier to just discard that and have the code fire up multiple nodes like how it does for other samples.

@shauryapatel27
Copy link

shauryapatel27 commented Nov 22, 2018

Hey, according to what I understand, I just need to change this particular piece of code.

        var members = _dbHelper.GetClusterMembers().ToImmutableList();
        if (members.Any())
        {
            _cluster.JoinSeedNodes(members);
            _dbHelper.AddClusterMember(_cluster.SelfAddress);
        }
        else
        {
            var self = _cluster.SelfAddress;
            _dbHelper.AddClusterMember(self);
            _cluster.JoinSeedNodes(ImmutableList.Create(self));
        }
    }

If so, I'd like to try to take up this issue.

@Aaronontheweb
Copy link
Member Author

@shauryapatel27 you'll need to do that and maybe the Akka.Persistence backend (might be issues with multiple nodes all trying to write to SQLite). But by all means, please go ahead and give it a try!

@shauryapatel27
Copy link

shauryapatel27 commented Nov 22, 2018

If there is no deadline on this then yes I want to try to take this one

@pierrebelin
Copy link

@Aaronontheweb Is this issue still opened ? I can take it if needed

@Aaronontheweb
Copy link
Member Author

@Aaronontheweb Is this issue still opened ? I can take it if needed

It's still open! We would welcome any help we can get here

@pierrebelin
Copy link

@Aaronontheweb Is this issue still opened ? I can take it if needed

It's still open! We would welcome any help we can get here

I'm not sure on the issue. I checked inside the docker-compose, and it seems to have already 3 nodes (node-1, node-2 and node-3). Is it already in multi nodes or did I missed something?
I started it locally, and it seems that there are multiples things to fix:

  1. network_mode “host” is incompatible with port_bindings (cf : Docker forum)
  2. when I start the configuration, nodes are not able to communicate with each others (AssociationError [akka.tcp://sharded-cluster-system@localhost:6057] -> akka.tcp://sharded-cluster-system@localhost:6055: Error [Connection refused tcp://sharded-cluster-system@localhost:6055]). It might comes from the docker compose configuration above.
    Should I just work on this configuration issue or should I also add behavior for nodes?

@Aaronontheweb
Copy link
Member Author

@pierrebelin all yours!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants