将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 695|回复: 2
收起左侧

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

[复制链接]
发表于 2020-1-5 11:50:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
ERROR: Could not access cell0.
1 J2 K1 V* `9 m& x$ Y# dHas the nova_api database been created?* J1 I/ J* f+ x& y9 J: ^
Has the nova_cell0 database been created?
% y4 \: B( ~9 a  m, UHas "nova-manage api_db sync" been run?/ X5 Q; j" u4 W- U( D/ o$ l' P
Has "nova-manage cell_v2 map_cell0" been run?. [, h0 T$ r% C$ a/ K. E
Is [api_database]/connection set in nova.conf?& _9 i- f; L1 `* h6 e) C+ g! s/ x3 W
Is the cell0 database connection URL correct?
! \2 k4 U7 G- aError: 317 is not 318
1 t/ u5 b3 _! c7 }' ]# W6 s; L+ S+ P8 n: S4 p4 J2 h: q' F  L
5 s2 s: s* b8 N- N+ g) x
解决办法:8 ?! C% n+ `3 g( B, {+ F
在endpoint中要加上这个%\(tenant_id\)s才可以1 I. t7 k- o6 z
$ |! u* U. B' g4 i% @2 ~  `& ~) X

4 f6 k7 a! K% F) R4 Q$ Q3 E: m  R, K, n0 w6 g/ u1 q; W
, i: G/ j' C) C4 j3 g: o" Y  |
9 B  W; i, C, Y* M  g! y
处理步骤:
) X, f9 H1 v& e6 w su -s /bin/sh -c "nova-manage api_db sync" nova# L8 w' `0 }2 m$ `( V
su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova' b* i+ @8 t' I2 K# A0 w
231680ee-43d1-48bc-91db-139ff7ef43a2; \, p; N: u. X4 u
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova* p/ }% F, N2 q/ c. Y
su -s /bin/sh -c "nova-manage db sync" nova
2 M" [4 u5 I0 I; s# y( L* d% [+ 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')8 m" n# W1 ]5 x( Q( X$ J0 p
  result = self._query(query)
