docker - How do I enable monitoring and logging for my containers on Bluemix? -
i created first containers on bluemix. pleased how easy create them both through gui , cli. need debugging, went monitoring , logging page app container in bluemix ui have @ logs , discovered need enable monitoring , logging. followed link instructions , scrolled through them quickly. overwhelming. step 1 "log in container or vm root user", there no guidance how container. need build image ssh daemon running? if so, how? need provide ssh key when run container? if so, how? there related question remains unanswered: unable connect through ssh key bluemix container assistance appreciated.
both of default containers provided part of service have ssh enabled. when launching these containers bluemix ui, there input fields on bottom right expose port (expose port 22 ssh) , paste in ssh public key. make sure paste in starts ssh-rsa , ends either == or email address. you'll need assign public ip address.
if you're providing own container, here's link found dockerfile enabling ssh, or there containers in dockerhub ssh enabled.
https://docs.docker.com/examples/running_ssh_service/
once have ssh enabled, follow documentation @ link pasted in other answer: https://www.ng.bluemix.net/docs/manageapps/index-gentopic5.html enable logging. if using 1 of container images provided bluemix service, can skip steps 2 , 3 under "configuring log collection" done you.
the last step enable logging needs added instructions configure logging component installed in step 1 run supervisor, installed default in bluemix provided containers.
you by:
vi /etc/supervisor/conf.d/mt-logstash-forwarder.conf
and paste in following:
[program:mt-logstash-forwarder] command=/opt/mt-logstash-forwarder/bin/run-container-lsf.sh stdout_logfile=/var/log/mt-logstash-forwarder.log stderr_logfile=/var/log/mt-logstash-forwarder.log autorestart=true
then either restart container, or start mt-logstash-forwarder in running container running:
supervisorctl reread supervisorctl update
if providing own container, you'll need make sure supervisord installed in container , you'll need run steps 1 , 2 in instructions (you can't skip step 2 can bluemix provided containers), steps create /etc/supervisor/conf.d/mt-logstash-forwarder.conf same.
finally, instructions state in note under step 3, syslog monitored, can follow instructions create additional conf files allow collection of log files wish.
Comments
Post a Comment