本地虚拟机关机重启后ocp怎么启动

【 使用环境 】本地 测试环境
【 OB or 其他组件 】
【 使用版本 】
【问题描述】我在本地虚拟机中部署了4.3.5的ocp,直接关机后,尝试了下述命令启动失败,应该怎么启动呢
[root@ocp ocp]# obd cluster list
±------------------------------------------------+
| Cluster List |
±-----±-----------------------±----------------+
| Name | Configuration Path | Status (Cached) |
±-----±-----------------------±----------------+
| ocp | /root/.obd/cluster/ocp | running |
±-----±-----------------------±----------------+
Trace ID: 4f489d2c-48b9-11f0-af3a-000c299f74ad
If you want to view detailed obd logs, please run: obd display-trace 4f489d2c-48b9-11f0-af3a-000c299f74ad
[root@ocp ocp]# obd cluster start ocp
Get local repositories x
[ERROR] Another app is currently holding the obd lock.

Trace ID: 52524c66-48b9-11f0-9b75-000c299f74ad
If you want to view detailed obd logs, please run: obd display-trace 52524c66-48b9-11f0-9b75-000c299f74ad
[root@ocp ocp]# obd cluster stop ocp
Get local repositories x
[ERROR] Another app is currently holding the obd lock.

Trace ID: 55c167a6-48b9-11f0-be26-000c299f74ad
If you want to view detailed obd logs, please run: obd display-trace 55c167a6-48b9-11f0-be26-000c299f74ad
[root@ocp ocp]# obd display-trace 55c167a6-48b9-11f0-be26-000c299f74ad
[2025-06-14 08:48:49.337] [DEBUG] - cmd: [‘ocp’]
[2025-06-14 08:48:49.337] [DEBUG] - opts: {‘servers’: None, ‘components’: None}
[2025-06-14 08:48:49.337] [DEBUG] - mkdir /root/.obd/lock/
[2025-06-14 08:48:49.337] [DEBUG] - unknown lock mode
[2025-06-14 08:48:49.338] [DEBUG] - try to get share lock /root/.obd/lock/global
[2025-06-14 08:48:49.338] [DEBUG] - share lock /root/.obd/lock/global, count 1
[2025-06-14 08:48:49.338] [DEBUG] - Get Deploy by name
[2025-06-14 08:48:49.338] [DEBUG] - mkdir /root/.obd/cluster/
[2025-06-14 08:48:49.338] [DEBUG] - mkdir /root/.obd/config_parser/
[2025-06-14 08:48:49.338] [DEBUG] - try to get exclusive lock /root/.obd/lock/deploy_ocp
[2025-06-14 08:48:49.338] [DEBUG] - exclusive lock /root/.obd/lock/deploy_ocp, count 1
[2025-06-14 08:48:49.340] [DEBUG] - Check the deploy status
[2025-06-14 08:48:49.340] [INFO] Get local repositories
[2025-06-14 08:48:49.341] [DEBUG] - mkdir /root/.obd/repository
[2025-06-14 08:48:49.341] [DEBUG] - Get local repository oceanbase-ce-4.2.1.8-499b676f2ede5a16e0c07b2b15991d1160d972e8
[2025-06-14 08:48:49.341] [DEBUG] - try to get share lock /root/.obd/lock/mirror_and_repo
[2025-06-14 08:48:49.342] [ERROR] Another app is currently holding the obd lock.
[2025-06-14 08:48:49.342] [ERROR] Traceback (most recent call last):
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 66, in _sh_lock
[2025-06-14 08:48:49.342] [ERROR] File “tool.py”, line 491, in share_lock_obj
[2025-06-14 08:48:49.342] [ERROR] BlockingIOError: [Errno 11] Resource temporarily unavailable
[2025-06-14 08:48:49.342] [ERROR]
[2025-06-14 08:48:49.342] [ERROR] During handling of the above exception, another exception occurred:
[2025-06-14 08:48:49.342] [ERROR]
[2025-06-14 08:48:49.342] [ERROR] Traceback (most recent call last):
[2025-06-14 08:48:49.342] [ERROR] File “obd.py”, line 302, in do_command
[2025-06-14 08:48:49.342] [ERROR] File “obd.py”, line 1016, in _do_command
[2025-06-14 08:48:49.342] [ERROR] File “core.py”, line 2674, in stop_cluster
[2025-06-14 08:48:49.342] [ERROR] File “core.py”, line 641, in load_local_repositories
[2025-06-14 08:48:49.342] [ERROR] File “_repository.py”, line 645, in get_repository_allow_shadow
[2025-06-14 08:48:49.342] [ERROR] File “_repository.py”, line 545, in _lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 269, in mirror_and_repo_sh_lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 254, in _sh_lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 249, in _lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 171, in lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 72, in sh_lock
[2025-06-14 08:48:49.342] [ERROR] File “_lock.py”, line 68, in _sh_lock
[2025-06-14 08:48:49.342] [ERROR] _errno.LockError: [Errno 11] Resource temporarily unavailable
[2025-06-14 08:48:49.342] [ERROR]
[2025-06-14 08:48:49.342] [DEBUG] - exclusive lock /root/.obd/lock/deploy_ocp release, count 0
[2025-06-14 08:48:49.342] [DEBUG] - unlock /root/.obd/lock/deploy_ocp
[2025-06-14 08:48:49.342] [DEBUG] - share lock /root/.obd/lock/global release, count 0
[2025-06-14 08:48:49.342] [DEBUG] - unlock /root/.obd/lock/global
[2025-06-14 08:48:49.471] [INFO] [ERROR] Another app is currently holding the obd lock.
[2025-06-14 08:48:49.471] [INFO]
[2025-06-14 08:48:49.471] [INFO] Trace ID: 55c167a6-48b9-11f0-be26-000c299f74ad
[2025-06-14 08:48:49.471] [INFO] If you want to view detailed obd logs, please run: obd display-trace 55c167a6-48b9-11f0-be26-000c299f74ad
[2025-06-14 08:48:49.471] [DEBUG] - unlock /root/.obd/lock/mirror_and_repo