0 S( l. U) `. `" T" r8 b! `" ]/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')/ k4 m7 g1 L- }7 |9 l( V" ~* R* F
  result = self._query(query); v, p  h8 r2 ]0 M! F
ERROR: Could not access cell0.5 t1 \  o6 S. @& V: a. l) ?6 u& X: F8 `
Has the nova_api database been created?' r0 b( |( u& @' }7 M: Y" ^
Has the nova_cell0 database been created?
( r6 f1 u8 z, ?- o4 V+ q3 oHas "nova-manage api_db sync" been run?
' H+ w! I/ f7 k3 [' M% M& BHas "nova-manage cell_v2 map_cell0" been run?
8 v! b) U3 Q) c5 B6 T: s/ \Is [api_database]/connection set in nova.conf?
% Z2 x" Z. u1 z! }4 OIs the cell0 database connection URL correct?* ^- `- K6 R3 ?# Y( D- D& R
Error: 317 is not 318
7 ~; f, _5 X1 e2 [! G' AAn error has occurred:
$ v2 E4 g5 T+ Z  p1 uTraceback (most recent call last):
* K9 a3 d- \6 c* S1 O  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main
9 p1 J, G; a; f. D  D& [& @( X    ret = fn(*fn_args, **fn_kwargs)1 e( U; G; \. m8 C9 `$ Y
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync$ u* ^, `/ b) ]# l# G' l7 r! [4 K/ z
    return migration.db_sync(version)8 B$ H$ [" j4 ~8 H9 y( w; w/ A
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
5 h% q& {, q  e# C    return IMPL.db_sync(version=version, database=database, context=context)
/ c* n0 q! q6 o! `, i! U  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
9 w0 X% a7 g% `: Q. H$ ^$ u" H8 i% ?    repository, version)
7 Z# Z& k- f1 i6 |  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade8 `3 i. }1 O1 D% i+ e
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)2 k1 H$ s/ `  m! P' e% ^
  File "<string>", line 2, in _migrate+ R( {1 k6 C0 F  j
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
* M5 e5 o( N& s" ]8 A    return f(*a, **kw)0 w. r3 P6 \) B7 L
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate+ o- I$ p. U! K' K& P, A
    schema.runchange(ver, change, changeset.step)
# ~5 X; e: |- Q! V/ \/ D  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange
2 D* p; o, [, `6 {. v    (self.version, startver))# R. ?+ u) b; ?/ R& l) _
InvalidVersionError: 317 is not 318% Z+ N5 p& M. g+ O& _
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
5 i0 Q6 d+ [& W- V5 M3 H' t6 }Cell0 is already setup6 D$ k6 N: ?1 o) `
su -s /bin/sh -c "nova-manage db sync" nova) _4 X/ G/ y: t; w

! v- }8 P. w/ W2 e: H0 S1 I7 u同步数据库完成。
4 _$ A5 Q$ @" b. _. [+ H% {2 G' }# E& O4 R
 楼主| 发表于 2020-1-5 11:53:24 | 显示全部楼层
An error has occurred:' c+ K& E$ m! v2 y9 V# ?) I- V
Traceback (most recent call last):
. C, l. V3 Y" D! f. @+ V  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main
. d3 b% Z  _, K: w7 {    ret = fn(*fn_args, **fn_kwargs)
# \* _9 P  L$ ?9 ?  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync
5 g$ O  b- [, s, @# w# T. T    return migration.db_sync(version), i1 J8 |' b! R9 ~) N0 Q  I3 D
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
; s7 H; O7 ~5 z2 a    return IMPL.db_sync(version=version, database=database, context=context)
* b2 R1 h% Q. r$ a; E0 T  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
% {3 Y* T$ s1 ?! B* ^. I! G    repository, version)
/ F, Z; k4 u8 l& |  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
( S) N" S7 F% T2 V' s3 a5 i    return _migrate(url, repository, version, upgrade=True, err=err, **opts)* _8 I% y( Y; t& Y% K$ W6 l& A" {" L# P
  File "<string>", line 2, in _migrate0 v/ D, v1 G! X1 _/ e7 ^5 v) M
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
" ]3 y) I0 p# h" d6 Q    return f(*a, **kw)' W3 B9 |" U) r/ L
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
& k+ K: V: }! z, h    schema.runchange(ver, change, changeset.step)
  \& F0 Q+ u1 l& C% [& y  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange7 _$ Y- K8 l6 `  C: q2 T
    (self.version, startver))- G# S/ T9 E* a( _4 w& N( {
InvalidVersionError: 317 is not 318
2 B/ h  M! T# G! y% v
 楼主| 发表于 2020-1-5 14:12:09 | 显示全部楼层
ERROR: Could not access cell0.
) `# Z- d0 t- @9 dHas the nova_api database been created?
4 _. W7 N  q) v, X9 y. |: lHas the nova_cell0 database been created?8 F; ~1 T# j" E) m
Has "nova-manage api_db sync" been run?
/ m4 t: X0 }- p" V% b& l! J, U& PHas "nova-manage cell_v2 map_cell0" been run?
( z; S- y( [; ]3 i" `# RIs [api_database]/connection set in nova.conf?; F" [& f* F7 L
Is the cell0 database connection URL correct?3 K* v: Y5 E# e: z
Error: 317 is not 3188 E0 {' ~/ U5 |5 W6 l
An error has occurred:7 f8 U! {2 A5 r0 y; Y. F
Traceback (most recent call last):! L7 ]2 M# g2 O: R  f6 p3 Y
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main
" U( O' g  [& T7 o5 ^    ret = fn(*fn_args, **fn_kwargs)9 Y8 N' R- i) v
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync
6 Y1 z# |/ T$ B/ T9 }5 @/ ^0 l$ S( |/ H    return migration.db_sync(version)
3 h% a# F/ q- X/ T  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync. ?4 [: ], t! n) I$ |8 r" x+ R2 K
    return IMPL.db_sync(version=version, database=database, context=context); A; m' Z! u: L8 a& S9 S: e5 x# b2 G
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
7 ?- m, U8 G3 q* S8 t* n/ v0 J    repository, version)
3 ~3 F( _* J- q- n- H6 |8 X  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
; o( K9 a$ d; d/ m8 v$ R+ v; `    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
& ]/ U- G0 _5 ~) \; r" V  File "<string>", line 2, in _migrate
( r1 F- t3 q0 H$ g  G* u$ a( T  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine- z7 b% V7 N6 q
    return f(*a, **kw)
0 ?, x9 m2 P+ [  M  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate5 p: E2 M/ |3 q5 L* K
    schema.runchange(ver, change, changeset.step)6 ?1 w8 `: L' q" z
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange- w  b$ n- X0 J, V7 I
    change.run(self.engine, step)
  ~3 m0 B5 p+ S. r0 h  File "/usr/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run" Z6 ^2 o. ^, g5 q5 Z" I. E
    script_func(engine)/ H$ p  @- i7 V, r' A1 g- S# D
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py", line 1443, in upgrade8 v- }5 P* m# ~/ G: a0 ^
    index.create(migrate_engine)
4 E$ d9 s, ~( k% s# p  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/schema.py", line 3656, in create( I9 i# t# U6 y4 g
    bind._run_visitor(ddl.SchemaGenerator, self)/ p) s3 W. D. H- D) p6 J
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 2011, in _run_visitor
6 P' G" i8 d, @2 F+ w# j; b. Y    conn._run_visitor(visitorcallable, element, **kwargs)/ Y! h% g5 z3 ^8 P# y
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1599, in _run_visitor  ?' v3 K' B0 N, O8 o2 I
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
6 M' `( v" x" J; j' L/ m  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 130, in traverse_single3 Y% d) w  d3 f2 G' L
    return meth(obj, **kw)/ |2 E; e( N5 ]) {7 ?  `' ~
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 860, in visit_index: S  U! F% [: p+ L, U) ^
    self.connection.execute(CreateIndex(index))
& {7 V1 X% W8 P: W& N; G  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute, @; Y2 t# ~2 G! u
    return meth(self, multiparams, params)# z: T+ f+ {1 W8 g1 X
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection( {  t, _/ d: j% }* d
    return connection._execute_ddl(self, multiparams, params): M: W8 W- Y- B& D2 ?" j
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1042, in _execute_ddl
# z6 A- p* ^# p, G7 P    compiled,
4 t( F; R/ M# e) A  y. P  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context, y% C# h  D8 `
    e, statement, parameters, cursor, context
% G5 c  e' C+ C# I2 L  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1456, in _handle_dbapi_exception
+ a* {7 j) c# v( f0 v    util.raise_from_cause(newraise, exc_info)5 I  m6 a2 R% {6 x, I
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause
4 s+ v2 G+ i0 O    reraise(type(exception), exception, tb=exc_tb, cause=cause)
1 x5 }( _# i( e" n1 {$ p. @5 k  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context
% Y+ O; m1 z. h" M- `* {' b    cursor, statement, parameters, context0 ?6 _9 P3 W7 ~& l. i: D/ t. x
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute
/ C( `! y/ q8 \    cursor.execute(statement, parameters)2 c* }( `! f! l  o) ^; s) z
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
# J" n& Y( f: T  U( q    result = self._query(query)2 p5 P- I, B& l* w. v
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query# i/ E. r- M" X; \! R# S' [( \2 E
    conn.query(q)( K3 J: E( t; P- y3 P
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query! n3 V8 f/ t& p. Z+ E7 z
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
6 J/ k5 g' C4 e4 a4 g0 N  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
) Y% W) Z7 ?# B- m6 K6 [    result.read()& R3 E3 _' \; f+ ]3 Z! h
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read5 p& {+ S, b) W$ m- K
    first_packet = self.connection._read_packet()3 |( N8 [  K# P+ ^! O. o
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
( \( w( v3 R0 ^6 S& J    packet.check_error()
% ~% s1 H1 Z7 f$ q  File "/usr/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error) ^# ~% u1 J1 A& f: a! N
    err.raise_mysql_exception(self._data)
0 V$ h. ]% g) B+ |; _  File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception* Q/ O5 b, ?+ |8 K* Y; H
    raise errorclass(errno, errval)
7 p( T- V3 s3 J: Y# R% c) VOperationalError: (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)
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2020-7-8 03:07 , Processed in 0.254192 second(s), 23 queries .

Powered by 龙睿 bbs168x X3.2

© 2001-2020 Comsenz Inc.

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