next up previous contents
Next: Memcached Up: 環境準備 Previous: SQL 資料庫   Contents

Message queue

  1. OpenStack 使用 message queue 訊息佇列來協調服務之間的操作和狀態訊息,OpenStack 支援多種訊息佇列服務,包括 RabbitMQ,Qpid 和 ZeroMQ,本文件使用 RabbitMQ安裝 rabbitmq-server。
    [root@ip112 ~]# yum install rabbitmq-server
    
  2. 啟動 rabbitmq-server 服務,並設定開機啟動。
    [root@ip112 ~]# systemctl enable rabbitmq-server.service 
    Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service 
    to /usr/lib/systemd/system/rabbitmq-server.service.
    
    [root@ip112 ~]# systemctl start rabbitmq-server.service 
    [root@ip112 ~]# systemctl status rabbitmq-server.service 
    ● rabbitmq-server.service - RabbitMQ broker
       Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2018-05-23 16:54:02 CST; 9s ago
     Main PID: 12046 (beam.smp)
       Status: "Initialized"
       CGroup: /system.slice/rabbitmq-server.service
               ├─12046 /usr/lib64/erlang/erts-8.3.5.3/bin/beam.smp -W w -A 640 -...
               ├─12884 erl_child_setup 1024
               ├─12930 inet_gethost 4
               └─12931 inet_gethost 4
    
    May 23 16:54:02 ip112.csie.cyut.edu.tw systemd[1]: Started RabbitMQ broker.
    Hint: Some lines were ellipsized, use -l to show in full.
    
  3. rabbitmq 新增 openstak 用戶,最後一個參數 RABBIT_PASS 為密碼,請更改成自己適用的密碼。
    [root@ip112 ~]# rabbitmqctl add_user openstack RABBIT_PASS
    Creating user "openstack" ...
    
  4. rabbitmq 設定 openstak 用戶有讀取及寫入的權限。
    [root@ip112 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
    Setting permissions for user "openstack" in vhost "/" ...
    



De-Yu Wang 2018-12-12