[root@ocp ocp]# ps -ef|grep ocp
avahi 933 1 0 08:26 ? 00:00:00 avahi-daemon: running [ocp.local]
root 1522 1 0 08:27 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_agentd -c /home/admin/ocp_agent/conf/agentd.yaml
root 1751 1522 0 08:27 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_mgragent
root 1755 1522 3 08:27 ? 00:00:45 /home/admin/ocp_agent/bin/ocp_monagent
root 7277 4852 0 08:49 pts/1 00:00:00 grep --color=auto ocp
[root@ocp ocp]# ps -ef|grep observer
root 2232 1 79 08:27 ? 00:17:31 /root/oceanbase/bin/observer
root 7291 4852 0 08:49 pts/1 00:00:00 grep --color=auto observer
[root@ocp ocp]# netstat -antlup|grep 8080

1 个赞

[ERROR] Another app is currently holding the obd lock.
你的obd 进程是不是还在运行关掉试试

1 个赞

怎么操作呀

我使用obd web,卸载之后还在

其他窗口是不是还开着obd web的进程。关掉即可

开机后ocp集群怎么启动呀
[root@ocp ~]# obd cluster list
±------------------------------------------------+
| Cluster List |
±-----±-----------------------±----------------+
| Name | Configuration Path | Status (Cached) |
±-----±-----------------------±----------------+
| ocp | /root/.obd/cluster/ocp | running |
±-----±-----------------------±----------------+
Trace ID: 589bf040-4a49-11f0-9ea8-000c299f74ad
If you want to view detailed obd logs, please run: obd display-trace 589bf040-4a49-11f0-9ea8-000c299f74ad
这里显示是running,observer也可以登录,但是web无法访问
[root@ocp logs]# obclient -h192.168.116.168 -P2881 -uroot@sys -DoceanBase -Ac -p
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487798
Server version: OceanBase_CE 4.2.1.8 (r108000022024072217-3149c25ca2dadbb7707686ad02a1367b1b43e0b5) (Built Jul 23 2024 02:01:58)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

obclient(root@sys)[oceanBase]> \q
Bye
[root@ocp logs]# curl http://192.168.116.168:8080
curl: (7) Failed connect to 192.168.116.168:8080; Connection refused
[root@ocp logs]# netstat -antlup|grep 8080
[root@ocp logs]#

如果在关机时未提前关闭集群。list界面的展示会出现异常。执行obd cluster start启动即可

ocp_agent怎么停止呀:
[root@ocp ~]# obd cluster stop ocp
Get local repositories ok
Get local repositories and plugins ok
Open ssh connection ok
Stop observer ok
Stop obshell ok
Stop obproxy-ce ok
Stop ocp-server-ce ok
ocp stopped
Trace ID: 3a29a7e8-4a7a-11f0-afc8-000c299f74ad
If you want to view detailed obd logs, please run: obd display-trace 3a29a7e8-4a7a-11f0-afc8-000c299f74ad
[root@ocp ~]# ps -ef|grep ocp_agent
root 1376 1 0 14:20 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_agentd -c /home/admin/ocp_agent/conf/agentd.yaml
root 1582 1376 0 14:20 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_mgragent
root 1585 1376 5 14:20 ? 00:00:07 /home/admin/ocp_agent/bin/ocp_monagent
root 4243 3508 0 14:22 pts/0 00:00:00 grep --color=auto ocp_agent
[root@ocp ~]# ps -ef|grep ocp_agent
root 1376 1 0 14:20 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_agentd -c /home/admin/ocp_agent/conf/agentd.yaml
root 1582 1376 0 14:20 ? 00:00:00 /home/admin/ocp_agent/bin/ocp_mgragent
root 1585 1376 5 14:20 ? 00:00:07 /home/admin/ocp_agent/bin/ocp_monagent
root 4245 3508 0 14:22 pts/0 00:00:00 grep --color=auto ocp_agent

学习