找回密码
 注册
查看: 6187|回复: 2

同步nova数据库 su -s /bin/sh -c "nova-manage db sync" nova ERROR: Could no

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2020-1-5 11:50:57 | 显示全部楼层 |阅读模式
ERROR: Could not access cell0.
2 c9 G+ [8 G2 lHas the nova_api database been created?) o; L/ R* [5 c" }6 ^  P$ B
Has the nova_cell0 database been created?7 T# z0 N: h  B
Has "nova-manage api_db sync" been run?
  k/ E2 R: y) M( {: S- C% E1 vHas "nova-manage cell_v2 map_cell0" been run?
4 V2 I/ N4 O5 X* p/ t, xIs [api_database]/connection set in nova.conf?
0 W2 U% d9 W) c8 L0 LIs the cell0 database connection URL correct?
5 |( H2 E* k  v: n5 x/ kError: 317 is not 318( i: I% {6 I* M5 f: j
) U' d$ p! {0 Z& Z3 B. \/ Z2 j( B

) x* L1 Y; J0 y3 Y" }8 _% H解决办法:
6 b3 Q2 y2 n0 Q9 }* t6 N在endpoint中要加上这个%\(tenant_id\)s才可以
. }- U/ \0 `. t8 E7 {& A# R  m8 s' r$ k( S2 N' V) D8 ~0 n

2 |  I4 j) Q# F& f' u
- Q' Y& P: L" r% a+ t
/ @3 F  \& [, U/ f6 V
$ ~7 {1 I# L: [% J: W/ \
处理步骤:
# n! t5 c$ }6 L8 M: T- D su -s /bin/sh -c "nova-manage api_db sync" nova
' f5 N: K$ a+ d; s0 G8 psu -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
2 Q! G4 l) y/ h6 [231680ee-43d1-48bc-91db-139ff7ef43a2+ g1 R* O! @$ f2 D2 D8 w2 Y0 ]" [
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova! {$ y% _8 D! `) h2 b; f
su -s /bin/sh -c "nova-manage db sync" nova
9 F4 U/ g, {( K$ Y" U* n6 p/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release')+ e! o) a5 C2 \5 d! E9 D! }
  result = self._query(query)/ F" M& W2 m8 {+ @$ T
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release')
$ j+ c- O) O) G7 w' z) @  result = self._query(query)
& F! N6 W  t/ Z( T! {ERROR: Could not access cell0.1 Z- R6 Q8 r7 L4 E
Has the nova_api database been created?3 ^0 a0 w9 B& k: D4 N5 u1 }
Has the nova_cell0 database been created?
! H- m# J, n- I* J5 [/ ~1 jHas "nova-manage api_db sync" been run?7 F' E5 O/ w. @7 [2 N1 k
Has "nova-manage cell_v2 map_cell0" been run?
  J: z) m' H3 K$ J; qIs [api_database]/connection set in nova.conf?& Y, x6 M: |% E+ x( \$ P/ `! ~
