Setting up the server using the command line

Follow these instructions to create a queue manager, queue, and channel on the server. You can then use these objects to verify the installation.

About this task

These instructions assume that no queue manager or other IBM® WebSphere® MQ objects have been defined.

IBM WebSphere MQ object definitions are case-sensitive. Any text entered as an MQSC command in lowercase is converted automatically to uppercase unless you enclose it in single quotation marks. Make sure that you type the examples exactly as shown.

Procedure

  1. Create a user ID on the server that is not in the mqm group.
  2. If your server is on a UNIX or Linux® system, log in as a user in the mqm group.
  3. If you are verifying an installation on a Windows, UNIX or Linux system, you must set various environment variables so that the installation can be used in the current shell. You can set the environment variables by entering one of the following commands:
    • On Windows:
      . MQ_INSTALLATION_PATH\bin\setmqenv -s
      where MQ_INSTALLATION_PATH refers to the location where IBM WebSphere MQ is installed.
    • On UNIX and Linux systems:
      . MQ_INSTALLATION_PATH/bin/setmqenv -s
      where MQ_INSTALLATION_PATH refers to the location where IBM WebSphere MQ is installed.
  4. Create a queue manager called QUEUE.MANAGER.1 by entering the following command:
    crtmqm QUEUE.MANAGER.1
    You see messages telling you that the queue manager has been created.
  5. Start the queue manager by entering the following command:
    strmqm QUEUE.MANAGER.1
    A message tells you when the queue manager has started.
  6. Start MQSC by entering the following command:
    runmqsc QUEUE.MANAGER.1
    A message tells you that an MQSC session has started. MQSC has no command prompt.
  7. Define a local queue called QUEUE1 by entering the following command:
    DEFINE QLOCAL (QUEUE1)
    A message tells you when the queue has been created.
  8. Allow the user ID that you created in step 1 to use QUEUE1 by entering the following command:
    SET AUTHREC PROFILE(QUEUE1) OBJTYPE(QUEUE) PRINCIPAL('non_mqm_user') AUTHADD(PUT,GET)
    where non_mqm_user is the user ID created in step 1. A message tells you when the authorisation has been set. You must also run the following command to give the user ID authority to connect:
    SET AUTHREC OBJTYPE(QMGR) PRINCIPAL('non_mqm_user') AUTHADD(CONNECT)
    If this command is not run, a 2305 stop error is returned.
  9. Define a server-connection channel by entering the following command:
    DEFINE CHANNEL (CHANNEL1) CHLTYPE (SVRCONN) TRPTYPE (TCP)
    A message tells you when the channel has been created.
  10. Allow your client channel to connect to the queue manager and run under the user ID that you created in step 1, by entering the following MQSC command:
    SET CHLAUTH(CHANNEL1) TYPE(ADDRESSMAP) ADDRESS('client_ipaddr') MCAUSER('non_mqm_user')
    where client_ipaddr is the IP address of the client system, and non_mqm_user is the user ID created in step 1. A message tells you when the rule has been set.
  11. Define a listener by entering the following command:
    DEFINE LISTENER (LISTENER1) TRPTYPE (TCP) CONTROL (QMGR) PORT (port_number)
    where port_number is the number of the port the listener is to run on. This number must be the same as the number used when defining your client-connection channel in Installing an IBM WebSphere MQ client; see the appropriate HP-UX and Linux sections for more information.
    Note: If you omit the port parameter from the command, a default value of 1414 is used for the listener port. If you want to specify a port other than 1414, you must include the port parameter in the command, as shown.
  12. Start the listener by entering the following command:
    START LISTENER (LISTENER1)
  13. Stop MQSC by entering:
    end
    You see some messages, followed by the command prompt.

What to do next

Follow the instructions to set up the client. See Connecting a WebSphere MQ MQI client to a queue manager, using the MQSERVER environment variable.