Description
在进行后端与前端部署的时候,遇到多处报错信息,请协助解决。
基础依赖:
安装DNS
systemctl status dnsmasq:
● dnsmasq.service - DNS caching server.
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2022-05-29 20:06:47 PDT; 940ms ago
Process: 6255 ExecStart=/usr/sbin/dnsmasq -k (code=exited, status=2)
Main PID: 6255 (code=exited, status=2)
May 29 20:06:47 localhost.localdomain systemd[1]: Started DNS caching server..
May 29 20:06:47 localhost.localdomain dnsmasq[6255]: dnsmasq: failed to create listenin...e
May 29 20:06:47 localhost.localdomain systemd[1]: dnsmasq.service: main process exited...NT
May 29 20:06:47 localhost.localdomain systemd[1]: Unit dnsmasq.service entered failed ...e.
May 29 20:06:47 localhost.localdomain systemd[1]: dnsmasq.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
安装websdk
[root@localhost src]# pip3 install -U git+https://github.com/ss1917/ops_sdk.git
Collecting git+https://github.com/ss1917/ops_sdk.git
Cloning https://github.com/ss1917/ops_sdk.git to /tmp/pip-req-build-bgdi1mg4
Running command git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-bgdi1mg4
fatal: unable to access 'https://github.com/ss1917/ops_sdk.git/': Could not resolve host: github.com; Unknown error
WARNING: Discarding git+https://github.com/ss1917/ops_sdk.git. Command errored out with exit status 128: git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-bgdi1mg4 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-bgdi1mg4 Check the logs for full command output.
管理后端:
创建数据库:
[root@localhost codo-admin]# mysql -h127.0.0.1 -u${DEFAULT_DB_DBUSER} -p${MYSQL_PASSWORD} -e 'create database codo_admin default character set utf8mb4 collate utf8mb4_unicode_ci;'
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
初始化表结构
[root@localhost src]# pip3 install -U git+https://github.com/ss1917/ops_sdk.git
Collecting git+https://github.com/ss1917/ops_sdk.git
Cloning https://github.com/ss1917/ops_sdk.git to /tmp/pip-req-build-h9ijqdjk
Running command git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-h9ijqdjk
fatal: unable to access 'https://github.com/ss1917/ops_sdk.git/': Could not resolve host: github.com; Unknown error
WARNING: Discarding git+https://github.com/ss1917/ops_sdk.git. Command errored out with exit status 128: git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-h9ijqdjk Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q https://github.com/ss1917/ops_sdk.git /tmp/pip-req-build-h9ijqdjk Check the logs for full command output.
创建数据库:
[root@localhost codo-admin]# mysql -h127.0.0.1 -u${DEFAULT_DB_DBUSER} -p${MYSQL_PASSWORD} -e 'create database codo_admin default character set utf8mb4 collate utf8mb4_unicode_ci;'
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
初始化表结构
[root@localhost codo-admin]# python3 db_sync.py
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 583, in connect
**kwargs)
File "/usr/lib64/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/lib64/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
return fn()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self.dec_overflow()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
with_traceback=exc_tb,
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 440, in init
self.__connect(first_connect_check=True)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 661, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
with_traceback=exc_tb,
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 508, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.6/site-packages/pymysql/init.py", line 94, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 325, in init
self.connect()
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 630, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.30.146' ([Errno 111] Connection refused)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "db_sync.py", line 42, in
create()
File "db_sync.py", line 29, in create
Base.metadata.create_all(engine)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/sql/schema.py", line 4664, in create_all
ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2094, in _run_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "/usr/lib64/python3.6/contextlib.py", line 81, in enter
return next(self.gen)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2086, in _optional_conn_ctx_manager
with self._contextual_connect() as conn:
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2302, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2340, in wrap_pool_connect
e, dialect, self
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1584, in handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from=e
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 2336, in _wrap_pool_connect
return fn()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self.dec_overflow()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
with_traceback=exc_tb,
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 440, in init
self.__connect(first_connect_check=True)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 661, in _connect
pool.logger.debug("Error on connect(): %s", e)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit
with_traceback=exc_tb,
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 508, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/usr/local/lib/python3.6/site-packages/pymysql/init.py", line 94, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 325, in init
self.connect()
File "/usr/local/lib/python3.6/site-packages/pymysql/connections.py", line 630, in connect
raise exc
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '192.168.30.146' ([Errno 111] Connection refused)")
(Background on this error at: http://sqlalche.me/e/13/e3q8)
导入数据:
[root@localhost codo-admin]# mysql -h127.0.0.1 -u${DEFAULT_DB_DBUSER} -p${MYSQL_PASSWORD} codo_admin < ./doc/codo_admin_beta0.3.sql
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
启动
[root@localhost bin]# pm2 start pm2.json
bash: pm2: command not found...
项目前端:
[root@localhost codo]# set registry https://registry.npmjs.org/
[root@localhost codo]# cache clean --force
bash: cache: command not found...
[root@localhost codo]# clean --force
bash: clean: command not found...
[root@localhost codo]# set clean --force
[root@localhost codo]# install --ignore-script
install: unrecognized option '--ignore-script'
Try 'install --help' for more information.
[root@localhost codo]# set install --ignore-script
[root@localhost codo]# set run build
[root@localhost codo]# mkdir -p /var/www/codo
[root@localhost codo]# cp -rp dist/* /var/www/codo/
cp: cannot stat ‘dist/’: No such file or directory
[root@localhost codo]# mkdir -p /var/www/codo && cp -rp dist/ /var/www/codo/
cp: cannot stat ‘dist/*’: No such file or directory