易陆发现论坛

 找回密码
 开始注册
查看: 338|回复: 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.
# O$ V" E: I5 HHas the nova_api database been created?
- Z' g: s$ _9 j' i+ W7 }Has the nova_cell0 database been created?
! s( |- A1 g; e5 W: G6 [Has "nova-manage api_db sync" been run?! |( `& p& D( G/ @$ h1 I& h. ^; H8 K
Has "nova-manage cell_v2 map_cell0" been run?
# f. V' F) g  f& MIs [api_database]/connection set in nova.conf?# F. E; H% O8 l
Is the cell0 database connection URL correct?7 k/ M% C. b+ A" L$ _
Error: 317 is not 318
; o7 {5 P2 E1 S( y% O+ X
" a3 `' R, U: y( V# P, E7 }: N0 o3 S9 `) ~, B5 V( \
解决办法:! X. R# m. R+ p% G
在endpoint中要加上这个%\(tenant_id\)s才可以2 I) H3 q& S8 M% G. W! Y
4 f, @& E3 |  V2 e  D6 O
9 j7 N8 z. h" h8 k& s% `
& H6 t( I! n) s  M) I
/ ?( V4 E. f9 z. o# t- ^) u. ^
- P- Z$ }0 _1 M
处理步骤:& Z8 c- w. P( Y0 h9 L! K
su -s /bin/sh -c "nova-manage api_db sync" nova
5 I* w5 s; t+ Zsu -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova& D( V9 Q3 I3 g
231680ee-43d1-48bc-91db-139ff7ef43a2  V8 ?  g5 `* c& a1 {' }$ P
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
8 _' D; I9 D. Q9 n1 A; y su -s /bin/sh -c "nova-manage db sync" nova
* D# \% N$ Q( w+ B. e8 S/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')
9 D. [( g$ P( C6 u" S7 ~* P  result = self._query(query)
% t5 t+ g: n8 P/ @/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')
: i; R6 q: O3 j) t6 r  result = self._query(query)9 `* e% t; y6 M. G
ERROR: Could not access cell0.
; b, ]6 @& T. R, o# p( j9 ]Has the nova_api database been created?" S2 m. p6 n. I6 t- }7 p. s' ?. m
Has the nova_cell0 database been created?
( S- h8 @1 v* T) c8 W, iHas "nova-manage api_db sync" been run?; k9 H0 K# m% V. R8 d
Has "nova-manage cell_v2 map_cell0" been run?
3 F, S# u( k# c, k% ?$ AIs [api_database]/connection set in nova.conf?$ S3 A+ N# O4 X; [
Is the cell0 database connection URL correct?0 y3 N* N/ a( c; n/ y$ n' H
Error: 317 is not 3186 G6 T5 u, a8 ]
An error has occurred:) r8 d/ z. r( u' L+ O! M  [
Traceback (most recent call last):4 X. y. K. h3 w5 H* C
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main
! J& a3 C) Z, y$ G    ret = fn(*fn_args, **fn_kwargs)
8 B$ t- a. M8 q8 h  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync+ }4 A; T- A, S$ s. ^5 _! B- |
    return migration.db_sync(version)$ r/ g7 p" i) J4 K* k
  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
+ ~" e( d9 v- q' n2 Y$ N6 y! z    return IMPL.db_sync(version=version, database=database, context=context)
: t: I  \) `% D( G  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
  q- l3 H# \: b* q- B    repository, version), ?0 n. k5 n/ J6 J# R' Q
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade+ W& U0 Y$ s3 C" e0 L  F2 J, t
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
$ A6 {0 \( e4 h, x9 Y' a  File "<string>", line 2, in _migrate1 W( X6 Z( `0 W3 i" D: r
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine2 ^# ^4 i- F2 i" K
    return f(*a, **kw)& l9 c7 v5 U8 Z8 L4 E. v9 t
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
/ ?0 `% a1 [* _/ N3 m1 r9 b    schema.runchange(ver, change, changeset.step)6 h! X6 Z  f, P. d" b
  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange
' w# A6 x1 F. i& U! z    (self.version, startver))  W$ w: _8 J8 ^& W$ l6 F
InvalidVersionError: 317 is not 318% V) }3 U! D7 w
su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova, E3 h* F3 F" B4 P% w) Z% T
Cell0 is already setup
  j) D5 c/ o$ | su -s /bin/sh -c "nova-manage db sync" nova6 K. i/ Y1 o% P# T. F, z

7 a0 D+ G4 J9 N2 @! k) t* o3 z同步数据库完成。  ?' W5 M" o" C% C

2 R" _! t  N0 s+ ~: H. U
 楼主| 发表于 2020-1-5 11:53:24 | 显示全部楼层
An error has occurred:; Q4 b" ?2 W# N, R5 h
Traceback (most recent call last):+ p9 `' W' p: F1 U5 F! A
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main7 Y+ }/ R, U" r  H' O5 w
    ret = fn(*fn_args, **fn_kwargs). s8 T1 E9 N0 t$ L  O# @9 r
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync7 ^% l+ @: B' ^2 G
    return migration.db_sync(version)
