MQ

 View Only
Expand all | Collapse all

RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

  • 1.  RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Thu May 05, 2022 09:48 AM
    Please vote for this Idea if you would find it helpful.

    "Distributed IBM MQ support Linux hostname change while queue manager is running"

    https://integration-development.ideas.ibm.com/ideas/MESNS-I-433

    ------------------------------
    Tim Zielke
    ------------------------------


  • 2.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Tue May 10, 2022 10:41 AM
    Thanks for posting! Can't wait to see the voting results.

    ------------------------------
    Jina K
    ------------------------------



  • 3.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Wed January 17, 2024 05:52 AM

    The hostname is used (by default) to differentiate between two instances of a queue manager using the same IPC keys.

    If you share "/var/mqm" between hosts then you must then have "hosta" and "hostb" have their own unique directories to store and retrieve the IPC keys. If you cannot rely on a hostname remaining immutable, then you need to provide MQ (both the queue manager and any applications and tools that connect using IPC) some alternate immutable string to use to partition the storage of its IPC keys. Since MQ 7.0.1, environment variable (MQS_IPC_HOST) set at a system-wide level can override the use of the hostname, instead of using an environment variable set at a system level, are there any other host unique and immutable strings that could be inquired?



    ------------------------------
    Jonathan Rumsey
    Senior Software Engineer
    ------------------------------



  • 4.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Wed January 17, 2024 08:36 AM

    I don't think it is a valid assumption to assume the hostname will be immutable. If IBM MQ wants to leverage functionality around the hostname, it also needs to tolerate the hostname being changed while the queue manager is running. We have many enterprise products and applications running when the hostname is changed, and IBM MQ is the only product that has issues with this operational action. What makes this worse, the queue manager becomes unstable when the hostname is changed while the queue manager is running. This should be considered a defect, in my opinion.



    ------------------------------
    Tim Zielke
    ------------------------------



  • 5.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Wed January 17, 2024 10:48 AM

    The purpose of my update on this thread was to indicate why MQ has provision for storing IPC keys that are valid on different hosts, to support solutions such as multi-instance queue managers where data is shared between hosts.

    MQ does not force you to rely on the hostname being immutable. The MQS_IPC_HOST environment variable is the IBM documented solution to ensure a change in the hostname whilst MQ is running will not impact the path used by the queue manager or applications from accessing the IPC data.

    If for some reason it is impossible to set this environment variable at a system-wide level, perhaps I could suggest updating the idea to request using a configuration file that is unlikely to be shared between hosts (such as /etc/opt/mqm/mqinst.ini) to identify each hosts IPC storage location, rather than the environment variable. 



    ------------------------------
    Jonathan Rumsey
    Senior Software Engineer
    ------------------------------



  • 6.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Thu January 18, 2024 08:41 AM

    Hi all

    OS: SLES15

    What it works for me is mapping the hostname with the IP at /etc/hosts

    Steps:
    1. Stop the Queue Manager, listeners, and process

    2. change the host name and the /etc/hosts file

    3. reboot the server

    I hope it works to all

    Thank you



    ------------------------------
    Juan Reforme
    ------------------------------



  • 7.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Thu January 18, 2024 09:16 AM

    I appreciate the workarounds that have been given for this issue with the hostname changing when the IBM MQ queue manager is running, but let me put this another way.

    A customer builds a queue manager in a Production environment with a standard build that does not involve any environment variables being set. The queue manager is running critical Production work load and then someone changes the hostname on the system, which is a documented and allowed administrative function for a running system. The queue manager then becomes immediately unstable. dspmq returns a misleading status. Applications trying to connect to the queue manager receive 2059 errors. MQ clients start receiving errors when running channels to the queue manager. The endmqm command no longer works, and you have to send SIGKILL signals to the individual queue manager processes to get the queue manager to come down. And this is not considered a defect?



    ------------------------------
    Tim Zielke
    ------------------------------



  • 8.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    IBM Champion
    Posted Fri January 19, 2024 02:50 AM

    I tried it in RHEL 8.

    As you said no more status etc... so I did export MQ_IPC=<old host name> and that worked fine for my server session. 

    I figure you'd have to use that to stop the qmgr, unset the variable and start the qmgr...



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 9.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Fri January 19, 2024 12:54 PM

    I went and looked back at my PMRs, and I noticed that I had communicated that the MQS_IPC_HOST does not fix the issue. So I tested it again on a RHEL8 server with IBM MQ 9.3.0.15 and this workaround does not correct the issue. If you set the MQS_IPC_HOST environment variable to the current hostname, start the queue manager, use the hostname command under root to change the hostname, the IBM MQ queue manager then becomes unstable (e.g. dspmq stops working properly).

    Personally, it does not matter if this MQS_IPC_HOST workaround did fix this issue. This is still a defect that involves queue manager stability, and should be worked as a defect.



    ------------------------------
    Tim Zielke
    ------------------------------



  • 10.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    IBM Champion
    Posted Mon January 22, 2024 02:42 AM
    Edited by Francois Brandelik Mon January 22, 2024 04:37 PM

    The order of my tasks was a bit different and I wonder if that affected the result. On top of that I had a somewhat older version of MQ.

    Here is the sequence of the tasks I performed:

    1. ssh to mqm user on machine (queue manager was running)
    2. sudo - i
    3. change hostname (was A now B)
    4. exit
    5. verify dspmq => not working
    6. export MQS_IPC_HOST=A  (you need to make sure that this happens in the current session, it you started the qmgr with the variable it may not be set in your current session. In essence verify that the current session is using this variable with the hostname set to A echo $MQS_IPC_HOST .)
    7. verify dspmq => now working
    8. sudo -i
    9. change hostname (was B now A)
    10. exit
    11. verify dspmq working
    12. unset MQS_IPC_HOST
    13. bounce qmgr



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 11.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    Posted Mon January 22, 2024 03:30 PM

    That isn't quite the issue, but what you did will fix the issue. You could also fix it by running the hostname command again. But the following steps do not correct the issue.

    1) export MQS_IPC_HOST=hostname

    2) start the queue manager

    3) validate queue manager is running with MQS_IPC_HOST set by checking /proc/pid/environ for queue manager pids

    4) under root, change the hostname

    When you do those steps, dspmq still stops working properly. I didn't wait to validate it, but I assume the queue manager starts to fall apart with local connections failing, channels no longer working, endmqm no longer works, etc.

    So MQS_IPC_HOST is not a valid solution for this issue. And it never was in the first place, as no IBM MQ administrator should be required to set an environment variable to avoid a queue manager stability defect.

    I have already opened two PMRs for this issue, and neither has resulted in a defect being opened against it. I guess we will have to live with this queue manager instability defect for now and hope it gets addressed in this RFE.



    ------------------------------
    Tim Zielke
    ------------------------------



  • 12.  RE: RFE/Idea - Distributed IBM MQ support Linux hostname change while queue manager is running

    IBM Champion
    Posted Mon January 22, 2024 03:48 PM

    Hi Tim,

    I figure the environment variable issue is that it really needs to be set in the session that is working with the qmgr.

    If you just set it in the session/env the qmgr starts in, it does you no good in the session that is trying to talk to the qmgr.



    ------------------------------
    Francois Brandelik
    ------------------------------