ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » auto start of MQ in Docker container not working

Post new topic  Reply to topic
 auto start of MQ in Docker container not working « View previous topic :: View next topic » 
Author Message
pcelari
PostPosted: Thu Feb 16, 2017 10:21 pm    Post subject: auto start of MQ in Docker container not working Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

Hello,

while experimenting MQ in docker container, generally successful, I have been unable to get the QMGR start upon start of the container.

With a qmgr QMGR setup in the docker image with listener at port 1414, the qmgr simply will not start despite I instructed the Dockerfile to start the qmgr with the following instructions:

FROM mq:9.0
CMD /opt/mqm/bin/strmqm QMGR

or

CMD ["/opt/mqm/bin/strmqm QMGR"]

or

CMD ["/opt/mqm/bin/strmqm", "QMGR"]

But none of the above works - the qmgr is not not running upon start of the container. So, I'm really lost! Has anyone been successful in getting the qmgr running at start of a container?

Any insight would be greatly appreciated.

-p
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Feb 17, 2017 12:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20695
Location: LI,NY

you did not specify which version of MQ...
What if you source the MQ environment in your script before running the start queue manager command ?. What is the userid you are trying to run this script under?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Feb 17, 2017 4:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
you did not specify which version of MQ...

pcelari wrote:
FROM mq:9.0

fjb_saper wrote:
What if you source the MQ environment in your script before running the start queue manager command ?.


I don't know if the mq:9 docker image already does this,but it doesn't hurt to put
Code:
RUN[". /opt/mqm/bin/setmqenv <setmqinst options>"]

before your CMD
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
pcelari
PostPosted: Fri Feb 17, 2017 9:21 pm    Post subject: Reply with quote

Chevalier

Joined: 31 Mar 2006
Posts: 411
Location: New York

thanks for the input!

The way I build the base image mq:9.0 was by manually installing MQ v9 inside a running Ubuntu container, performing the sourcing, create the gm QMGR. I then then commit the container into the image mq:9.0

when the base container mq:9.0 starts, the qm QMGR can be started manually with the normal command "strmqm QMGR". so the sourcing step is already complete.

QMGR starts fine if I run the strmqm command manually by either mqm or root

The build command output says "successfully build". Just the QMGR doesn't start upon container start. Since there seems to be no error from MQ side, there isn't any entry indicating any cause.
_________________
pcelari
-----------------------------------------
- a master of always being a newbie
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Feb 20, 2017 4:48 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Change your CMD to an ENTRYPOINT ?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
dextermbmq
PostPosted: Tue Oct 16, 2018 4:29 am    Post subject: Reply with quote

Voyager

Joined: 26 Jul 2014
Posts: 77

Updating a old thread.

I was doing the same in Ubuntu container with similar approach. Create a container from Ubuntu image -->Install IBM MQ and create a queue manager --->Commit the container to create a new Image.

Achieving a scenario where the Queue Manager is automatically started can be achieved by pointing ENTRYPOINT to a shell script that starts the queue manager or configures it in whatever way needed.

Dockerfile
----------------------
From <IMAGE>
COPY *.sh /usr/local/bin
COPY *.mqsc /usr/local/bin
RUN chmod +x /usr/local/bin/*.sh
RUN chmod +x /usr/local/bin/*.mqsc
RUN usermod -a -G mqm root
ENTRYPOINT ["/usr/local/bin/mq.sh"]

mq.sh
------------
#!/bin/bash
set -e
strmqm TEST
runmqsc TEST < /usr/local/bin/createmqobj.mqsc
exec "$@"

I have to add the root to mqm group in order to enable the queue manager start else it will give authorization error
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Tue Oct 16, 2018 4:07 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2491
Location: Melbourne, Australia

Quote:
I have to add the root to mqm group in order to enable the queue manager start else it will give authorization error

root should never be in the mqm group. This can cause issues if root starts a qmgr.
To run strmqm from root, use su - mqm -c strmqm .....
_________________
Glenn
Back to top
View user's profile Send private message
dextermbmq
PostPosted: Sat Oct 20, 2018 8:34 am    Post subject: Reply with quote

Voyager

Joined: 26 Jul 2014
Posts: 77

Thanks for correcting me. I agree that root should never be a part of mqm.

Moreover, in all ideal scenarios we should not even run the container with root user. It should be something like :

Run the container with a non root user--->Configure the ENTRYPOINT script to execute the MQ specific commands with mqm user.
Back to top
View user's profile Send private message
dextermbmq
PostPosted: Fri Nov 09, 2018 7:27 am    Post subject: Reply with quote

Voyager

Joined: 26 Jul 2014
Posts: 77

Hi Guys,

To clarify, does anyone know if its mandatory for us to use the IBM Provided dockerfiles and related scripts for MQ image creation (process given by IBM here : https://github.com/ibm-messaging/mq-container). Does IBM provide support only to those MQ Images created with this approach ? OR we can have an MQ image using the procedure being followed in this thread and still get support from IBM for any runtime issues with MQ.

Just getting a feel that the process explained in the link https://github.com/ibm-messaging/mq-container may not be easy for someone with less scripting knowledge.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » auto start of MQ in Docker container not working
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.