Configure queue managers for remote administration
We can administer a remote queue manager from a local queue manager by using the administrative REST API, MQSC, or PCF commands. The remote queue manager might be on the same system, in a different installation, or on a different system with the same environment, or a different IBM MQ environment. Before we can remotely administer a queue manager from a local queue manager, we must create a sender and receiver channel, a listener, and a transmission queue on each queue manager. These channels and queues enable the commands to be sent to the remote queue manager and the responses to be received on the local queue manager. The procedure to create these queues and channels is the same whether we want to use the administrative REST API, MQSC, or PCF commands.
Before starting
- The following procedure uses example queue managers source.queue.manager, and target.queue.manager. We must create and start these queue managers on the system to follow these steps, or substitute your own queue manager names in the relevant steps.
- The following procedure uses TCP/IP as the transport type. We must know the IP address of both systems to complete this task.
- The following procedure creates listeners that use the network ports 1818 on the local system and 1819 on the remote system. We can use other ports, but must substitute your port values in the appropriate steps.
- We must run the commands in the procedure locally or over a network facility such as Telnet.
Figure 1 shows the configuration of queue managers, queues, and
channels that we need for remote administration:
- The object source.queue.manager is the source queue manager from which we can issue administrative REST API, MQSC, or PCF commands, and to which the results of these commands are returned.
- The object target.queue.manager is the name of the target queue manager, which processes the commands and generates any operator messages.
- Commands get put onto the transmission queue that has the same name as the remote queue manager. In this case, target.queue.manager. A transmission queue is a specialized local queue that temporarily holds messages before the MCA picks them up and sends them to the remote queue manager.
- The commands get sent by the source.to.target channel to the SYSTEM.ADMIN.COMMAND.QUEUE on the remote queue manager. Each end of the channel has a separate definition. One end is a sender and the other end is a receiver. The two definitions must have the same name and together constitute a single message channel.
- The command output is put on the remote transmission queue that has the same name as the local queue manager from which the command was sent. In this case, source.queue.manager.
- The output is sent by the target.to.source channel to an appropriate reply queue, where it is taken and output by the original command.
Procedure
- On the remote system queue manager, ensure that the command queue SYSTEM.ADMIN.COMMAND.QUEUE is present. This queue is created by default when a queue manager is created.
- On the remote system, check that the command server is running on the queue
manager. If the command server is not running, remote administration is not possible:
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
runmqsc target.queue.manager
- Display the status of the command server by entering the following command:
DISPLAY QMSTATUS CMDSERV
- Exit runmqsc by entering the following command:
end
- If the command server is not started, start it. For example, for queue manager
target.queue.manager, enter the following command:
strmqcsv target.queue.manager
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
- Define the channels, listener, and transmission queue on the local queue
manager:
- Start runmqsc for the queue manager. For example, for queue manager
source.queue.manager, enter the following command:
runmqsc source.queue.manager
- Define the sender channel. This sender channel must have the same name as the receiver
channel on the remote queue manager. For example, enter the following MQSC command, replacing the
value for CONNAME with the IP address for the remote queue manager and the port
number of the listener:
DEFINE CHANNEL ('source.to.target') + CHLTYPE(SDR) + CONNAME (localhost:1819) + XMITQ ('target.queue.manager') + TRPTYPE(TCP)
- Define the receiver channel. This receiver channel must have the same name as the
sender channel on the remote queue manager. For example, enter the following command:
DEFINE CHANNEL ('target.to.source') + CHLTYPE(RCVR) + TRPTYPE(TCP)
- Define the listener on the local queue manager. For example, enter the following
command:
DEFINE LISTENER ('source.queue.manager') + TRPTYPE (TCP) + PORT (1818)
- Define the transmission queue on the local queue manager. This transmission queue must
have the same name as the remote queue manager. For example, enter the following command:
DEFINE QLOCAL ('target.queue.manager') + USAGE (XMITQ)
- Start the listener. For example, enter the following command:
START LISTENER ('source.queue.manager')
- Exit runmqsc by entering the following command:
end
- Start runmqsc for the queue manager. For example, for queue manager
source.queue.manager, enter the following command:
- Define the channels, listener, and transmission queue on the remote queue
manager:
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
runmqsc target.queue.manager
- Define the sender channel. This sender channel must have the same name as the receiver
channel on the local queue manager. For example, enter the following MQSC command, replacing the
value for CONNAME with the IP address for the local queue manager and port
number for the listener:
DEFINE CHANNEL ('target.to.source') + CHLTYPE(SDR) + CONNAME (localhost:1818) + XMITQ ('source.queue.manager') + TRPTYPE(TCP)
- Define the receiver channel. This receiver channel must have the same name as the
sender channel on the local queue manager For example, enter the following command:
DEFINE CHANNEL ('source.to.target') + CHLTYPE(RCVR) + TRPTYPE(TCP)
- Define the listener. For example, enter the following command:
DEFINE LISTENER ('target.queue.manager') + TRPTYPE (TCP) + PORT (1819)
- Define the transmission queue. This transmission queue must have the same name as the
local queue manager. For example, enter the following command:
DEFINE QLOCAL ('source.queue.manager') + USAGE (XMITQ)
- Start the listener. For example, enter the following command:
START LISTENER ('target.queue.manager')
- Exit runmqsc by entering the following command:
end
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
- Start the sender channel on the local system:
- Start runmqsc for the queue manager. For example, for queue manager
source.queue.manager, enter the following command:
runmqsc source.queue.manager
- Start the sender channel. For example, enter the following command:
START CHANNEL ('source.to.target')
- Exit runmqsc by entering the following command:
end
- Start runmqsc for the queue manager. For example, for queue manager
source.queue.manager, enter the following command:
- Start the sender channel on the remote system:
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
runmqsc target.queue.manager
- Start the sender channel. For example, enter the following command:
START CHANNEL ('target.to.source')
- Exit runmqsc by entering the following command:
end
- Start runmqsc for the queue manager. For example, for queue manager
target.queue.manager, enter the following command:
- Test that the configuration has completed successfully by sending an MQSC command from
the local system to the remote queue manager:
- Start runmqsc for the remote queue manager from the local system.
For example, enter the following command:
runmqsc -w 30 -m source.queue.manager target.queue.manager
- Display the queues on the remote queue manager by entering the following
command:
DISPLAY QUEUE (*)
On success, a list of queues from the remote queue manager is displayed. - If these steps do not work, check that the channels on both systems are in a running state. If the channels are not running, and do not start, check the channels and transmission queues are configured correctly, and that the command server is running. For example, check that the correct CONNAME is specified for the sender channels, and that the transmission queues have the correct names. Also, check the queue manager logs for security exceptions that might help resolve the issue.
- Start runmqsc for the remote queue manager from the local system.
For example, enter the following command:
Results
Your queue managers are configured to remotely administer the remote queue manager from the local system.What to do next
- Learn more about remote administration using MQSC commands: Issuing MQSC commands on a remote queue manager
- Learn more about writing administration programs using PCF commands: Use IBM MQ Programmable Command Formats.
- Learn more about using the administrative REST API for remote administration: Remote administration using the REST API.
Parent topic: Work with remote IBM MQ objects