% k# b* `6 ?2 V" B4 X$ t5 T. f  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync! S1 X4 U3 {) Q
    return IMPL.db_sync(version=version, database=database, context=context)
' X# _2 l" M2 c5 y  w  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
. e/ y3 @" q) a) k1 C6 C5 X: V7 ~    repository, version)
; N. p+ o4 s( j- K& N5 V  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade
5 e1 w. G8 x# z% w    return _migrate(url, repository, version, upgrade=True, err=err, **opts)" e2 b4 X' L3 ?
  File "<string>", line 2, in _migrate4 d& ^0 X9 @' x7 L) M
  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
2 ^$ {$ g3 y3 A; I    return f(*a, **kw)
! S* x* K2 z+ }" x$ b  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
8 O( e, P5 j+ j    schema.runchange(ver, change, changeset.step)
+ o' @: T! i1 B! a( D4 H  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 91, in runchange
- k) H; m9 `1 r! N! M7 M; p8 ]    (self.version, startver))
) R6 S  C9 J5 r+ h/ uInvalidVersionError: 317 is not 318  p. Q5 K8 |2 H$ F* a, v
 楼主| 发表于 2020-1-5 14:12:09 | 显示全部楼层
ERROR: Could not access cell0.; g* K0 N! p: }! k
Has the nova_api database been created?% W* O$ l; o9 S
Has the nova_cell0 database been created?
# v' a0 R' m; I! b0 ]: pHas "nova-manage api_db sync" been run?0 P6 b" @5 p. @, d0 s
Has "nova-manage cell_v2 map_cell0" been run?
$ w/ |. o$ ^( h( d7 ^Is [api_database]/connection set in nova.conf?
/ p9 l4 C, Z  ?+ B8 zIs the cell0 database connection URL correct?# \: U. _# A) o* G, k& E) _
Error: 317 is not 318
4 i& m% g5 A' n* S& }. S' t( ]An error has occurred:4 x5 @% y6 b7 l1 s& x$ K* p
Traceback (most recent call last):
6 x5 v5 v+ z  E8 G' p  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 2375, in main: L1 M, m$ y; p) ^0 A
    ret = fn(*fn_args, **fn_kwargs)
  W; Z5 @& g' T9 f) P  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 495, in sync- m- H, o) m/ z. _/ e+ S/ i6 Y, P
    return migration.db_sync(version)
2 h( U  y9 s9 l! j- |5 x  File "/usr/lib/python2.7/site-packages/nova/db/migration.py", line 26, in db_sync
9 y# D$ ~) J) F" E    return IMPL.db_sync(version=version, database=database, context=context)
" ~( P, j+ D1 }: I  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migration.py", line 61, in db_sync
1 }5 p. o. C" }1 D1 N    repository, version)) b' d) w" f4 T5 I- L2 K
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 186, in upgrade8 H' G/ ]6 t; ~" ~* \
    return _migrate(url, repository, version, upgrade=True, err=err, **opts). f# |( }* t9 [; V+ z) f* V' q
  File "<string>", line 2, in _migrate
" Q# q& v" t" ]( ]% J( `  File "/usr/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 167, in with_engine
! k. D* d, y  e. J0 H    return f(*a, **kw)' z0 O* G, G) o4 q4 K
  File "/usr/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate% P! H0 J# T# t1 k
    schema.runchange(ver, change, changeset.step)
, N9 Z3 e9 Z, l& I  File "/usr/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange
& E5 n: ~- r% @, q4 O    change.run(self.engine, step)! F' u4 W7 ~: }' D2 T9 k, i. U9 r
  File "/usr/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run
" n% Y1 b# L  _% Q. Z: f    script_func(engine)2 T- I5 {3 z% x: R
  File "/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py", line 1443, in upgrade& U, w$ O) M7 q7 {3 {  Y% r& B
    index.create(migrate_engine)
7 B5 b8 O" C5 N* h" F  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/schema.py", line 3656, in create4 J# V0 p5 n6 r2 Z/ L6 y6 k) n
    bind._run_visitor(ddl.SchemaGenerator, self)
% j+ W2 B. J8 @; N  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 2011, in _run_visitor( [) e" i7 I% D: k& a
    conn._run_visitor(visitorcallable, element, **kwargs)
; o/ p+ H9 ^9 H$ X  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1599, in _run_visitor+ V; H" _: c# ?- p5 A+ S" V
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
% l& S+ K: |$ E" L  H2 k& x  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 130, in traverse_single3 ~) h% b2 ?! ~, j) |2 o
    return meth(obj, **kw)
7 b3 c. u6 {/ M. w' T  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 860, in visit_index7 x5 x* Z+ O$ p
    self.connection.execute(CreateIndex(index))' G( M' b4 z' a3 }8 V9 g4 V
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 980, in execute2 ]* t1 a5 {5 W/ p- ?
    return meth(self, multiparams, params)
" S1 X0 s1 t- ^6 R& ^) X  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection# V+ z2 I7 v$ y5 U1 R; a. }/ {
    return connection._execute_ddl(self, multiparams, params)1 I. @+ P8 d' A
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1042, in _execute_ddl6 B% Z" R: ~- ?3 H
    compiled," z! b' T+ q, B" Q& t: |. V" W
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1240, in _execute_context
* [8 a0 H0 X3 z2 i& U; x0 B1 D: S6 x    e, statement, parameters, cursor, context
- r# M8 b( F% q4 E, A) o2 p, |  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1456, in _handle_dbapi_exception" x- X, r! |$ Y# F
    util.raise_from_cause(newraise, exc_info); l( C* |" M; Y) Q: \1 P( q
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 296, in raise_from_cause& ^: K  h4 F; W* d7 e
    reraise(type(exception), exception, tb=exc_tb, cause=cause)- u2 S5 m4 J1 H) O$ ^8 V
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1236, in _execute_context: l/ |. c6 i5 Q+ p$ W
    cursor, statement, parameters, context
% a; J: W+ t0 X8 M  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 536, in do_execute: c, Z0 \1 f* ]) |. s
    cursor.execute(statement, parameters)& |! e% x0 ^: h) D, J7 W/ y
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
% f& l9 Z! o4 \" P5 V    result = self._query(query)& E: z  R1 t: K
  File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query/ J/ |2 n; u6 {! a; {9 w
    conn.query(q)
1 W- Q. T* _# z$ n6 M  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query% B" X2 l$ B" l
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)# s( x5 h: s# L1 v5 n0 O$ u& R
  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result+ s9 o+ f/ m- O- T/ _
    result.read()
2 Z4 n! R% N" V1 U( A. Y  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read
% M1 i' w- H+ }  \1 o5 t    first_packet = self.connection._read_packet()
1 e* ^6 d: O# }9 ?* ?  File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
. Q! f9 \1 }- S# q! e+ a( ?    packet.check_error()
7 a) Z$ E. d0 E: M# P4 |) q  File "/usr/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
3 d9 h. p5 k3 c: k' B1 I    err.raise_mysql_exception(self._data)
8 k$ s  I- z5 {# m5 |) l0 W# J8 H' E  File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception1 T8 A6 d$ b9 }% f4 u
    raise errorclass(errno, errval)
* G  h  N1 |0 f; K5 j- SOperationalError: (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-4-4 23:19 , Processed in 0.050502 second(s), 20 queries .

Powered by 龙睿 bbs168x X3.2

© 2001-2020 Comsenz Inc.

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