|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| IBM MQ Docker Image not working with Kubernetes | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | MQ_AGENT | 
			  
				|  Posted: Fri Jan 04, 2019 7:19 am    Post subject: IBM MQ Docker Image not working with Kubernetes |   |  |  
		  | Newbie
 
 
 Joined: 05 Feb 2016Posts: 7
 
 
 | 
			  
				| Hey all.. 
 I intend to run the IBM provide MQ Docker Image at below path
 through Kubernetes.
 
 https://hub.docker.com/r/ibmcom/mq/
 
 I have my Kubernetes Cluster setup with 1 Master and 2 Worker Nodes on Amazon Linux Machines in my AWS Account. The Kubernetes POD with MQ Container gets deployed without any errors. The thing is when I deploy my MQ POD I can't run MQ commands within the container :
 
 Below is the error after I exec into my MQ Container :
 
 [ec2-user@ip-172-31-83-249 ~]$ docker exec -it 2265faa9da06 /bin/bash
 (mq:9.1.1.0)root@podnate:/# dspmq
 2 - 'No such file or directory' from /var/mqm/mqs.ini
 (mq:9.1.1.0)root@podnate:/#
 (mq:9.1.1.0)root@podnate:/# dspmqver
 AMQ7047E: An unexpected error was encountered by a command. Reason code is 0.
 (mq:9.1.1.0)root@podnate:/#
 (mq:9.1.1.0)root@podnate:/# su - mqm
 No directory, logging in with HOME=/
 $ dspmqver
 AMQ7047E: An unexpected error was encountered by a command. Reason code is 0.
 $
 $ dspmq
 2 - 'No such file or directory' from /var/mqm/mqs.ini
 $
 $ ls -rlt /var/mqm
 lrwxrwxrwx 1 root root 13 Dec 10 11:13 /var/mqm -> /mnt/mqm/data
 $
 $ ls -rlt /mnt/mqm/data
 ls: cannot access '/mnt/mqm/data': No such file or directory
 $
 
 
 Below is my Pod Definition yaml file :
 
 apiVersion: v1
 kind: Pod
 metadata:
 name: podnate
 labels:
 purpose: demonstrate-envars
 spec:
 containers:
 - name: mymqimage
 image: ibmcom/mq:latest
 imagePullPolicy: IfNotPresent
 env:
 - name: LICENSE
 value: "accept"
 - name: MQ_QMGR_NAME
 value: "HELLO"
 command: [ "/bin/bash", "-c", "--" ]
 args: [ "while true; do sleep 30; done;" ]
 |  |  
		  | Back to top |  |  
		  |  |  
		  | fjb_saper | 
			  
				|  Posted: Fri Jan 04, 2019 10:25 pm    Post subject: |   |  |  
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| Obviously you need to have /opt/mqm or the equivalent on your image. Looks like it is not there... At the same time you need /var/mqm to be external and mounted every time the pod gets deployed and before the qmgr gets started...
 
 Have fun
      _________________
 MQ & Broker admin
 |  |  
		  | Back to top |  |  
		  |  |  
		  | MQ_AGENT | 
			  
				|  Posted: Sat Jan 05, 2019 8:02 am    Post subject: |   |  |  
		  | Newbie
 
 
 Joined: 05 Feb 2016Posts: 7
 
 
 | 
			  
				| "Obviously you need to have /opt/mqm or the equivalent on your image. Looks like it is not there..." 
 -->The /opt/mqm directory is properly created within the Image. If I display the /opt/mqm dir in list format , I can see proper output :
 
 (mq:9.1.1.0)root@podnatee:/var# ls -rlt /opt/mqm
 total 32
 -r--r--r--  1 mqm mqm     0 Nov 21 10:48 mqpatch.dat
 -r--r--r--  1 mqm mqm 15999 Nov 21 10:48 instinfo.tsk
 dr-xr-xr-x  2 mqm mqm   335 Dec 10 11:12 READMES
 dr-xr-xr-x 16 mqm mqm   188 Dec 10 11:12 doc
 dr-xr-xr-x  7 mqm mqm    65 Dec 10 11:12 java
 dr-xr-xr-x 12 mqm mqm  4096 Dec 10 11:13 samp
 dr-xr-xr-x 16 mqm mqm   188 Dec 10 11:13 msg
 dr-xr-xr-x  3 mqm mqm  4096 Dec 10 11:13 lib64
 dr-xr-xr-x  2 mqm mqm    24 Dec 10 11:13 inc
 dr-xr-xr-x  2 mqm mqm  4096 Dec 10 11:13 swidtag
 dr-xr-x---  9 mqm mqm   150 Dec 10 11:13 web
 dr-xr-xr-x  4 mqm mqm   253 Dec 10 11:13 lib
 dr-xr-xr-x  7 mqm mqm   199 Dec 10 11:13 gskit8
 dr-xr-xr-x  3 mqm mqm  4096 Dec 10 11:13 bin
 dr-xr-xr-x  1 mqm mqm    35 Dec 10 11:14 licenses
 
 
 "At the same time you need /var/mqm to be external and mounted every time the pod gets deployed"
 
 I updated the yml file to mount the /mnt/mqm inside the container to a path on the host server (/var/example) . It failed with same error.  Reason to mount /mnt/mqm rather than /var/mqm is available in the below link :
 
 https://github.com/ibm-messaging/mq-container/issues/74
 
 (/var/mqm is soft-linked to /mnt/mqm/data by default within container
 
 (mq:9.1.1.0)root@podnatee:/mnt/mqm# ls -rlt /var/mqm
 lrwxrwxrwx 1 root root 13 Dec 10 11:13 /var/mqm -> /mnt/mqm/data
 )
 
 Updated YML file :
 
 apiVersion: v1
 kind: Pod
 metadata:
 name: podnate
 labels:
 purpose: demonstrate-envars
 spec:
 volumes:
 - name: task-pv-storage
 hostPath:
 path: /var/example
 containers:
 - name: mymqimage
 image: ibmcom/mq:latest
 imagePullPolicy: IfNotPresent
 volumeMounts:
 - mountPath: "/mnt/mqm"
 name: task-pv-storage
 env:
 - name: LICENSE
 value: "accept"
 - name: MQ_QMGR_NAME
 value: "HELO"
 command: [ "/bin/bash", "-c", "--" ]
 args: [ "while true; do sleep 30; done;" ]
 
 Error : Same as last case.
 
 (mq:9.1.1.0)root@podnatee:/var#
 (mq:9.1.1.0)root@podnatee:/var# dspmq
 2 - 'No such file or directory' from /var/mqm/mqs.ini
 (mq:9.1.1.0)root@podnatee:/var# dspmqver
 AMQ7047E: An unexpected error was encountered by a command. Reason code is 0.
 (mq:9.1.1.0)root@podnatee:/var# crtmqm TEST
 AMQ8101S: IBM MQ error (893) has occurred.
 (mq:9.1.1.0)root@podnatee:/var#
 |  |  
		  | Back to top |  |  
		  |  |  
		  | MQ_AGENT | 
			  
				|  Posted: Sat Jan 19, 2019 8:37 am    Post subject: |   |  |  
		  | Newbie
 
 
 Joined: 05 Feb 2016Posts: 7
 
 
 | 
			  
				| Not sure what went wrong there but using helm charts resolved that issue for me.  |  |  
		  | Back to top |  |  
		  |  |  
		  |  |  |  
  
	|    |  | Page 1 of 1 |  
 
 
  
  	| 
		
		  | 
 
 | 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
 
 |  |  |  |