mesos 安装时,marathon 无法启动问题解决

启动marathon 后连接网页http://ip:8080时连接不上,于是输入命令查看marathon运行状态:

]# service marathon status -l
Redirecting to /bin/systemctl status  -l marathon.service
● marathon.service - Scheduler for Apache Mesos
   Loaded: loaded (/usr/lib/systemd/system/marathon.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2018-06-14 19:50:12 CST; 4s ago
  Process: 31178 ExecStart=/usr/share/marathon/bin/marathon (code=exited, status=1/FAILURE)
  Process: 31175 ExecStartPre=/bin/chmod 755 /run/marathon (code=exited, status=0/SUCCESS)
  Process: 31172 ExecStartPre=/bin/chown marathon:marathon /run/marathon (code=exited, status=0/SUCCESS)
  Process: 31170 ExecStartPre=/bin/mkdir -p /run/marathon (code=exited, status=0/SUCCESS)
 Main PID: 31178 (code=exited, status=1/FAILURE)

Jun 14 19:50:12 dev-master-01 systemd[1]: Unit marathon.service entered failed state.
Jun 14 19:50:12 dev-master-01 systemd[1]: marathon.service failed.

好像看不出原因,再输入 journalctl -u marathon

# journalctl -u marathon
-- Logs begin at Thu 2018-06-14 15:55:28 CST, end at Thu 2018-06-14 19:52:34 CST. --
Jun 14 15:55:35 dev-master-01 systemd[1]: marathon.service holdoff time over, scheduling restart.
Jun 14 15:55:35 dev-master-01 systemd[1]: Starting Scheduler for Apache Mesos...
Jun 14 15:55:35 dev-master-01 systemd[1]: Started Scheduler for Apache Mesos.
Jun 14 15:55:35 dev-master-01 marathon[7966]: No start hook file found ($HOOK_MARATHON_START). Proceeding with the start script.
Jun 14 15:55:36 dev-master-01 marathon[7966]: [scallop] Error: Required option 'master' not found
Jun 14 15:55:36 dev-master-01 systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE
Jun 14 15:55:36 dev-master-01 systemd[1]: Unit marathon.service entered failed state.
Jun 14 15:55:36 dev-master-01 systemd[1]: marathon.service failed.
Jun 14 15:56:36 dev-master-01 systemd[1]: marathon.service holdoff time over, scheduling restart.
Jun 14 15:56:36 dev-master-01 systemd[1]: Starting Scheduler for Apache Mesos...
Jun 14 15:56:36 dev-master-01 systemd[1]: Started Scheduler for Apache Mesos.
Jun 14 15:56:36 dev-master-01 marathon[8046]: No start hook file found ($HOOK_MARATHON_START). Proceeding with the start script.
Jun 14 15:56:37 dev-master-01 marathon[8046]: [scallop] Error: Required option 'master' not found
Jun 14 15:56:37 dev-master-01 systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE
Jun 14 15:56:37 dev-master-01 systemd[1]: Unit marathon.service entered failed state.
Jun 14 15:56:37 dev-master-01 systemd[1]: marathon.service failed.

发现是master配置找不到,尝试着给marathon填加mesos的地址参数,在文件/etc/default/marathon中增加如下内容:

MARATHON_MASTER="zk://c1:2181,c2:2181,c3:2181/mesos"
MARATHON_ZK="zk://c1:2181,c2:2181,c3:2181/marathon"
MARATHON_MESOS_USER="root"
保存退出后(记住,里面的c1~cn 根据各自的zookeeper IP地址或主机名设置),重启marathon服务,OK,可以了。

你可能感兴趣的:(docker)