1

I have setup mesos and marathon on my local itself. Now, when I begin to start-up mesos master and slave, I get a lot of logs and they seem to start up because I am able to access the web-page http:localhost:5050, but when I start marathon, it gives me this error: Failed to start a local cluster while loading agent flags from the environment: Flag 'work_dir' is required, but it was not provided. Though I start the mesos-agent and mesos-slave using the following command,

sudo ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos

and sudo ./bin/mesos-agent.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos

I am not sure where else do I have to configure this flag? Also, one peculiar thing that I see while starting my mesos master is this: Master bound to loopback interface! Cannot communicate with remote schedulers or agents. You might want to set '--ip' flag to a routable IP address.

I am not really sure why I am getting this? Any clues? Thanks!

John Dui
  • 541
  • 3
  • 8
  • 15

2 Answers2

1

Top views of Mesos architecture has Zookeeper component manages master and slave nodes. Agent and Master nodes cannot communication because agent not specifies IP address to Zookeeper service. In command line try to run slave node in the same master machine. Change IP(Not localhost and 127.0.0.1) and Port slave node. Command line of the slave node.

$sudo ./bin/mesos-agent.sh --master=127.0.0.1:5050 --work_dir=/var/lib/mesos

Instead of

$ip addr
   2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 
   net **IPAddr**/24 brd  scope global dynamic eno1 

$sudo ./bin/mesos-agent.sh --master=IPAddr:MasterNodePort --ip=IPAddr --port SlaveNodePort --work_dir=/var/lib/mesos

Support the idea run master and slave nodes in the same machine read at here.

R.Chatsiri
  • 107
  • 2
  • 11
0

You should set the --ip flag's ip address to a routable address, as the error message says. The actual ip address to use strongly depends on you networking setting.

For example, if you're using en0 a network interface, you can do the following:

$ ifconfig en0 inet                                                                                                                          
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet 192.168.0.105 netmask 0xffffff00 broadcast 192.168.0.255

The ip address 192.168.0.105 would then the the ip to use:

sudo ./bin/mesos-master.sh --ip=192.168.0.105 --work_dir=/var/lib/mesos
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • will this need to be done even if I am running it on my local machine? Won't it be just 127.0.0.1 in that case? Because, I checked my /etc/hosts file and it contains localhost against 127.0.0.1. – John Dui Sep 27 '16 at 03:10