Hello
Preface
Couple day ago I've asked a question here about possible design for setting
AKKA cluster in Docker swarm environment.
The main open questions for us is how to discover seed nodes when new
container is starting or service is scaled, because Docker assign random
internal IPs for each container.
As far as I've seen from the reply and after skimming over similar Google
results - current approach is to use some service registry like Consul /
Etcd / Zookeeper and take seed nodes IP from there.
Since Docker Swarm provides own means for service discovery, we'd like to
design approach that will not involve 3rd party service discovery like
Consul.
After some thinking about it I'd like to share our vision and get some
feedback on it.
A Docker Swarm background first.
Cluster consists of *manager *and *workers *nodes, where managers maintain
consistent internal state using raft implementation of the entire swarm and
all the services running on it.
And workers are used for running container and workers nodes discover each
other using gossip.
There also two types of *service*
- *replicated *services - the swarm manager distributes a specific
number of replica tasks among the nodes based upon the scale you set in the
desired state.
- *global *services - the swarm runs one task for the service on every
available node in the cluster.
Docker Swarm uses service discovery / load balancing based on symbolic
service name.
Design
1. Let's assume we have a stateful AKKA service named *wallet* that is
going to be sharded, so we'd like to leverage AKKA cluster functionality.
2. The service is run inside Docker container in Docker Swarm, AKKA
service is a Docker Swarm service, i.e can be scaled over multiple nodes,
service can be discovered within cluster by its name *wallet.*
3. To make seed nodes discovery possible we propose to introduce new
dummy service *wallet-seed *and make this service *global*, i.e. docker
swarm will run instance of this service on each node.
4. Additionally we can restrict deployment of wallet-seed only to
manager nodes.
5. Doing as explained above allows us to ensure that *wallet-seed* is
strongly available and run on each of manager of Docker Swarm cluster.
6. So when starting up, *wallet *service will use symbolic name
*wallet-seed* as a seed node address to join to.
7. *wallet *may be launched on any Swarm node, either worker or manager.
8. Due to Docker Swarm internal load balancing, *wallet-seed* will be
resolved to one of the available container instances.
Please keep in mind that this is a only initial proposal and the main goal
is just to implement smth without using consul / etcd.
We will be appreciated for any feedback.
--
>> Read the docs: http://akka.io/docs/
>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.