RabbitMQ

系统+安全 Liemer_Lius 112℃

rabbitmqctl用法

Commands:
    add_user <username> <password>
    add_vhost <vhost>
    authenticate_user <username> <password>
    await_online_nodes <count> [-t <timeout>]
    cancel_sync_queue [-p <vhost>] queue
    change_cluster_node_type <disc|ram>
    change_password <username> <password>
    clear_global_parameter <key>
    clear_operator_policy [-p <vhost>] <key>
    clear_parameter [-p <vhost>] <component_name> <key>
    clear_password <username>
    clear_permissions [-p vhost] <username>
    clear_policy [-p <vhost>] <key>
    clear_topic_permissions [-p vhost] <username> [<exchange>]
    clear_vhost_limits [-p <vhost>]
    close_all_connections [-p <vhost> --limit <limit>] [-n <node> --global] [--per-connection-delay <delay>] <explanation>
    close_connection <connectionpid> <explanation>
    cluster_status
    decode value passphrase [--cipher cipher] [--hash hash] [--iterations iterations]
    delete_queue queue_name [--if_empty|-e] [--if_unused|-u] [-t <timeout>]
    delete_user <username>
    delete_vhost <vhost>
    encode value passphrase [--cipher cipher] [--hash hash] [--iterations iterations]
    environment
    eval <expr>
    exec <expr> [--offline]
    force_boot
    force_reset
    forget_cluster_node [--offline] <existing_cluster_member_node>
    help <command>
    hipe_compile <directory>
    join_cluster [--disc|--ram] <existing_cluster_member_node>
    list_bindings [-p <vhost>] [<bindinginfoitem> ...] [-t <timeout>]
    list_channels [<channelinfoitem> ...]
    list_ciphers
    list_connections [<connectioninfoitem> ...] [-t <timeout>]
    list_consumers [-p vhost] [<consumerinfoitem> ...] [-t <timeout>]
    list_exchanges [-p <vhost>] [<exchangeinfoitem> ...] [-t <timeout>]
    list_global_parameters [-t <timeout>]
    list_hashes
    list_operator_policies [-p <vhost>] [-t <timeout>]
    list_parameters [-p <vhost>] [-t <timeout>]
    list_permissions [-p <vhost>] [-t <timeout>]
    list_policies [-p <vhost>] [-t <timeout>]
    list_queues [-p <vhost>] [--online] [--offline] [--local] [<queueinfoitem> ...] [-t <timeout>]
    list_topic_permissions [-p <vhost>] [-t <timeout>]
    list_unresponsive_queues [--local] [--queue-timeout <queue-timeout>] [<unresponsiveq_ueueinfoitem> ...] [-t <timeout>]
    list_user_permissions <username> [-t <timeout>]
    list_user_topic_permissions <username> [-t <timeout>]
    list_users [-t <timeout>]
    list_vhost_limits [-p <vhost>] [--global]
    list_vhosts [<vhostinfoitem> ...] [-t <timeout>]
    node_health_check [-t <timeout>]
    ping [-t <timeout>]
    purge_queue <queue> [-t <timeout>]
    rename_cluster_node <oldnode1> <newnode1> [oldnode2] [newnode2] ...
    report
    reset
    restart_vhost [-p <vhost>] [-t <timeout>]
    rotate_logs
    set_cluster_name <name>
    set_disk_free_limit <disk_limit>
set_disk_free_limit mem_relative <fraction>
    set_global_parameter <name> <value>
    set_operator_policy [-p <vhost>] [--priority <priority>] [--apply-to <apply-to>] <name> <pattern> <definition>
    set_parameter [-p <vhost>] <component_name> <name> <value>
    set_permissions [-p <vhost>] <username> <conf> <write> <read>
    set_policy [-p <vhost>] [--priority <priority>] [--apply-to <apply-to>] <name> <pattern> <definition>
    set_topic_permissions [-p <vhost>] <username> <exchange> <write_pattern> <read_pattern>
    set_user_tags <username> <tag> [...]
    set_vhost_limits [-p <vhost>] <definition>
    set_vm_memory_high_watermark <fraction>
    set_vm_memory_high_watermark absolute <value>
    shutdown
    start_app
    status
    stop [<pidfile>]
    stop_app
    sync_queue [-p <vhost>] queue
    trace_off [-p <vhost>]
    trace_on [-p <vhost>]
    update_cluster_nodes <existing_cluster_member_node_to_seed_from>
    wait [<pid_file>] [--pid|-P <pid>] [-t <timeout>]

<timeout> - operation timeout in seconds. Default is "infinity".

<queueinfoitem> must be a member of the list [name, durable, auto_delete, arguments, policy, pid, owner_pid, exclusive, exclusive_consumer_pid, exclusive_consumer_tag, messages_ready, messages_unacknowledged, messages, messages_ready_ram, messages_unacknowledged_ram, messages_ram, messages_persistent, message_bytes, message_bytes_ready, message_bytes_unacknowledged, message_bytes_ram, message_bytes_persistent, head_message_timestamp, disk_reads, disk_writes, consumers, consumer_utilisation, memory, slave_pids, synchronised_slave_pids, state].

<bindinginfoitem> must be a member of the list [source_name, source_kind, destination_name, destination_kind, routing_key, arguments].

<connectioninfoitem> must be a member of the list [pid, name, port, host, peer_port, peer_host, ssl, ssl_protocol, ssl_key_exchange, ssl_cipher, ssl_hash, peer_cert_subject, peer_cert_issuer, peer_cert_validity, state, channels, protocol, auth_mechanism, user, vhost, timeout, frame_max, channel_max, client_properties, recv_oct, recv_cnt, send_oct, send_cnt, send_pend, connected_at].

<channelinfoitem> must be a member of the list [pid, connection, name, number, user, vhost, transactional, confirm, consumer_count, messages_unacknowledged, messages_uncommitted, acks_uncommitted, messages_unconfirmed, prefetch_count, global_prefetch_count].

<exchangeinfoitem> must be a member of the list [name, type, durable, auto_delete, internal, arguments, policy].

<vhostinfoitem> must be a member of the list [name, tracing, cluster_state].

<consumerinfoitem> must be a member of the list [queue_name, channel_pid, consumer_tag, ack_required, prefetch_count, arguments].

<unresponsive_queueinfoitem> must be a member of the list [name, durable, auto_delete, arguments, pid, recoverable_slaves].

常用操作:

./rabbitmqctl add_user lius '1234567890'       # 创建用户
./rabbitmqctl set_user_tags lius administrator  # 设置管理员权限
1、以应用方式
启动:
rabbitmq-server -detached 后台启动
Rabbitmq-server 直接启动,如果你关闭窗口或者需要在改窗口使用其他命令时应用就会停止
关闭:
rabbitmqctl stop
2、以服务方式(安装完之后在任务管理器中服务一栏能看到RabbtiMq)
rabbitmq-service install 安装服务
Rabbitmq-service enable 使服务有效
Rabbitmq-service disable 使服务无效
rabbitmq-service help 帮助
当rabbitmq-service install之后默认服务是enable的,如果这时设置服务为disable的话,rabbitmq-service start就会报错。
当rabbitmq-service start正常启动服务之后,使用disable是没有效果的
启动:
rabbitmq-service start 开始服务
停止:
Rabbitmq-service stop  停止服务
3、Rabbitmq 管理插件启动,可视化界面
rabbitmq-plugins enable rabbitmq_management 启动
rabbitmq-plugins disable rabbitmq_management 关闭

 

转载请注明:skelchina.com » RabbitMQ

喜欢 (0)