Menu

ENABLING MESOS LOGGING

Learn the steps necessary to enable Mesos 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)

Conclusion

I hope you have enjoyed this article, if so please leave a comment below.  For more articles, please signup for the AdminTome Blog below.  Also please feel free to share the article to your friends using the buttons to the left.  Thanks again for reading this post.

Signup for the AdminTome Blog Newsletter

Get weekly updates from AdminTome Blog including the latest articles and special content only for subscribers.

privacy We value your privacy and would never spam you

 
Tags:
%d bloggers like this: