Enabling Mesos Logging

By Bill Ward | April 8, 2017

Learn the steps necessary to enable logging on your mesos masters and slaves. This post is a precursor to passing those logs to Logstash.

This post assumes that you already have Mesos installed and configured. If you don’t then see my article CONFIGURING A MESOS/MARATHON CLUSTER ON UBUNTU 16.04.

Enable logging

We are going to be adding the “‘–cluster=admintome –log_dir=/var/log/mesos”’ option to our mesos execution.

Mesos Masters

Update the /etc/systemd/system/mesos-master.service systemd service file

[Unit]
Description=Mesos Master Service
After=zookeeper.service
Requires=zookeeper.service

[Service]
ExecStart=/usr/local/sbin/mesos-master --ip=192.168.1.20 --work_dir=/var/lib/mesos --zk=zk://192.18.1.20:2181,192.168.1.21:2181,192.168.1.22:2181/mesos --quorum=2  --cluster=admintome --log_dir=/var/log/mesos

[Install]
WantedBy=multi-user.target

Restart your mesos-master service

systemctl restart mesos-master.service

Mesos Slaves

”’ [Unit] Description=Mesos Slave Service

[Service] ExecStart=/usr/local/sbin/mesos-slave –master=zk://192.168.1.20:2181,192.168.1.21:2181,192.168.1.22:2181/mesos –work_dir=/var/lib/mesos3 –containerizers=docker,mesos –executor_registration_timeout=5mins

[Install] WantedBy=multi-user.target “’

Restart your mesos-slave service

systemctl restart mesos-slave.service

Viewing logs

You can now see the logs in the /var/log/mesos/ directory.

Conclusion

Now that you have logging enabled for mesos, send them to Logstash by following my article Sending mesos logs to Elasticsearch Logstash Kibana (ELK stack)

Subscribe to our mailing list

indicates required
Email Format

comments powered by Disqus
Google Analytics Alternative