找回密码
 注册
查看: 13|回复: 0

cinder volume状态因配置错误无法删除,通过调整数据库update数据删除

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2025-2-22 13:31:39 | 显示全部楼层 |阅读模式
[root@streamcontroller ~]# cinder service-list
: g' g6 n) r7 Z( w" F/ o5 q$ l' E+------------------+-----------------------+------+----------+-------+----------------------------+-----------------+# k/ B' @% ^$ b4 i# O2 l
| Binary           | Host                  | Zone | Status   | State | Updated_at                 | Disabled Reason |
6 J- ]: K& p9 J! _' }) @+------------------+-----------------------+------+----------+-------+----------------------------+-----------------+$ r( ^1 s+ ^% s+ L8 W% y) T7 ]
| cinder-scheduler | streamcontroller      | nova | enabled  | up    | 2025-02-22T05:23:32.000000 | -               |
/ P7 v0 H& ]4 Q! s3 o| cinder-volume    | rbd:images@images     | nova | enabled  | up    | 2025-02-22T05:23:32.000000 | -               |
- n2 L! {* {3 L! b| cinder-volume    | rbd:volumes@volumes   | nova | enabled  | up    | 2025-02-22T05:23:32.000000 | -               |
8 y# c9 l/ p) U8 S5 A* O| cinder-volume    | streamcontroller@ceph | nova | disabled | down  | 2025-02-22T05:02:19.000000 | -               |6 L: t0 j* x. Y$ K; p6 f# ]
+------------------+-----------------------+------+----------+-------+----------------------------+-----------------+# L( d" L$ U1 ^9 w2 Y8 a4 q: _: g  K+ M
[root@streamcontroller ~]# mysql -uroot -p
4 v7 S# e8 E& c! i$ {# R$ BEnter password:
* J5 ^$ P# y1 f' l- |0 dWelcome to the MariaDB monitor.  Commands end with ; or \g.
4 v* q9 e1 u7 I" q4 KYour MariaDB connection id is 316
; k- i2 s$ \( T* p" G- `Server version: 10.5.27-MariaDB MariaDB Server
8 e  I# T3 b4 @) d2 s- @! N* Y5 j+ z) K# ^: |
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others./ R; @# d' R" N# o$ b
- ~" P, G. H- h
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.9 ~2 e$ v( g, Y% J. H! B( _" l# M
  |/ ]$ t9 n' a3 p
MariaDB [(none)]> user cinder
9 G" ^( P, R& S0 A4 f    -> ;
. [& Y! o, N! V8 K3 c* y6 GERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'user cinder' at line 19 w  B. g+ f1 k; J7 T- g
MariaDB [(none)]> show databases;- Y  Z2 X3 f3 l$ ]9 K. S) ^
+--------------------+/ D& f% K& H( w4 n9 B! i8 e
| Database           |0 j# Q  K- |( |9 J1 e
+--------------------+* t. p+ [0 z, y; q9 {" _
| cinder             |
# f% ^3 y# W+ a7 g2 n8 Q: m| glance             |7 D% O1 E8 B$ ^9 P" s4 ^& U
| information_schema |
( N1 |: c2 O0 v| keystone           |
- O7 F$ _9 i. e& V' ~7 a8 n  F| mysql              |
$ ]7 p. V7 s2 b| neutron            |! z' _% o( G, E1 {5 Z9 A, R
| nova               |
7 i" G4 S# l/ Z+ c| nova_api           |
. i; A2 W; J$ Y2 d9 t| nova_cell0         |
1 K6 K8 P" x* m4 g1 X( t| performance_schema |, P2 ?+ }2 `2 x; v) J; J9 d& `
| placement          |. O, }! e" }4 m3 V7 e
+--------------------+
7 q! \3 ^6 k: ^- m% o) v: |11 rows in set (0.044 sec)/ c" ]& ?3 O/ j+ X9 Y( _0 ]
3 z# r/ |, S, n  d
MariaDB [(none)]> use cinder. X+ Z' y4 B0 \1 b- a0 W2 v
Reading table information for completion of table and column names
6 g6 O5 C$ n0 f- _9 DYou can turn off this feature to get a quicker startup with -A7 Y" J7 |, w" g& p  X

' c$ T: Q/ }3 V) Q# O- @Database changed
; d' a) u1 l) _MariaDB [cinder]> show tables;
% `0 o5 W- [- D8 k+----------------------------+* p& {+ r$ b! |  X! ]* Q' p) K% P
| Tables_in_cinder           |! J- \, E' `+ s; e
+----------------------------+! o$ _. Z5 I7 y& O% s. T5 E1 f  G/ {
| alembic_version            |# v: g+ ^5 q! [) z  e1 k
| attachment_specs           |
/ Z7 z5 o3 _, g) q6 m| backup_metadata            |
& A8 U# e  S6 X9 u$ X| backups                    |
, F  T4 p* v5 ^1 G| cgsnapshots                |' j+ h/ T7 P' C$ I1 l7 m+ |
| clusters                   |
! [: s$ e( X1 v+ s! A9 q; a; N| consistencygroups          |& ?( o# }/ c- \1 l- c
| default_volume_types       |1 \% Q+ \) n* z% ^
| driver_initiator_data      |# O" V8 i2 P2 o& I4 v! C7 e( l# O
| encryption                 |
6 r% M1 |, X) B+ S2 a( p2 B| group_snapshots            |
. v3 K% G7 p" m+ D9 J* C- w9 U3 d| group_type_projects        |
& k& e/ ~1 ~: f. J| group_type_specs           |; c% ?! V8 H& w! U: Y& C6 {
| group_types                |
5 \' q+ i; q6 e9 s8 V| group_volume_type_mapping  |( e6 u. \" {6 f, G  L1 s6 k! z
| groups                     |- p4 V( A" A+ X! l* D5 d- H' o$ |
| image_volume_cache_entries |7 M- e3 W) \9 B( S$ p
| messages                   |
( A: E' Z) c9 q( t$ j& Q| quality_of_service_specs   |
3 s7 a6 [# y  b, o# h| quota_classes              |$ G9 z7 u& M& a4 c; L% q3 k% Q
| quota_usages               |
4 U* X. N! e) J, [% l4 ~| quotas                     |3 B0 m0 h8 }- P
| reservations               |
' D$ m; T6 U  F# V; K| services                   |2 G  o" h2 F  L6 W6 ~, _
| snapshot_metadata          |2 b8 P5 z9 x6 w$ z9 g
| snapshots                  |
8 w! F6 v4 j( T* ^| transfers                  |2 H! L+ o2 [2 P, b, K: ]# D
| volume_admin_metadata      |
7 {8 h; N4 }  Q# w& z9 [$ a| volume_attachment          |0 X" _( t+ @; O& D! f) F, d2 q
| volume_glance_metadata     |
3 p$ R$ n$ D$ ^0 o' |3 f| volume_metadata            |
+ P3 j  b. g% t! Q| volume_type_extra_specs    |2 P( J+ u" k! R) r: {- ?/ p0 k
| volume_type_projects       |
) ^: P" C! x- u2 u8 F1 Y( o& W3 d| volume_types               |
& O7 n2 i" [  E" D: a+ h! {| volumes                    |
4 {+ }1 M: ]' \) c) V+ || workers                    |0 c, H' ~6 E# U4 g/ @( r6 |9 a
+----------------------------+4 c( g$ C, p, V
36 rows in set (0.001 sec)
  ]* y+ Y6 s7 w: V& v5 r
) h  x8 e  Q9 b" T8 lMariaDB [cinder]> select * from services;5 H8 H; V( }% S& ^" t
+---------------------+---------------------+------------+---------+----+-----------------------+------------------+------------------+--------------+----------+-------------------+-----------------+---------------------+---------------------+------------------------+--------------------+--------+-------------------+--------------+--------------------------------------+, x! t' j" p3 B
| created_at          | updated_at          | deleted_at | deleted | id | host                  | binary           | topic            | report_count | disabled | availability_zone | disabled_reason | modified_at         | rpc_current_version | object_current_version | replication_status | frozen | active_backend_id | cluster_name | uuid                                 |) d7 P, g% _- d
+---------------------+---------------------+------------+---------+----+-----------------------+------------------+------------------+--------------+----------+-------------------+-----------------+---------------------+---------------------+------------------------+--------------------+--------+-------------------+--------------+--------------------------------------+, {% x1 T# v1 N5 C) l
| 2025-02-21 08:46:15 | 2025-02-22 05:24:42 | NULL       |       0 |  1 | streamcontroller      | cinder-scheduler | cinder-scheduler |         7311 |        0 | nova              | NULL            | NULL                | 3.12                | 1.39                   | not-capable        |      0 | NULL              | NULL         | 25a9a766-4a38-4865-a579-20fc13311a1d |9 t# m) s! @$ o# G& {
| 2025-02-21 08:54:12 | 2025-02-22 04:21:32 | NULL       |       0 |  2 | streamcontroller@ceph | cinder-volume    | cinder-volume    |            0 |        1 | nova              | NULL            | 2025-02-22 05:02:19 | 3.18                | 1.39                   | not-capable        |      0 | NULL              | NULL         | 0842668e-c3d1-46e4-a06a-d49220948c49 |
+ }% f. o" f0 v0 Z: t# M| 2025-02-22 05:00:22 | 2025-02-22 05:24:42 | NULL       |       0 |  3 | rbd:volumes@volumes   | cinder-volume    | cinder-volume    |           39 |        0 | nova              | NULL            | NULL                | 3.18                | 1.39                   | disabled           |      0 | NULL              | NULL         | 7cb2a139-c176-4195-8f8d-fffc81872145 |
& B7 E: p$ A$ ]| 2025-02-22 05:00:22 | 2025-02-22 05:24:42 | NULL       |       0 |  4 | rbd:images@images     | cinder-volume    | cinder-volume    |           39 |        0 | nova              | NULL            | NULL                | 3.18                | 1.39                   | disabled           |      0 | NULL              | NULL         | 14a90401-32ec-482e-94fd-d36e46e8f823 |
! U7 u- N0 u, ~0 ?2 L+---------------------+---------------------+------------+---------+----+-----------------------+------------------+------------------+--------------+----------+-------------------+-----------------+---------------------+---------------------+------------------------+--------------------+--------+-------------------+--------------+--------------------------------------+
$ h1 j- P) M, q4 rows in set (0.001 sec)
# s; u  R* t9 s- ^' M$ K7 `! p; s: o5 E, u/ G  N" k; |
MariaDB [cinder]> select * from services\G;) |1 m; M- ^, F6 I1 F
*************************** 1. row ***************************
( F% O8 k; c; }- j  L  _            created_at: 2025-02-21 08:46:15
) z# _3 @) {3 K. ~            updated_at: 2025-02-22 05:24:52
) M5 ~" `6 ^3 V: U' m            deleted_at: NULL
- Y  z+ `$ W# s+ c' Z5 |& y, k               deleted: 01 R; H5 d7 U- v1 p* @! T
                    id: 1
2 Z: @- `5 \+ F0 L8 ?, f4 ?3 G                  host: streamcontroller9 }* w; ^* l6 x0 f
                binary: cinder-scheduler
$ C% L; [9 |, ?+ d5 O) t5 z                 topic: cinder-scheduler
# C3 R- u; k- g4 g1 c          report_count: 7312
& I% B6 z% a% l* m: V1 r, W5 R" m              disabled: 0
( \! }, }- [! m9 e     availability_zone: nova
3 W& D' _* P# S6 {& {1 D       disabled_reason: NULL& i. u% o( h3 A
           modified_at: NULL
$ b( I" f9 J7 U( a' u$ U   rpc_current_version: 3.12
- s  ^; U; `# M; U! kobject_current_version: 1.39
/ p3 Y2 Y2 A+ q' z0 N5 ?9 R    replication_status: not-capable
+ Q2 J9 G( N- \# z, ^  w                frozen: 0
8 U0 E) E9 g/ Y3 s, u     active_backend_id: NULL$ z/ q. ^& M% @; I  ~9 @/ U
          cluster_name: NULL4 M% @( z/ [* ]8 ?. b/ B
                  uuid: 25a9a766-4a38-4865-a579-20fc13311a1d
! M7 ^( s; B( z( f" f6 _
1 y& N& C& Q" q" b2 G, `4 E/ F" l查询相关语句:" y9 x5 @2 b3 I
MariaDB [cinder]> select id,uuid,host,deleted from services;
- l+ \% H2 p' W1 d( R( Y+----+--------------------------------------+-----------------------+---------+/ g& X/ C2 d$ I3 ]' ?
| id | uuid                                 | host                  | deleted |
! z/ f8 O) K, z2 u3 P0 c) p+----+--------------------------------------+-----------------------+---------+/ }# Y0 j% W2 P4 |8 o
|  1 | 25a9a766-4a38-4865-a579-20fc13311a1d | streamcontroller      |       0 |! h/ R; I/ P* z7 }
|  2 | 0842668e-c3d1-46e4-a06a-d49220948c49 | streamcontroller@ceph |       0 |$ H4 x4 y  H: |$ |% F# X0 b
|  3 | 7cb2a139-c176-4195-8f8d-fffc81872145 | rbd:volumes@volumes   |       0 |
5 u; F) v! q% s; v) b|  4 | 14a90401-32ec-482e-94fd-d36e46e8f823 | rbd:images@images     |       0 |
. @) ?# B0 r* i+----+--------------------------------------+-----------------------+---------+
8 A# R: `8 R4 b) H! q4 rows in set (0.001 sec)$ Q1 C  v2 \# N& A
; ~, O. M; R+ k% D
设置状态deleted为1:5 u- D3 \* H- X! Q  o* e  \

