| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Consider myserver1,myserver3,myserver7 are masters and myserver4,myserver2 as salves
on each node of master myserver1,myserver3,myserver7 Ip address of these servers are as follows respectively
| Servername | ip address |
|---|---|
| myserver1 | 10.193.154.120 |
| myserver3 | 10.193.154.122 |
| myserver7 | 10.193.154.140 |
echo 1 > /var/lib/zookeeper/myid
echo '10.193.154.120' > /etc/mesos-master/hostname
echo 3 > /var/lib/zookeeper/myid
echo '10.193.154.122' > /etc/mesos-master/hostname
echo 7 > /var/lib/zookeeper/myid echo '10.193.154.140' > /etc/mesos-master/hostname
/etc/zookeeper/conf/zoo.cfg add this entry to the end of config file
server.1=10.193.154.120:2888:3888
server.3=10.193.154.122:2888:3888
server.7=10.193.154.140:2888:3888
sudo systemctl start zookeeper
echo 'zk://10.193.154.120:2181,10.193.154.122:2181,10.193.154.140:2181/mesos' > /etc/mesos/zk
echo 2 > /etc/mesos-master/quorum
systemctl stop mesos-slave.service
sudo service mesos-master restart
sudo service marathon restart
systemctl disable mesos-master myserver4,myserver2
Suppose you have a gateway server mygatewayserver from where you need to orchestrate your services/micro services
script that automatically loads haproxy.cfg when ever a new micro service is created
to any master say http://myserver7:8080/v2/apps make a post request
{
"id": "hello",
"container": {
"type": "DOCKER",
"docker": {
"image": "cjonagam/helloworld",
"network": "BRIDGE",
"portMappings": [
{ "containerPort": 8080, "hostPort": 0, "servicePort": 8000, "protocol": "tcp" }
]
}
},
"env":
{ "MSG": "chakri" },
"healthChecks": [
{
"protocol": "HTTP",
"portIndex": 0,
"path": "/",
"gracePeriodSeconds": 5,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3
}]
}Now if you make a http get request to mygatewayserver:8000 port you should see hello world
curl http://mygatewayserver:8000
Hello world
Some times slaves do not pick up jobs
you may need to restart docker deamon
rm -f /tmp/mesos/meta/slaves
| Back | FazBrowse Home | New Git URL |