jeygeethan / docker-zookeeper-cluster Goto Github PK
View Code? Open in Web Editor NEWA simple zookeeper cluster using docker images. Use for multi-host containers
License: MIT License
A simple zookeeper cluster using docker images. Use for multi-host containers
License: MIT License
I don't see a way to run this on AWS Container Service in a single cluster (with, for example, 3 EC2 instances). This is because each cluster has to use a single Container definition (docker run...), and I need to pass a variable to docker run that is different for each EC2 instance in my cluster. In other words, I think I need 3x AWS clusters, each with a single EC2 instance and slightly different Container definition setup.
I don't suppose you've tried this? Or come up with a solution?
What about running zookeeper inside container as non-root user? Could be a best practice for security/resources reason
All three service bind same ports on host, after removing the host port mapping part i got the output of first service
[
{
"ID": "nxlr74hsfa0hk294ctqbkciuq",
"Version": {
"Index": 2163
},
"CreatedAt": "2017-10-14T15:58:38.563057069Z",
"UpdatedAt": "2017-10-14T15:58:38.565532275Z",
"Spec": {
"Name": "zk-cluster_zk_1",
"Labels": {
"com.docker.stack.image": "jeygeethan/zookeeper-cluster",
"com.docker.stack.namespace": "zk-cluster"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "jeygeethan/zookeeper-cluster:latest@sha256:55d24058d87df2a83e9543bd248facdb0668a769c1c9649594be0adbbfa09b5c",
"Labels": {
"com.docker.stack.namespace": "zk-cluster"
},
"Args": [
"docker_host_1,docker_host_2,docker_host_3",
"1"
],
"Env": [
"constraint:node==docker_host_1"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/var/lib/zookeeper",
"Target": "/var/lib/zookeeper"
},
{
"Type": "bind",
"Source": "/var/log/zookeeper",
"Target": "/var/log/zookeeper"
}
],
"StopGracePeriod": 10000000000,
"DNSConfig": {}
},
"Resources": {},
"RestartPolicy": {
"Condition": "any",
"Delay": 5000000000,
"MaxAttempts": 0
},
"Placement": {
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
}
]
},
"Networks": [
{
"Target": "l4qrtzf6c2ar5648bxwwiw4qw",
"Aliases": [
"zk_1"
]
}
],
"ForceUpdate": 0,
"Runtime": "container"
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"RollbackConfig": {
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 2181,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 2888,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 3888,
"PublishMode": "ingress"
}
]
}
},
"Endpoint": {
"Spec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 2181,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 2888,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 3888,
"PublishMode": "ingress"
}
]
},
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 2181,
"PublishedPort": 30000,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 2888,
"PublishedPort": 30001,
"PublishMode": "ingress"
},
{
"Protocol": "tcp",
"TargetPort": 3888,
"PublishedPort": 30002,
"PublishMode": "ingress"
}
],
"VirtualIPs": [
{
"NetworkID": "xqg1illhhwj4ht2th2wnaof7u",
"Addr": "10.255.0.4/16"
},
{
"NetworkID": "l4qrtzf6c2ar5648bxwwiw4qw",
"Addr": "10.0.1.3/24"
}
]
}
}
]
but no container open
docker service ls
ID NAME MODE REPLICAS IMAGE PORTS nxlr74hsfa0h zk-cluster_zk_1 replicated 0/1 jeygeethan/zookeeper-cluster:latest *:30000->2181/tcp,*:30001->2888/tcp,*:30002->3888/tcp lseqgdkfks3l zk-cluster_zk_2 replicated 0/1 jeygeethan/zookeeper-cluster:latest *:30003->2181/tcp,*:30004->2888/tcp,*:30005->3888/tcp fo08fx9cfo7g zk-cluster_zk_3 replicated 0/1 jeygeethan/zookeeper-cluster:latest *:2181->2181/tcp,*:2888->2888/tcp,*:3888->3888/tcp
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.