6 U$ x$ `8 w8 D6 KMariaDB [cinder]> update cinder.services set deleted='1' where uuid='0842668e-c3d1-46e4-a06a-d49220948c49';
/ T1 M+ `& f0 fQuery OK, 1 row affected (0.001 sec)
* N9 {5 C2 U; i* d+ m/ hRows matched: 1  Changed: 1  Warnings: 0
1 k% N! S7 [. ]  _3 t; j$ t, M; u  P; ?! p9 M- [
MariaDB [cinder]> select id,uuid,host,deleted from services;
" c9 h# b7 F6 @8 K$ R+----+--------------------------------------+-----------------------+---------+* y! ~' y4 t( e" A
| id | uuid                                 | host                  | deleted |# z1 [! F5 w2 O
+----+--------------------------------------+-----------------------+---------+
  G' A& _4 X' D" }8 J- A- g|  1 | 25a9a766-4a38-4865-a579-20fc13311a1d | streamcontroller      |       0 |
+ \% H7 h1 U( _4 l4 a|  2 | 0842668e-c3d1-46e4-a06a-d49220948c49 | streamcontroller@ceph |       1 |
! f9 j# @: y4 g# A* k+ y|  3 | 7cb2a139-c176-4195-8f8d-fffc81872145 | rbd:volumes@volumes   |       0 |
) a! u" a' {7 |6 j5 `|  4 | 14a90401-32ec-482e-94fd-d36e46e8f823 | rbd:images@images     |       0 |
/ z0 z2 C9 ]) I! l1 A+----+--------------------------------------+-----------------------+---------+. `5 {: ?7 _% _1 `+ S  p' u  z
4 rows in set (0.001 sec)2 U6 g. _' Q4 X9 p
$ o4 B9 m4 x) j1 l4 O8 t
再次检查状态:
7 y7 @& b, s+ ~) H' {[root@streamcontroller ~]# cinder service-list
4 g# l" J5 N. V8 k4 k+------------------+---------------------+------+---------+-------+----------------------------+-----------------+
" B/ ?: f- A3 Q% }' r| Binary           | Host                | Zone | Status  | State | Updated_at                 | Disabled Reason |
& o/ X$ h* e, w' |( u3 t) t% o+------------------+---------------------+------+---------+-------+----------------------------+-----------------+
7 \# W$ H8 ^/ J6 `| cinder-scheduler | streamcontroller    | nova | enabled | up    | 2025-02-22T05:31:32.000000 | -               |
1 P" o2 K/ c% i" K9 Q! b( I| cinder-volume    | rbd:images@images   | nova | enabled | up    | 2025-02-22T05:31:32.000000 | -               |# j% A6 Z5 K4 T) ]) `8 g' M) A
| cinder-volume    | rbd:volumes@volumes | nova | enabled | up    | 2025-02-22T05:31:32.000000 | -               |
; a! F: G- v: E# _. p+------------------+---------------------+------+---------+-------+----------------------------+-----------------+; U" T! Q* `3 e1 b; m) Q
* d" q4 e% D0 p- i( k

9 U0 p9 z- K$ x4 O9 V9 e+ v+ }  ?9 k
% z" u7 o) m. T* M  d' [
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:03 , Processed in 0.016757 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表