此内容没有您所选择的语言版本。
Chapter 12. Management Tools and Consoles
12.1. Command-line utilities 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
12.1.1. Command-line Management utilities 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
The command-line tools are management and diagnostic tools for use at the shell prompt.
| Utility | Description |
|---|---|
qpid-config | Display and configure exchanges, queues, and bindings in the broker |
qpid-tool | Access configuration, statistics, and control within the broker |
qpid-queue-stats | Monitor the size and enqueue/dequeue rates of queues in a broker |
qpid-ha | Configure and view clusters |
qpid-route | Configure federated routes among brokers |
qpid-stat | Display details and statistics for various broker objects |
qpid-printevents | Subscribes to events from a broker and prints details of events raised to the console window |
12.1.2. Using qpid-config 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- View the full list of commands by running the
qpid-config --helpcommand from the shell prompt:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - View a summary of all exchanges and queues by using the
qpid-configwithout options:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - List information on all existing queues by using the
queuescommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add new queues with the
add queuecommand and the name of the queue to create:qpid-config add queue queue_name
$ qpid-config add queue queue_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To delete a queue, use the
del queuecommand with the name of the queue to remove:qpid-config del queue queue_name
$ qpid-config del queue queue_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow - List information on all existing exchanges with the
exchangescommand. Add the-roption ("recursive") to also see binding information:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add new exchanges with the
add exchangecommand. Specify the type (direct, topic or fanout) along with the name of the exchange to create. You can also add the--durableoption to make the exchange durable:qpid-config add exchange direct exchange_name --durable
$ qpid-config add exchange direct exchange_name --durableCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To delete an exchange, use the
del exchangecommand with the name of the exchange to remove:qpid-config del exchange exchange_name
$ qpid-config del exchange exchange_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.1.3. Using qpid-tool 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
- The
qpid-toolcreates a connection to a broker, and commands are run within the tool, rather than at the shell prompt itself. To create the connection, run theqpid-toolat the shell prompt with the name or IP address of the machine running the broker you wish to view. You can also append a TCP port number with a:character:qpid-tool localhost
$ qpid-tool localhost Management Tool for QPID qpid:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - If the connection is successful, qpid-tool will display a
qpid:prompt. Typehelpat this prompt to see the full list of commands:Copy to Clipboard Copied! Toggle word wrap Toggle overflow qpid-tooluses the word objects to refer to queues, exchanges, brokers and other such devices. To view a list of all existing objects, typelistat the prompt:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You can choose which objects to list by also specifying a class:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To view details of an object class, use the
schemacommand and specify the class:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To exit the tool and return to the shell, type
quitat the prompt:qpid: quit Exiting...
qpid: quit Exiting...Copy to Clipboard Copied! Toggle word wrap Toggle overflow
12.1.4. Using qpid-queue-stats 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Run the command
qpid-queue-stats to launch the tool.
The tool will begin to report stats for the broker on the current machine, with the following format:
The queues on the broker are listed on the left. The Sec column is the sample rate. The tool is hard-coded to poll the broker in 10 second intervals. The Depth column reports the number of messages in the queue. Enq Rate is the number of messages added to the queue (enqueued) since the last sample. Deq Rate is the number of messages removed from the queue (dequeued) since the last sample.
To view the queues on another server, use the
-a switch, and provide a remote server address, and optionally the remote port and authentication credentials.
For example, to examine the queues on a remote server with the address
192.168.1.145, issue the command:
qpid-queue-stats -a 192.168.1.145
qpid-queue-stats -a 192.168.1.145
To examine the queues on the server
broker1.mydomain.com:
qpid-queue-stats -a broker1.mydomain.com
qpid-queue-stats -a broker1.mydomain.com
To examine the queues on the server
broker1.mydomain.com, where the broker is running on port 8888:
qpid-queue-stats -a broker1.mydomain.com:8888
qpid-queue-stats -a broker1.mydomain.com:8888
To examine the queues on the server
192.168.1.145, which requires authentication:
qpid-queue-stats -a username/password@192.168.1.145
qpid-queue-stats -a username/password@192.168.1.145