openstack重啟swift服務后報錯問題解決方案
swift重啟報錯
問題描述
swift服務正常狀態(tài)如下
[root@controller ~]# swift stat Account: AUTH_8bde12ff804e42498661b7454994c446 Containers: 0 Objects: 0 Bytes: 0 X-Put-Timestamp: 1690507907.67931 X-Timestamp: 1690507907.67931 X-Trans-Id: tx56d22fa138ab45908caab-0064c31a82 Content-Type: text/plain; charset=utf-8 X-Openstack-Request-Id: tx56d22fa138ab45908caab-0064c31a82 [root@controller ~]#
[root@compute ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 99G 0 part ├─centos-root 253:0 0 50G 0 lvm / ├─centos-swap 253:1 0 3.9G 0 lvm [SWAP] └─centos-home 253:2 0 45.1G 0 lvm /home sdb 8:16 0 100G 0 disk ├─sdb1 8:17 0 20G 0 part │ ├─cinder--volumes-cinder--volumes--pool_tmeta 253:3 0 20M 0 lvm │ │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool_tdata 253:4 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm ├─sdb2 8:18 0 20G 0 part /swift/node/sdb2 └─sdb3 8:19 0 20G 0 part sr0 11:0 1 4.4G 0 rom [root@compute ~]#
重啟后報錯如下
[root@controller ~]# source /etc/keystone/admin-openrc.sh
[root@controller ~]# swift stat
Account HEAD failed: http://controller:8080/v1/AUTH_8bde12ff804e42498661b7454994c446 503 Service Unavailable
Failed Transaction ID: tx1bac2f2ee5fe45cda0125-0064c3c108
[root@controller ~]#
日志如下
[root@controller ~]# tail -f /var/log/swift/* tail: cannot open ‘/var/log/swift/*' for reading: No such file or directory tail: no files remaining
[root@compute ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 99G 0 part ├─centos-root 253:0 0 50G 0 lvm / ├─centos-swap 253:1 0 3.9G 0 lvm [SWAP] └─centos-home 253:2 0 45.1G 0 lvm /home sdb 8:16 0 100G 0 disk ├─sdb1 8:17 0 20G 0 part │ ├─cinder--volumes-cinder--volumes--pool_tmeta 253:3 0 20M 0 lvm │ │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool_tdata 253:4 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm ├─sdb2 8:18 0 20G 0 part └─sdb3 8:19 0 20G 0 part sr0 11:0 1 4.4G 0 rom loop0 7:0 0 20G 0 loop /swift/node [root@compute ~]#
解決辦法
實際上是因為腳本里面設置的是臨時掛載,重啟后會失效,只需要重新掛載即可
在swift-compute腳本里面查看腳本內(nèi)容
..... echo "/dev/$OBJECT_DISK /swift/node xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0" >> /etc/fstab mkdir -p /swift/node/$OBJECT_DISK mount /dev/$OBJECT_DISK /swift/node/$OBJECT_DISK scp $HOST_NAME:/etc/swift/*.ring.gz /etc/swift/ .......
計算節(jié)點從新掛載生效
[root@compute ~]# umount /swift/node/ [root@compute ~]# source /etc/openstack/openrc.sh [root@compute ~]# mount /dev/$OBJECT_DISK /swift/node/$OBJECT_DISK [root@compute ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 99G 0 part ├─centos-root 253:0 0 50G 0 lvm / ├─centos-swap 253:1 0 3.9G 0 lvm [SWAP] └─centos-home 253:2 0 45.1G 0 lvm /home sdb 8:16 0 100G 0 disk ├─sdb1 8:17 0 20G 0 part │ ├─cinder--volumes-cinder--volumes--pool_tmeta 253:3 0 20M 0 lvm │ │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool_tdata 253:4 0 19G 0 lvm │ └─cinder--volumes-cinder--volumes--pool 253:5 0 19G 0 lvm ├─sdb2 8:18 0 20G 0 part /swift/node/sdb2 └─sdb3 8:19 0 20G 0 part sr0 11:0 1 4.4G 0 rom [root@compute ~]#
├─sdb2 8:18 0 20G 0 part /swift/node/sdb2
控制節(jié)點驗證
[root@controller ~]# source /etc/keystone/admin-openrc.sh [root@controller ~]# swift stat Account: AUTH_8bde12ff804e42498661b7454994c446 Containers: 0 Objects: 0 Bytes: 0 X-Put-Timestamp: 1690509333.32481 X-Timestamp: 1690509333.32481 X-Trans-Id: txcc8962b244bb4ff397885-0064c32014 Content-Type: text/plain; charset=utf-8 X-Openstack-Request-Id: txcc8962b244bb4ff397885-0064c32014 [root@controller ~]#
還有一個辦法就是直接弄成永久掛載,這樣即使重啟也沒事
到此這篇關(guān)于解決openstack重啟swift服務后報錯的文章就介紹到這了,更多相關(guān)openstack重啟swift服務報錯內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Swift中的條件判斷、循環(huán)、跳轉(zhuǎn)語句基礎(chǔ)學習筆記
if、for和while循環(huán)、switch等這些基本的程序流程控制語句基本上是每個編程語言的標配,在入門環(huán)節(jié)中,這里對Swift中的條件判斷、循環(huán)、跳轉(zhuǎn)語句基礎(chǔ)學習筆記作了一個整理:2016-06-06Swift使用SnapKit模仿Kingfisher第三方擴展優(yōu)化
這篇文章主要為大家介紹了Swift?SnapKit模仿Kingfisher第三方擴展優(yōu)化示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-09-09swift 3.0 正則表達式查找/替換字符的實現(xiàn)代碼
正則表達式使用單個字符串來描述、匹配一系列符合某個句法規(guī)則的字符串。本文重點給大家介紹swift 3.0 正則表達式查找/替換字符的實現(xiàn)代碼,需要的朋友參考下吧2017-08-08