Rabbitmq 問題記錄

 

0.啓用web頁面管理
sudo rabbitmq-plugins enable rabbitmq_management
sudo rabbitmqctl add_user mytest mytest
sudo rabbitmqctl set_user_tags mytest administrator
sudo rabbitmqctl set_permissions -p / mytest ".*" ".*" ".*"html


1. client -> rabbitmq-server使用鏈接池
a.每一個進程獨佔鏈接池,鏈接池默認值:max_size=30 min_size=2 ttl=1200
b.鏈接使用協程池來處理事業,協程池默認值:executor_thread_pool_size=64git

2. client與rabbitmq-server 鏈接的心跳保持
a. client與rabbitqm-server協商心跳檢查時間(默認60s), 取兩邊最小值做用心跳檢查時間
b. 心跳包是特定類型的數據(frame_type=8,內容爲空),上層應用感知不到心跳,底層鏈接(amqp)直接處理,接發不須要端響應
c. client與rabbitqm-server都週期性地發送心跳(最新發送數據的時間點做爲起點)
d. 兩端使用2個心跳時間做爲超時時間(最近收到數據的時間點做爲起點)
e. 發送心跳間隔單個心跳時間github

3. oslo_messaging 的Connection.
a. publish
1.池化管理Connection, 週期性地檢查和發送心跳(Threading)
2.獲取時觸發Connection超時(池)檢查
3.發送msg後等待confirm(類型(60, 80))web

b. consume
非池化Connnection, 週期性地檢查和發送心跳(Threading),等待處理msgapi


5. Rabbitmq配置(openstack)
[oslo_messaging_rabbit]
rabbit_hosts = "mgm-net0:5672,mgm-net2:5672"
rabbit_userid = openstack
rabbit_password =rabbit_pass
kombu_reconnect_delay = 1.0
rabbit_retry_interval = 1
rabbit_retry_backoff = 2
rabbit_max_retries = 0
rabbit_durable_queues = true
rabbit_ha_queues = true
heartbeat_timeout_threshold = 60
heartbeat_rate = 2
rabbit_qos_prefetch_count = 5fetch


6.neutron-server服務進程數量
a. api-server 默認等於CPU核數
b. rpc-worker 默認等於1(RPC任務較多,建議適當調整)
c. rpc_state_report_workers 默認等於1(實際等於n+1)
d PeriodicWorker 默認等於1(只能等於1,plugin的週期性任務,如dhcp-agent/router-agent週期性管理等)ui


7.問題處理
1.心跳Timeout "missed heartbeats from client, timeout: 60s"
a. 僅有publish Connection產生超時
b. https://github.com/celery/kombu/pull/489
2.重啓Cluster的某個節點,"operation basic.publish caused a channel exception not_found: no exchange"
a.集羣的節點數據沒有同步
b.https://bugzilla.redhat.com/show_bug.cgi?id=1399237.net

文檔:
https://blog.csdn.net/zyz511919766/article/details/41896823
https://geewu.gitbooks.io/rabbitmq-quick/content/index.htmlrouter

相關文章
相關標籤/搜索