Linux运维----03.制作trove-mysql5.7镜像
安装mysql
yum install http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
yum remove mariadb-libs
yum install mysql-community-server
2.配置mysql
mkdir -p /etc/mysql/conf.d/
vim /etc/my.cnf
.....
#此处有空行
!includedir /etc/mysql/conf.d/
chown -R mysql:mysql /etc/mysql/
3.安装percona-xtrabackup
innobackupex
yum install https://www.percona.com/redir/downloads/percona-release/redhat/percona-release-0.1-4.noarch.rpm
yum install percona-xtrabackup-24
出现如下问题:
Transaction check error:
file /etc/my.cnf from install of Percona-Server-shared-56-5.6.44-rel86.0.el7.x86_64 conflicts with file from package mysql-community-server-5.7.26-1.el7.x86_64
Error Summary
-------------
方案:
yum install mysql-community-libs-compat
4.源码安装trove-guestagnet
yum install -y epel-release
yum install -y python2-pip gcc git
useradd -m trove
cat /etc/sudoers.d/trove
Defaults:trove !requiretty
trove ALL=(ALL) NOPASSWD:ALL
# 源码已下载
cd /home/trove/trove
git checkcout stable/pike
pip install -r requirements.txt
python setup.py install
bug:
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
yum install pyhton-devel
python setup.py install
5.创建启动文件
mkdir -p /etc/trove/conf.d
chown -R trove:trove /etc/trove
mkdir -p /var/lib/trove
chown -R trove:trove /var/lib/trove
mkdir -p /var/log/trove
chown -R trove:trove /var/log/trove
touch /etc/trove/conf.d/trove-guestagent.conf
touch /etc/trove/conf.d/guest_info.conf
vim /etc/trove/conf.d/guest_info.conf
[DEFAULT]
guest_id = none
chown -R trove:trove /etc/trove
cat /usr/lib/systemd/system/trove-guestagent.service
[Unit]
Description=OpenStack Trove guestagent Service
After=syslog.target network.target
[Service]
Type=simple
User=trove
ExecStart=/usr/bin/trove-guestagent --config-file /etc/trove/conf.d/trove-guestagent.conf --config-file /etc/trove/conf.d/guest_info.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]
Description=OpenStack Trove guestagent Service
After=syslog.target network.target
[Service]
Type=simple
User=trove
ExecStart=/usr/bin/trove-guestagent --config-file /etc/trove/conf.d/trove-guestagent.conf --config-file /etc/trove/conf.d/guest_info.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable trove-guestagent.service
7.创建mysql拷贝文件,加入开机启动
vim /root/mysql.sh
mysql_cnf="/home/trove/.my.cnf"
function mv_mysql_cnf(){
while ((1==1))
do
if [[ -f $mysql_cnf ]]
then
cp $mysql_cnf /root/
break
fi
done
}
mv_mysql_cnf
chmod +x /root/mysql.sh
vim /etc/rc.d/rc.local
/root/mysql.sh &
chmod +x /etc/rc.d/rc.local
8.验证
trove-manage --config-file /etc/trove/trove.conf datastore_version_update mysql mysql-5.7 mysql 3aea56f7-8451-451d-b4b1-8f9e87a1f8b6 '' 1
trove create ab_57 2 --size 5 --databases myDB --users tulong:tulong@123 --datastore_version mysql-5.7 --datastore mysql --nic net-id=ab9c9463-ea02-4b60-b559-1857e5ebfc13
trove list
trove user-list
trove creat-user zhangsan zhansan@123
trove user-list
9.bug
1. /var/log/trove-geustagent.log
2019-05-29 17:17:51.380 840 DEBUG oslo_concurrency.processutils [-] CMD "sudo cat /root/.mysql_secret" returned: 1 in 0.042s execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409
2019-05-29 17:17:51.381 840 DEBUG oslo_concurrency.processutils [-] u'sudo cat /root/.mysql_secret' failed. Not Retrying. execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:457
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service [-] /root/.mysql_secret does not exist.: ProcessExecutionError: Unexpected error while running command.
Command: sudo cat /root/.mysql_secret
Exit code: 1
Stdout: u''
Stderr: u'cat: /root/.mysql_secret: No such file or directory\n'
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service Traceback (most recent call last):
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py", line 96, in clear_expired_password
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service run_as_root=True, root_helper="sudo")
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 424, in execute
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service cmd=sanitized_cmd)
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service ProcessExecutionError: Unexpected error while running command.
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service Command: sudo cat /root/.mysql_secret
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service Exit code: 1
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service Stdout: u''
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service Stderr: u'cat: /root/.mysql_secret: No such file or directory\n'
2019-05-29 17:17:51.381 840 ERROR trove.guestagent.datastore.mysql_common.service
2019-05-29 17:17:51.382 840 DEBUG trove.guestagent.datastore.mysql_common.service [-] Generating admin password. secure /usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py:696
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager [-] An error occurred preparing datastore: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)")
(Background on this error at: http://sqlalche.me/e/e3q8): OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)")
(Background on this error at: http://sqlalche.me/e/e3q8)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager Traceback (most recent call last):
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/manager.py", line 285, in _prepare
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager cluster_config, snapshot)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 160, in wrapper
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager result = f(*args, **kwargs)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/manager.py", line 233, in do_prepare
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager app.secure(config_contents)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py", line 700, in secure
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager with self.local_sql_client(engine, use_flush=False) as client:
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py", line 186, in __enter__
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self.conn = self.engine.connect()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2193, in connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return self._connection_cls(self, **kwargs)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 103, in __init__
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager else engine.raw_connection()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2293, in raw_connection
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self.pool.unique_connection, _connection
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager e, dialect, self
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager util.raise_from_cause(sqlalchemy_exception, exc_info)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager reraise(type(exception), exception, tb=exc_tb, cause=cause)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return fn()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return _ConnectionFairy._checkout(self)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager fairy = _ConnectionRecord.checkout(pool)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager rec = pool._do_get()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self._dec_overflow()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager compat.reraise(exc_type, exc_value, exc_tb)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return self._create_connection()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return _ConnectionRecord(self)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self.__connect(first_connect_check=True)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager connection = pool._invoke_creator(self)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return dialect.connect(*cargs, **cparams)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 451, in connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return self.dbapi.connect(*cargs, **cparams)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in Connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager return Connection(*args, **kwargs)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 325, in __init__
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self.connect()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 599, in connect
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager self._request_authentication()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 861, in _request_authentication
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager auth_packet = self._read_packet()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 684, in _read_packet
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager packet.check_error()
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager err.raise_mysql_exception(self._data)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager raise errorclass(errno, errval)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)")
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager (Background on this error at: http://sqlalche.me/e/e3q8)
2019-05-29 17:17:51.586 840 ERROR trove.guestagent.datastore.manager
2019-05-29 17:17:51.727 840 INFO trove.guestagent.datastore.manager [-] Ending datastore prepare for 'mysql'.
2019-05-29 17:17:51.727 840 INFO trove.guestagent.datastore.service [-] Set final status to failed to spawn.
2019-05-29 17:17:51.728 840 DEBUG trove.guestagent.datastore.service [-] Casting set_status message to conductor (status is 'failed to spawn'). set_status /usr/lib/python2.7/site-packages/trove/guestagent/datastore/service.py:166
2019-05-29 17:17:51.730 840 DEBUG trove.conductor.api [-] Making async call to cast heartbeat for instance: 0d2b580c-6ad6-496b-b7e3-fe20bde31ec3 heartbeat /usr/lib/python2.7/site-packages/trove/conductor/api.py:73
2019-05-29 17:17:51.740 840 DEBUG trove.guestagent.datastore.service [-] Successfully cast set_status. set_status /usr/lib/python2.7/site-packages/trove/guestagent/datastore/service.py:173
2019-05-29 17:17:51.742 840 DEBUG trove.conductor.api [-] Making async call to cast error notification notify_exc_info /usr/lib/python2.7/site-packages/trove/conductor/api.py:116
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server [-] Exception during message handling: OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)")
(Background on this error at: http://sqlalche.me/e/e3q8)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 274, in dispatch
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 160, in wrapper
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/manager.py", line 270, in prepare
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server cluster_config, snapshot, modules)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/manager.py", line 285, in _prepare
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server cluster_config, snapshot)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 160, in wrapper
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server result = f(*args, **kwargs)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/manager.py", line 233, in do_prepare
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server app.secure(config_contents)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py", line 700, in secure
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server with self.local_sql_client(engine, use_flush=False) as client:
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/trove/guestagent/datastore/mysql_common/service.py", line 186, in __enter__
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self.conn = self.engine.connect()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2193, in connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return self._connection_cls(self, **kwargs)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 103, in __init__
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server else engine.raw_connection()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2293, in raw_connection
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self.pool.unique_connection, _connection
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2266, in _wrap_pool_connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server e, dialect, self
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1536, in _handle_dbapi_exception_noconnection
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server util.raise_from_cause(sqlalchemy_exception, exc_info)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server reraise(type(exception), exception, tb=exc_tb, cause=cause)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return fn()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 303, in unique_connection
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return _ConnectionFairy._checkout(self)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 760, in _checkout
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server fairy = _ConnectionRecord.checkout(pool)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 492, in checkout
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server rec = pool._do_get()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self._dec_overflow()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server compat.reraise(exc_type, exc_value, exc_tb)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return self._create_connection()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return _ConnectionRecord(self)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 437, in __init__
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self.__connect(first_connect_check=True)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/pool/base.py", line 639, in __connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server connection = pool._invoke_creator(self)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return dialect.connect(*cargs, **cparams)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 451, in connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return self.dbapi.connect(*cargs, **cparams)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in Connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server return Connection(*args, **kwargs)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 325, in __init__
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self.connect()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 599, in connect
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server self._request_authentication()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 861, in _request_authentication
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server auth_packet = self._read_packet()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 684, in _read_packet
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server packet.check_error()
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server err.raise_mysql_exception(self._data)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server raise errorclass(errno, errval)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)")
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server (Background on this error at: http://sqlalche.me/e/e3q8)
2019-05-29 17:17:51.755 840 ERROR oslo_messaging.rpc.server
touch /root/.secert
chmod 755 /root/.secret
#2.修复上述bu,重新创建实例:
vim /var/log/trove-guestagent.log
_concurrency/processutils.py:409
2019-05-29 18:10:12.733 842 DEBUG oslo_concurrency.processutils [-] u'sudo systemctl start mysqld' failed. Not Retrying. execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:457
2019-05-29 18:10:12.734 842 DEBUG oslo_concurrency.processutils [-] Running cmd (subprocess): sudo /usr/bin/mysqladmin ping execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372
2019-05-29 18:10:12.908 842 DEBUG oslo_concurrency.processutils [-] CMD "sudo /usr/bin/mysqladmin ping" returned: 1 in 0.174s execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409
2019-05-29 18:10:12.908 842 DEBUG oslo_concurrency.processutils [-] u'sudo /usr/bin/mysqladmin ping' failed. Not Retrying. execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:457
2019-05-29 18:10:12.909 842 ERROR trove.common.utils [-] Command 'sudo /usr/bin/mysqladmin ping' failed. Exit code: 1
stderr: ^Gmysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
stdout: : ProcessExecutionError: Unexpected error while running command.
2019-05-29 18:10:12.910 842 ERROR trove.guestagent.datastore.mysql_common.service [-] Failed to get database status.: ProcessExecutionError: Unexpected error while running command.
Command: sudo /usr/bin/mysqladmin ping
Exit code: 1
Stdout: u''
Stderr: u"\x07mysqladmin: connect to server at 'localhost' failed\nerror: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'\nCheck that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!\n"
可以查看到mysql服务进程没有正常启动
vim /var/log/mysqld.log
2019-05-29T10:09:53.576866Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.26) starting as process 2463 ...
2019-05-29T10:09:53.608137Z 0 [Note] InnoDB: PUNCH HOLE support available
2019-05-29T10:09:53.608195Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-29T10:09:53.608202Z 0 [Note] InnoDB: Uses event mutexes
2019-05-29T10:09:53.608205Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-05-29T10:09:53.608208Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-05-29T10:09:53.608214Z 0 [Note] InnoDB: Using Linux native AIO
2019-05-29T10:09:53.608818Z 0 [Note] InnoDB: Number of pools: 1
2019-05-29T10:09:53.609073Z 0 [Note] InnoDB: Using CPU crc32 instructions
2019-05-29T10:09:53.613009Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-05-29T10:09:53.656199Z 0 [Note] InnoDB: Completed initialization of buffer pool
2019-05-29T10:09:53.685704Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-05-29T10:09:53.697395Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2019-05-29T10:09:53.697720Z 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2019-05-29T10:09:54.659961Z 0 [Note] InnoDB: File './ibdata1' size is now 12 MB.
2019-05-29T10:09:54.660616Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2019-05-29T10:09:56.267639Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2019-05-29T10:09:57.808737Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-05-29T10:09:57.808847Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-05-29T10:09:57.808872Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-05-29T10:09:57.808924Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-05-29T10:09:58.190716Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2019-05-29T10:09:58.190993Z 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-05-29T10:09:58.433915Z 0 [Note] InnoDB: Doublewrite buffer created
2019-05-29T10:09:58.442027Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2019-05-29T10:09:58.442049Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2019-05-29T10:09:58.442229Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-05-29T10:09:58.521762Z 0 [Note] InnoDB: Foreign key constraint system tables created
2019-05-29T10:09:58.521877Z 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-05-29T10:09:58.542715Z 0 [Note] InnoDB: Tablespace and datafile system tables created.
2019-05-29T10:09:58.542801Z 0 [Note] InnoDB: Creating sys_virtual system tables.
2019-05-29T10:09:58.564689Z 0 [Note] InnoDB: sys_virtual table created
2019-05-29T10:09:58.566609Z 0 [Note] InnoDB: Waiting for purge to start
2019-05-29T10:09:58.616728Z 0 [Note] InnoDB: 5.7.26 started; log sequence number 0
2019-05-29T10:09:58.617297Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2019-05-29T10:09:58.617565Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
vim /etc/my.cnf
explicit_defaults_for_timestamp=true
备注:mysql5.5、mysql5.6部署完毕后root密码为空,因此trove-guest-agent初始化的代码逻辑是默认mysql的root密码是空的,但是mysql5.7部署完毕后root密码是随机的,所以我们需要重新将root密码为空。mysql5.7默认安装validate_password plugin,导致trove所有创建或者修改密码的字符串都要严格遵循密码安全等级,需要卸载。
mysql 5.7安装完成,在/var/log/mysqld.log 中会生成临时密码,如果有多个,最后一个起作用。
/var/log/mysqld.log
2019-05-29T10:34:10.064386Z 1 [Note] A temporary password is generated for root@localhost: 8-hy:kMH*uS5
temporary_password=$(grep 'root@localhost' $log_file | tail -1 | awk -F 'root@localhost: ' '{print $NF}')
mysql -uroot -p$temporary_password -e "set password=password('my new password');uninstall plugin validate_password;set password=password('');flush privileges;"
Linux运维----03.制作trove-mysql5.7镜像的更多相关文章
- Linux运维---02.制作trove-redis镜像
redis-3.2 镜像制作及验证 镜像制作 1.安装redis yum install redis yum install epl-release yum install python-pip gi ...
- 马哥linux运维初级+中级+高级 视频教程 教学视频 全套下载(近50G)
马哥linux运维初级+中级+高级 视频教程 教学视频 全套下载(近50G)目录详情:18_02_ssl协议.openssl及创建私有CA18_03_OpenSSH服务及其相关应用09_01_磁盘及文 ...
- linux运维中的命令梳理(一)
在linux日常运维中,我们平时会用到很多常规的操作命令. 下面对常用命令进行梳理: 命令行日常系快捷键(不分大小写)CTRL + A 移动光标到行首CTRL + E 移动光标到行末CTRL + U ...
- Linux运维笔记-日常操作命令总结(1)
在linux日常运维中,我们平时会用到很多常规的操作命令. 查看服务器的外网ip [root@redis-new01 ~]# curl ifconfig.me [root@redis-new01 ~] ...
- 高级Linux运维工程师必备技能(扫盲篇)
高级Linux运维工程师必备技能(扫盲篇) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 在了解文件系统之前,我们要学习一下磁盘存储数据的方式,大家都知道文件从内存若要持久化存储的 ...
- Linux运维博客大全
系统 U盘安装Linux详细步骤_hanxh7的博客-CSDN博客_u盘安装linux 使用U盘安装linux系统 - lwenhao - OSCHINA 各厂商服务器存储默认管理口登录信息(默认IP ...
- Linux运维入门到高级全套常用要点
Linux运维入门到高级全套常用要点 目 录 1. Linux 入门篇................................................................. ...
- linux运维中的命令梳理(二)
回想起来,从事linux运维工作已近5年之久了,日常工作中会用到很多常规命令,之前简单罗列了一些命令:http://www.cnblogs.com/kevingrace/p/5985486.html今 ...
- Linux运维工程师成长必经之路
本路线图是从0基础开始,全方位由浅入深,按照多年Linux培训经验和优秀教学方法制定的学习思路和学习方法,路线图包括初级入门.中级进阶.高级提升和资深冲刺四个阶段,每阶段对应着不同优秀的课程和学习方法 ...
随机推荐
- 【Docker】 windows10 docker 使用
原文地址:https://www.aliyun.com/jiaocheng/872144.html 摘要:docker之前在Windows和MacOS上的版本都是通过Linux虚拟机的形式,而现在Do ...
- 客户端 jQuery 跨端口 调用 node 服务端
一句话 很顶用 response.setHeader('Access-Control-Allow-Origin', 'http://127.0.0.1:8020'); 说 响应的头文件里设置 一个 h ...
- git使用中遇到的问题
1.拉取时报错:Permission denied (publickey) 先检查一下你的乌龟设置是否用的不是乌龟自己的SSH 2.TortoiseGit报错: Couldn’t load this ...
- FileZilla 报错“the server's certificate is unknown”
FileZilla 是非常好用的一款FTP SFTP 管理工具. 但是filezilla会报错“the server's certificate is unknown” 并且会在window中看到以下 ...
- wirkshark过滤规则
https://blog.csdn.net/wojiaopanpan/article/details/69944970
- Shell之作业控制
命令 含义 jobs 列出所有正在运行的作业 ^Z(Ctrl+z) 暂停作业 bg 启动被暂停的作业 fg 将后台作业调到前台 kill 向指定作业发送kill信号 nohup 忽略所有发送给子命令的 ...
- react 获取input的值 ref 和 this.setState({})
1.ref //class my_filter(reg){ const inpVal = this.input.value; console.log(inpVal) ...
- js原型和原型链的简单理解
构造函数创建对象: function Person() { } var person = new Person(); person.name = 'Tian'; console.log(person. ...
- 消息中间件面试题31道RabbitMQ+ActiveMQ+Kafka
消息中间件面试题31道RabbitMQ+ActiveMQ+Kafka 前言 文章开始前,我们先了解一下什么是消息中间件? 什么是中间件? 非底层操作系统软件,非业务应用软件,不是直接给最终用户使用的, ...
- Python 语言规范(Google)
Python语言规范 Lint tip 对你的代码运行pylint 定义: pylint是一个在Python源代码中查找bug的工具. 对于C和C++这样的不那么动态的(译者注: 原文是less dy ...