Is the cell0 database connection URL correct?
$ ^3 ]; ?5 g+ `9 ^5 c: X- b5 CError: 317 is not 318
4 ?) `( @( m/ uAn error has occurred:/ k$ a1 F, f* \, L# l
Traceback (most recent call last):; l" x9 w: ^) J) ^0 a( V7 o; @! Y& R" W( u
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main% o0 B/ B% h7 u3 T0 T3 K  }
    ret = fn(*fn_args, **fn_kwargs)
6 H$ I! A/ Y& R) q  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync
- [* r/ A  ?9 ^) R    return migration.db_sync(version), P8 r/ U- s' `' U; D
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync; V' |/ Y, J+ v* G3 ^
    return IMPL.db_sync(version=version, database=database, context=context)7 E, @! n( Z' r- G: F8 P3 P( U! B# {
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync/ L/ t. B7 A/ e2 c6 O# f0 z
    repository, version)
+ l2 A% |7 g: n7 T$ D0 f  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
- N4 R9 z$ ^+ ]" E    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
- A+ [- v- Z5 A* \2 t& q  File "<string>", line 2, in _migrate) H/ t- t8 D, m. d
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
3 h9 ?0 ~/ m9 M+ H& B& ~8 S    return f(*a, **kw)% A- P" N# o( w
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
, v: q. o8 r3 d( {' B: n    schema.runchange(ver, change, changeset.step)( t9 P$ z3 ^3 f, _
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange
# W, X7 b) d5 ~9 p/ l5 w# r- P    (self.version, startver))% M/ u, O2 Y9 K. `6 m, W
InvalidVersionError: 317 is not 318- X% O" G& V8 Y; D7 [
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova: x$ s. J1 B6 s, ]  B# B& d; w6 c
Cell0 is already setup" b/ \" a1 Z! r& x" r2 W( W
su -s /bin/sh -c "nova-manage db sync" nova
9 |" `* H& Y9 E' M3 J$ m4 k* m4 a& M2 S5 f) L3 A1 v( D5 M4 @
同步数据库完成。
* [: ~. Z8 D+ t! T& v7 l! i& i1 W% v- G% m

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2020-1-5 11:53:24 | 显示全部楼层
An error has occurred:, \" x( v0 @# p7 P* [1 G/ K/ Y! i
Traceback (most recent call last):5 ]4 h. p5 ]/ f7 C
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main3 y% K6 f8 W8 Y" j: f( g
    ret = fn(*fn_args, **fn_kwargs), _3 p0 w4 m8 u' o4 R" Z1 u
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync
/ G% B; g/ _+ W+ ?3 X, L5 g    return migration.db_sync(version)! y* U* u' c( t, d. Y7 x# n( [4 M
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
% V% J2 `6 |- @; U) y7 u* J6 M  o; T" q    return IMPL.db_sync(version=version, database=database, context=context); F( u+ ~/ D. Z9 j; x
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
3 _) [, M! r- e3 T( H( |1 @$ @    repository, version)
9 d2 b* Y& t( o4 J7 x$ K  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade- G5 T2 H5 x) I
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
% B$ L& M: ~* D% i: x% r- A8 W  File "<string>", line 2, in _migrate
7 Z! b' q4 s& V4 {" G# R  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine- Y- E9 P/ V; d% G% [1 k6 L
    return f(*a, **kw)9 i, O, |+ c, ^  L% p
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
5 L+ c( ?4 @! w( r    schema.runchange(ver, change, changeset.step)# U, Q, ^( @9 @  ?8 p
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange3 n$ b% y  Q5 J4 j5 |6 l% g
    (self.version, startver))
4 a" s3 K) @" F; `  @2 HInvalidVersionError: 317 is not 318
) ]; N5 b; o" g

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2020-1-5 14:12:09 | 显示全部楼层
ERROR: Could not access cell0.
2 L- U  l  {- L! ~9 GHas the nova_api database been created?$ j% R& h. E1 H( O
Has the nova_cell0 database been created?3 g( I) u, a. F0 G8 e
Has "nova-manage api_db sync" been run?
5 Z# R  e) }! C3 f6 {Has "nova-manage cell_v2 map_cell0" been run?3 Q2 C5 ?& V/ I2 r. u% S7 _$ u
Is [api_database]/connection set in nova.conf?
9 Q9 g7 `5 l' _9 \( K5 H) h6 L' zIs the cell0 database connection URL correct?( t* I; j, x2 Q$ `/ R8 u9 \
Error: 317 is not 3181 K" \, P/ N; }8 J  I
An error has occurred:
9 G. E- _: @* a8 ^3 n: q# [Traceback (most recent call last):
4 e, D4 M9 w8 Q! i; q/ ~& A0 P  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main
: ?0 c3 J2 S5 d    ret = fn(*fn_args, **fn_kwargs)' X) C, g8 q+ r) w( J  `, ~
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync6 H. T% Z* M& u9 ?- M8 |. @+ L
    return migration.db_sync(version)
3 g3 I( D0 V8 R* f& g; x% ]8 T  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
, {, N) Z9 W) y0 v  e& X$ T    return IMPL.db_sync(version=version, database=database, context=context)7 e4 M9 e* v3 N. E$ I  i0 f( r' ?
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
) N1 I9 v: P6 i; R/ S0 i  Y, C- r    repository, version)
9 ?& g. Z; V* j. [, n* b3 I( Y" r4 U  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
2 K$ I; t& d' X( r    return _migrate(url, repository, version, upgrade=True, err=err, **opts)/ o/ a7 C7 L0 L8 O0 J! H
  File "<string>", line 2, in _migrate
. v4 x7 U8 A/ B2 r: u4 g8 [4 x0 O  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
; K* T5 J/ h- s9 P# V& V    return f(*a, **kw)
" `' ^4 W3 T' Z& E, B8 O  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate6 Y7 U! k! E" B
    schema.runchange(ver, change, changeset.step)2 W. s" f  a/ b! Y) w) A: _
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange
' v. Y: r  W' i7 b& J    change.run(self.engine, step)- y/ g% z+ g" u8 @5 m
  File "/usr/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run
$ E4 n! @3 V$ o9 B- Y    script_func(engine)
, a' v2 s0 W& d# m  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py", line 1443, in upgrade1 u4 l  E, W" n& \
    index.create(migrate_engine)
3 N& m, a: p( I- I; Q8 C. h( x  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/schema.py", line 3656, in create
# B& I& z1 `! ^* C. y( g" j* X& E    bind._run_visitor(ddl.SchemaGenerator, self)' |$ \2 {- B; p  L" t
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 2011, in _run_visitor$ w) |$ m7 U4 }
    conn._run_visitor(visitorcallable, element, **kwargs)
: j" Y& M0 V5 m, r  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1599, in _run_visitor6 \0 ]" Y  n4 G' p* Y
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)7 Q# z5 y* d, G: k
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 130, in traverse_single% ?* g/ s# g9 {
    return meth(obj, **kw)
4 Q( @1 v. D( f* A+ b  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 860, in visit_index/ t1 l& T0 m2 w/ u/ \. ^2 T$ c& |
    self.connection.execute(CreateIndex(index))
7 R* n  F% x: T5 a  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute/ w- _1 C* T8 m! z) X
    return meth(self, multiparams, params)
7 X! |+ a/ G, A; P  u" ^0 Y  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
4 L, d! ?+ m( u+ P    return connection._execute_ddl(self, multiparams, params)/ I* J! C4 E2 ^
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1042, in _execute_ddl
( P3 P/ e0 h, S    compiled,4 s$ |1 X+ j! l7 C  j$ n% {1 x
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context8 }0 P; L9 R: ^) w
    e, statement, parameters, cursor, context
. t7 ^& J" r6 r$ L! @' X$ c  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1456, in _handle_dbapi_exception
; G! x3 X! f- W1 |    util.raise_from_cause(newraise, exc_info)# ]; ]5 l2 p) ^2 [& p7 h" ^
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause5 e: n0 j9 {* Q3 T# J1 u# a3 l; _
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
" P! X: o4 b% y  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
* _# h( q; j/ z) g5 B4 U    cursor, statement, parameters, context
* s; V5 l/ B5 F7 Q8 b3 f  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
) f3 l- o; B4 M$ r    cursor.execute(statement, parameters)( s- D1 W# f. g9 u2 y6 a
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
  g, H2 ]/ d  s    result = self._query(query), I0 \2 _" a0 U' x! ?+ s
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
6 h+ W8 x2 J# j8 c, E- S' t    conn.query(q)$ O/ {( N  h4 S- j# F/ C1 q0 z
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query
2 E1 k3 y( R4 g, Z% ^  T    self._affected_rows = self._read_query_result(unbuffered=unbuffered)9 L3 E" e1 X' e: T) F
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
2 Y; T& S5 l9 z" A% ~8 v3 [$ a    result.read()
- }3 W& C+ x; q( e, R, t( N  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read% q# e9 a& ^5 P/ V, Y2 W
    first_packet = self.connection._read_packet()" x$ M$ ^5 e' J2 O1 ?
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
. {% |! S9 T7 B( Q+ j1 a    packet.check_error()' D; I7 N/ X; E& ^$ {. r; u
  File "/usr/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
+ r* d5 D" s. I3 o# X    err.raise_mysql_exception(self._data)3 C* v$ {4 o6 ?! d; G% d
  File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
6 W. M: {/ [% f% E, T    raise errorclass(errno, errval)' C, q3 T3 d9 U) i3 P& o
OperationalError: (pymysql.err.OperationalError) (1213, u'WSREP replication failed. Check your wsrep connection state and retry the query.') [SQL: u'CREATE INDEX certificates_project_id_deleted_idx ON certificates (project_id, deleted)'] (Background on this error at: http://sqlalche.me/e/e3q8)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:24 , Processed in 0.035138 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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