【测试平台】Odin-ws 工程环境部署

背景:

这个是我4年半以前接受测试平台过程中遇到问题记录,因为交接成都这边,拿出来直接用了。这里做个记录。

一、美东测试服务器相关

1.主服务器部署机器

该机器是美东服务器。

机器配置:t5.xlarge cpu 4核, 内存 8G。

  • 主程序部署目录:/home/odin-ws

  • 每次执行服务端接口自动化拉取kenzo放置目录:/data/odin-ws_archive/kenzo_space/

  • /odin-ws/deploy.sh 部署文件中有对应的 odin_ws_archive 配置

2.技术栈:

odin-ws后端工程使用到的技术栈:python+flask+celery+redis+mysql+decoker

接口自动化使用到的技术栈:python+pytest+auller

前端页面技术栈:vue+js

二、美东服务器部署

1.更新odin-ws 代码

2.开启防火墙

防火墙必须是在开启状态下,进行步骤安装,才能下载到依赖包。否则部署安装会报错

# 查看防火墙状态。 这个时候应该是关闭的
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)Active: inactive (dead) since Mon 2023-08-14 17:18:23 CST; 1h 12min agoDocs: man:firewalld(1)Process: 25525 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)Main PID: 25525 (code=exited, status=0/SUCCESS)Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future releas...ling it now.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Aug 14 17:18:23 liveme-qa-odin-ws-use1a-1 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Aug 14 17:18:24 liveme-qa-odin-ws-use1a-1 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.# 开启防火墙
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl start firewalld
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)Active: active (running) since Mon 2023-08-14 17:14:43 CST; 4s agoDocs: man:firewalld(1)Main PID: 25525 (firewalld)Tasks: 2Memory: 21.9MCGroup: /system.slice/firewalld.service└─25525 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopidAug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future releas...ling it now.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Hint: Some lines were ellipsized, use -l to show in full.

3.部署odin-ws服务

# 查看现在跑的odin-ws 的版本号
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
4ed4b2ed3780        odin-ws:35          "gunicorn --config..."   About an hour ago   Up About an hour                                   odin-ws
14ecb697e472        ae28c0361d82        "/bin/sh -c 'pip3 ..."   About an hour ago   Exited (1) About an hour ago                       pensive_lamarr
b0d9e02a2d0b        odin-celery         "celery -A manage:..."   11 days ago         Exited (0) 11 days ago                             odin-celery
b845942370e6        redis               "docker-entrypoint..."   12 days ago         Exited (1) 12 days ago                             naughty_yalow
2b65046f05bd        43a198b3e303        "/bin/sh -c 'apt-k..."   2 months ago        Exited (0) 11 days ago                             romantic_kilby
# 通过deplay.sh 脚本部署odin-ws程序,在现有的版本号上+1,比如现在的版本号是35,那么新程序部署版本号为36
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sh deploy.sh 36
......
Successfully installed Deprecated-1.2.13 Flask-2.0.2 Flask-Cors-3.0.10 Flask-SQLAlchemy-2.4.1 Flask-SocketIO-5.1.1 GitPython-3.1.26 Jinja2-3.0.3 MarkupSafe-2.0.1 Naked-0.1.31 PyMySQL-1.0.2 PyYAML-6.0 SQLAlchemy-1.3.24 Werkzeug-2.0.2 addict-2.4.0 amqp-5.0.9 attrs-21.4.0 bidict-0.21.4 billiard-3.6.4.0 cached-property-1.5.2 celery-5.2.3 certifi-2021.10.8 charset-normalizer-2.0.11 click-8.0.3 click-didyoumean-0.3.0 click-plugins-1.1.1 click-repl-0.2.0 dnspython-1.16.0 eventlet-0.30.2 execnet-1.9.0 gevent-21.12.0 gevent-websocket-0.10.1 gitdb-4.0.9 greenlet-1.1.2 gunicorn-20.1.0 idna-3.3 importlib-metadata-4.10.1 iniconfig-1.1.1 itsdangerous-2.0.1 kombu-5.2.3 packaging-21.3 passlib-1.7.4 pluggy-1.0.0 prompt-toolkit-3.0.26 protobuf-3.19.4 py-1.11.0 pycryptodome-3.9.8 pyparsing-3.0.7 pytest-7.0.0 pytest-forked-1.4.0 pytest-xdist-2.5.0 python-engineio-4.3.1 python-socketio-5.5.1 pytz-2021.3 redis-3.5.3 requests-2.27.1 setuptools-59.6.0 shellescape-3.8.1 six-1.16.0 smmap-5.0.0 tomli-2.0.0 typing_extensions-4.0.1 urllib3-1.26.8 vine-5.0.0 wcwidth-0.2.5 wheel-0.37.1 wrapt-1.13.3 yacs-0.1.8 zipp-3.7.0 zope.event-4.5.0 zope.interface-5.4.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv---> e2d7c548e6de
Removing intermediate container 72ddfea1b27e
Step 11/17 : EXPOSE 8899---> Running in 7996170d26f3---> 01bdefd78cc0
Removing intermediate container 7996170d26f3
Step 12/17 : ENV FLASK_CONFIG prod---> Running in d5b5cc06359f---> b053c0d89cde
Removing intermediate container d5b5cc06359f
Step 13/17 : ENV KENZO_ENV server---> Running in 65b7450f2b24---> 104ec0180db1
Removing intermediate container 65b7450f2b24
Step 14/17 : ENV JAVA_HOME /home/odin-ws/jdk1.8---> Running in 79cb6370ff08---> a85afc456161
Removing intermediate container 79cb6370ff08
Step 15/17 : ENV PATH $JAVA_HOME/bin:$PATH---> Running in 90a41cdecf74---> eac782b72a05
Removing intermediate container 90a41cdecf74
Step 16/17 : ENV CLASSPATH .:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar---> Running in ead9877fac19---> 0884bf118cf1
Removing intermediate container ead9877fac19
Step 17/17 : CMD gunicorn --config /home/odin-ws/gunicorn_config.py manage:app---> Running in 94733a698982---> 514a34388744
Removing intermediate container 94733a698982
Successfully built 514a34388744
build odin-ws image finished!
5.run odin-ws container···
3b865956d033791f4468efdf6a17b90b0fa6a1bc27920c13187b66b34b2a9b48
6.check the running odin-ws container···
3b865956d033        odin-ws:36          "gunicorn --config..."   Less than a second ago   Up Less than a second                              odin-ws
run container done!
success!!!

4.关闭防火墙

只有关闭了防火墙,odin前端才能访问到odin-ws的接口

# 关闭防火墙。
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl stop firewalld
# 查看防火墙状态- 必须为已关闭
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)Active: inactive (dead) since Mon 2023-08-14 17:08:35 CST; 3min 23s agoDocs: man:firewalld(1)Process: 24140 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)Main PID: 24140 (code=exited, status=0/SUCCESS)

5.进入docker容器启动celery

# 查看重新部署的odin-ws服务的容器id[root@liveme-qa-odin-ws-use1a-1 odin-ws]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
4ed4b2ed3780        odin-ws:35          "gunicorn --config..."   2 minutes ago       Up 2 minutes                                    odin-ws
14ecb697e472        ae28c0361d82        "/bin/sh -c 'pip3 ..."   18 minutes ago      Exited (1) 15 minutes ago                       pensive_lamarr
b0d9e02a2d0b        odin-celery         "celery -A manage:..."   11 days ago         Exited (0) 11 days ago                          odin-celery
b845942370e6        redis               "docker-entrypoint..."   11 days ago         Exited (1) 11 days ago                          naughty_yalow
2b65046f05bd        43a198b3e303        "/bin/sh -c 'apt-k..."   2 months ago        Exited (0) 11 days ago                          romantic_kilby# 进入odin-ws服务的容器,启动celery
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# docker exec -it 4ed4b2ed3780 /bin/bash
root@liveme-qa-odin-ws-use1a-1:/home/odin-ws# celery -A manage.celery worker -l INFO# 启动一个新的 shell 窗口,运行下面的命令
[liuxiaomei@liveme-qa-odin-ws-use1a-1 ~]$ sudo su
[root@liveme-qa-odin-ws-use1a-1 liuxiaomei]#  docker exec -it 4ed4b2ed3780 /bin/bash
root@liveme-qa-odin-ws-use1a-1:/home/odin-ws# celery -A manage.celery beat
Server initialized for eventlet.
2023-08-14 17:25:33 - redis_util.py:14 - INFO: cmd=MyRedis.__init__:Redis<ConnectionPool<Connection<host=10.66.100.133,port=6379,db=0>>>
2023-08-14 17:25:33 - __init__.py:29 - INFO: script_list:['scripts.auto_gmail', 'scripts.celery_task', 'scripts.firebase', 'scripts.kenzo_auto_task']
2023-08-14 17:25:33 - redis_util.py:14 - INFO: cmd=MyRedis.__init__:Redis<ConnectionPool<Connection<host=10.66.100.133,port=6379,db=0>>>

6.检查odin中的kenzo功能

  • odin前端页面创建一个master 线上p0 case的任务,是否可以正常执行

  • 自动化工程定时任务可以正常执行

三.测试平台工程功能介绍

服务端接口自动化

用来定时启动和执行服务端接口自动化测试

前端代码路径

LiveMeHydra/src/views/kenzo/

LiveMeHydra/src/api/kenzo.js

后端代码路径

后端接口:odin-ws/application/kenzo/

异步任务:odin-ws/scripts/kenzo_auto_task.py

数据库增删改查:odin-ws/models/dao/kenzo.py

数据库表结构:odin-ws/models/kenzo.py

通用工具:odin-ws/utils/kenzo_util.py

四、有用的经验

1.服务器执行用例

因为测试服务是通过docker部署的,所以如果想在 服务器上执行kenzo用例,需要进入对应的docker容器,才能执行

sudo su docker ps -a
docker exec -it 2e6a8cea9ead /bin/bash
cd kenzo_space/1644573245/Kenzo
python -m venv venv && source venv/bin/activate && python -m pytest tests/featurelist_all/test_featurelist.py -x -v --durations=0

2.服务器上查看运行日志

[root@liveme-qa-odin-ws-use1a-1 odin-ws]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
3b865956d033        odin-ws:36          "gunicorn --config..."   4 minutes ago       Up 4 minutes                                       odin-ws
14ecb697e472        ae28c0361d82        "/bin/sh -c 'pip3 ..."   About an hour ago   Exited (1) About an hour ago                       pensive_lamarr
b0d9e02a2d0b        odin-celery         "celery -A manage:..."   11 days ago         Exited (0) 11 days ago                             odin-celery
b845942370e6        redis               "docker-entrypoint..."   12 days ago         Exited (1) 12 days ago                             naughty_yalow
2b65046f05bd        43a198b3e303        "/bin/sh -c 'apt-k..."   2 months ago        Exited (0) 11 days ago                             romantic_kilby[root@liveme-qa-odin-ws-use1a-1 odin-ws]# docker logs -f 3b865956d033
Server initialized for eventlet.
2023-08-14 18:32:44 - redis_util.py:14 - INFO: cmd=MyRedis.__init__:Redis<ConnectionPool<Connection<host=10.66.100.133,port=6379,db=0>>>
2023-08-14 18:32:44 - __init__.py:29 - INFO: script_list:['scripts.auto_gmail', 'scripts.celery_task', 'scripts.firebase', 'scripts.kenzo_auto_task']
2023-08-14 18:32:44 - redis_util.py:14 - INFO: cmd=MyRedis.__init__:Redis<ConnectionPool<Connection<host=10.66.100.133,port=6379,db=0>>>
2023-08-14 18:38:26 - views.py:289 - INFO: kenzo/list POSTdata={'page_index': 1, 'page_size': 10, 'start_time': '', 'end_time': '', 'task_type': 'all', 'operator': '', 'case_type': 'all'}
2023-08-14 18:38:42 - views.py:86 - INFO: /kenzo/task POSTdata={'branch': 'master', 'environment': 'online1', 'scope': 'p0', 'cases': '', 'operator': 'liuxiaomei@joyme.sg', 'task_type': 'manual'}
2023-08-14 18:38:42 - views.py:117 - INFO: cmd=KenzoTask.server的值:no server
2023-08-14 18:38:42 - views.py:155 - INFO: cmd=KenzoTask 调用异步任务结果->4413a710-a68a-45a5-8f59-f3964f95cc91
2023-08-14 18:38:42 - views.py:156 - INFO: cmd=------><celery.backends.redis.RedisBackend object at 0x7f3c96c0ef90>
2023-08-14 18:38:42 - views.py:163 - INFO: cmd=KenzoTask.scope入参:p0
2023-08-14 18:38:42 - app.py:1458 - ERROR: Exception on /kenzo/task [POST]
Traceback (most recent call last):File "/home/odin-ws/application/kenzo/views.py", line 186, in postkenzo.add_kenzo_task(**kwargs)File "/home/odin-ws/models/dao/__init__.py", line 26, in innerres = func(*args, **kwargs)File "/home/odin-ws/models/dao/kenzo.py", line 125, in add_kenzo_tasktask_info = KenzoTask(**kwargs)
TypeError: __init__() missing 5 required positional arguments: 'html_path', 'collected_case_num', 'failed_case_num', 'case_status', and 'failed_case'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_appresponse = self.full_dispatch_request()File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_requestrv = self.handle_user_exception(e)File "/usr/local/lib/python3.7/site-packages/flask_cors/extension.py", line 165, in wrapped_functionreturn cors_after_request(app.make_response(f(*args, **kwargs)))File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_requestrv = self.dispatch_request()File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_requestreturn self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 84, in viewreturn current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 158, in dispatch_requestreturn current_app.ensure_sync(meth)(*args, **kwargs)File "/home/odin-ws/application/kenzo/views.py", line 188, in postkenzo.update_kenzo_status(task_id, "FAILED")File "/home/odin-ws/models/dao/__init__.py", line 26, in innerres = func(*args, **kwargs)File "/home/odin-ws/models/dao/kenzo.py", line 147, in update_kenzo_statusres = KenzoTask.query.filter_by(task_id=task_id).one()File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py", line 3500, in oneraise orm_exc.NoResultFound("No row was found for one()")
sqlalchemy.orm.exc.NoResultFound: No row was found for one()

3.本地新安装了第三方库,写入到requirements.txt文件中

本地安装了新的第三方库,需要更新requirements.txt文件,否则服务器部署的时候,会失败

pip freeze > requirements.txt

4.Linux定时任务自动清理报告

因为接口自动化每天都在run,所以过一段时间500G磁盘空间就满,上定时任务执行/data/odin-ws/scripts/deletefile.sh 脚本(北京时间17点每天定时执行)

 

# 切换到root账号 [liuxiaomei@liveme-qa-odin-ws-use1a-1 scripts]$ sudo su # 查看系统定时任务,修改定时任务以后保存立马生效,北京时间17点每天定时执行 [root@liveme-qa-odin-ws-use1a-1 scripts]# crontab -e # 查看系统定时任务运行状态 [root@liveme-qa-odin-ws-use1a-1 scripts]#service crond status

5.odin-ws 美东服务器启动报/simple/addict/错误

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd779bba310>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/addict/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd779ba4c50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/addict/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd779bba790>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/addict/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd779bbab50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/addict/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd779bbaf10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/addict/
ERROR: Could not find a version that satisfies the requirement addict==2.4.0 (from versions: none)
ERROR: No matching distribution found for addict==2.4.0

检查防火墙状态,需要开启防火墙。如果防火墙状态是关闭的,请打开防火墙

[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl start firewalld
[root@liveme-qa-odin-ws-use1a-1 odin-ws]# sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)Active: active (running) since Mon 2023-08-14 17:14:43 CST; 4s agoDocs: man:firewalld(1)Main PID: 25525 (firewalld)Tasks: 2Memory: 21.9MCGroup: /system.slice/firewalld.service└─25525 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopidAug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future releas...ling it now.
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Aug 14 17:14:43 liveme-qa-odin-ws-use1a-1 firewalld[25525]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a ma...hat chain?).
Hint: Some lines were ellipsized, use -l to show in full.

6.odin-ws 美东服务请求正常,但是kenzo任务队列堆积均处于运行中

原因:

磁盘空间满了,导致任务无法写入文件

解决方案:

删除/data/odin-ws_archive/kenzo_space文件下的一些日志和老的报告

具体排查步骤

第一步:使用df -h查看磁盘空间占用情况
[root@qa-lm-awsuse1a-01 odin-ws]# df -h
Filesystem   Size Used Avail Use% Mounted on
devtmpfs    7.5G   0 7.5G  0% /dev
tmpfs      7.5G   0 7.5G  0% /dev/shm
tmpfs      7.5G 807M 6.7G 11% /run
tmpfs      7.5G   0 7.5G  0% /sys/fs/cgroup
/dev/nvme0n1p1  30G  14G  17G 46% /
/dev/nvme1n1  500G 500G 664M 100% /data
tmpfs      1.5G   0 1.5G  0% /run/user/0
tmpfs      1.5G   0 1.5G  0% /run/user/1003
tmpfs      1.5G   0 1.5G  0% /run/user/1014
overlay     500G 500G 664M 100% /data/docker/overlay2/0026d2fadfcd5bbf2710879845ee7f709e38d574f7c5e25465f94a89a60bd99b/merged
shm       64M   0  64M  0% /data/docker/containers/2f407899b6ccb028f19ae4e45fb4b32f7ce131fb0405be44b2ea5123a9588335/shm
tmpfs      1.5G   0 1.5G  0% /run/user/1017

第二步:使用du -h --max-depth=1查看当前目录下文件夹大小情况
[root@qa-lm-awsuse1a-01 data]# du -h --max-depth=1
0        ./scripts
137M        ./mydan
0        ./logs
13M        ./Software
4.8G        ./app
134M        ./mysql
478G        ./odin-ws_archive
5.6G        ./gcc-7.3.0
4.0K        ./__MACOSX
1.9G        ./protobuf-3.1.0
0        ./grafana
3.7G        ./docker
343M        ./odin-ws
494G        .

[root@qa-lm-awsuse1a-01 odin-ws_archive]# du -h --max-depth=1
9.7M        ./log
1.6G        ./jmeter_report
388M        ./jdk1.8
120M        ./jmeter1
120M        ./jmeter
1.1M        ./jmeter_script
19M        ./allure
476G        ./kenzo_space
478G        .

第三步:删除老的日志和报告

手动删除

cd /data/odin-ws_archive/kenzo_space
find ./ -ctime +7 -type d | xargs rm -rf
find ./ -ctime +7 -type f | xargs rm -rf
第四步:shell脚本定时删除

对应文件:odin-ws/script/deletfile.sh

定时任务

>crontab -e
0 0 * * * /data/odin-ws/scripts/deletefile.sh > /dev/null 2>&1

7.美东服务器启动报错

原因:由于deploy.sh文件被人修改,找不到构建的celery镜像

解决方案:撤销修改,重新启动

具体排查步骤

第一步:查看启动的容器:docker ps -a

第二步:查看docker镜像:docker images

然后删除掉 odin-celery 镜像

第三步:查看本地代码修改git status && git diff

第四步:撤销修改git reset --hard && git clean -df

第五步:启动程序sh deploy.sh v139 true

第六步:查看日志更新

/data/odin-ws_archive/kenzo_space/log 这个文件夹下的日志可以滚动更新

查看celery队列日志:docker logs -f xxx

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/883608.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ubuntu常用基本指令简记

一、在线帮助 1、help Linux命令可以分为内部命令和外部命令&#xff0c;内部命令就是由Linux默认Shell-bash提供的命令&#xff0c;而非bash提供的命令就是外部命令。 对于内部命令&#xff0c;可以使用help命令来获取帮助 形式为 help 指令 2、man 在日常使用中碰到的绝…

Android Junit 单元测试 | 依赖配置和编译报错解决

问题 为什么在依赖中添加了testImplement在build APK的时候还是会报错&#xff1f;是因为没有识别到test文件夹是test源代码路径吗&#xff1f; 最常见的配置有: implementation - 所有源代码集(包括test源代码集)中都有该依赖库.testImplementation - 依赖关系仅在test源代码…

如何将png格式的图片做成序列帧

类似以上的图片&#xff0c;根据图片的总长度和图片总数进行计算 <div class"frogeggitem"></div>.frogeggitem {width: 900rpx;height: 1000rpx;background: url(https://frog-skin.haoxgame.com/status2/frog/frogegg.png)no-repeat;background-size:…

学习笔记——动态路由——OSPF(距离矢量协议)OSPF路由类型

OSPF路由类型 在OSPF中&#xff0c;路由类型指的是不同种类的路由&#xff0c;用于描述网络中不同的路由信息及其传输方式。 1、Intra Area路由(区域内路由) Intra Area路由(区域内路由/本地路由/内部路由)是OSPF协议中的一种路由类型&#xff0c;用于描述在同一个OSPF区域内…

图像处理 -- AWB白平衡中的QX与QY的原理与用法

ISP AWB 中的 QX 与 QY 1. QX 与 QY 的含义与作用 在 ISP&#xff08;图像信号处理器&#xff09;自动白平衡&#xff08;AWB&#xff09;中&#xff0c;QX 和 QY 通常指的是色彩平面的两个坐标轴&#xff0c;用于描述不同光照条件下的颜色分布。 QX (Quadrant X)&#xff1…

信息安全中的数论速通

信息安全中的数论速通 此版数论增加了&#xff0c;丰富了相关内容&#xff0c;更加精炼 md文档自取&#xff0c;可以私我&#xff0c;公式懒得调了&#xff0c;vsc打开没问题 数论中重要定理速览 算术基本定理&#xff1a;每一个大于1的自然数都可以唯一地分解为素数的乘积。…

G - Add and Multiply Queries

G - Add and Multiply Queries 思路 开始直接用的线段树&#xff0c;写完才意识到是假的 由于题目说答案不会超过 1 0 18 10^{18} 1018&#xff0c;所以一个询问区间内的大于2的b的个数不超过64个&#xff0c;这样一个区间内大于2的b的就可以把a分成不超过64个连续的区间&a…

Android Studio Dolphin 下载、安装与配置教程

文章目录 Android Studio Dolphin简介一、核心特性二、新增功能三、用户体验优化 一&#xff0c;下载百度网盘迅雷云盘 二&#xff0c;安装三&#xff0c;下载组件四&#xff0c;添加SDK五&#xff0c;创建项目六&#xff0c;安装 Device模拟器运行项目 Android Studio Dolphin…

磁盘分区工具 DiskGenius Pro v5.5.0.1488 中文汉化版

DiskGenius 是一款专家级数据恢复软件&#xff0c;集数据恢复、硬盘分区、系统备份还原等多种功能于一身的超级工具软件&#xff0c;功能全面&#xff0c;安全可靠。可以提供磁盘的数据找回、备份、分区、修复、删除、格式化等操作&#xff0c;也能帮助用户修复磁盘坏道、彻底删…

ES 自定义排序方式

es默认score是根据query的相关度进行打分的&#xff0c;具体打分机制可以参见&#xff1a;官方文档。如果召回时既希望有相关性又能根据其他信息进行排序。 例如小红书搜索的时候&#xff0c;可能既希望有召回相关度又能根据热度信息&#xff08;如果喜欢、收藏等等参数去进行召…

OpenCV KeyPoint与描述子编解码

前言&#xff1a;OpenCV中的特征点对象与描述子对象分别由cv2.KeyPoint类与np.array类封装&#xff0c;与之相关的特征点检测与匹配等相关算法的输出、输入亦为cv2.KeyPoint对象与np.array描述子对象。因此&#xff0c;若使用OpenCV封装好的特征点检测与匹配算法不可避免的需要…

Shiro会话管理和加密

会话管理 Shiro提供了完整的企业级会话管理功能&#xff0c;不依赖于底层容器&#xff08;如Tomcat&#xff09;&#xff0c;不管是J2SE还是J2EE环境都可以使用&#xff0c;提供了会话管理&#xff0c;会话事件监听&#xff0c;会话存储/持久化&#xff0c;容器无关的集群&…

python开发工具是选择vscode还是pycharm?两款软件优缺点对照!

Pycharm和VSCode是两款流行的代码编辑器&#xff0c;它们都有各自的优缺点和适用情况。本文将从以下几个方面对它们进行比较和分析&#xff1a; 功能和扩展性性能和稳定性用户体验和界面价格和支持 功能和扩展性 Pycharm是一款专为Python开发而设计的集成开发环境&#xff08;…

《一人公司:失业潮中的高新技术工作者》读书笔记

基本信息 书名&#xff1a;一人公司&#xff1a;失业潮中的高新技术工作者作者&#xff1a;[美]卡丽莱恩&#xff08;Carrie M. Lane&#xff09;出版社&#xff1a;广东人民出版社出版时间&#xff1a;2023年11月 内容简介 本书通过18个月的田野调查和9年的跟踪寻访&#…

部署DNS主从服务器

一。DNS主从服务器作用&#xff1a; DNS作为重要的互联网基础设施服务&#xff0c;保证DNS域名解析服务的正常运转至关重要&#xff0c;只有这样才能提供稳定、快速日不间断的域名查询服务 DNS 域名解析服务中&#xff0c;从服务器可以从主服务器上获取指定的区域数据文件&…

es(1)(仅供自己参考)

elasticsearch&#xff08;ES&#xff09;是一款非常强大的开源搜索引擎&#xff0c;可以帮助我们从海量的数据中快速找到需要的内容。 elastic stack&#xff08;ELK&#xff09;&#xff1a;elasticsearch结合kibana、Logstash、Beats。被广泛的应用在日志数据分析、实时监控…

关于k8s的cilium网络插件踩坑记

cilium状态为CrashLoopBackOff coredns状态为Pending 使用的系统镜像为centos7.6 内核是3.*** 然后用的工具来部署集群&#xff0c;开始以为是调度啥的&#xff0c;然后单节点试也出现CrashLoopBackOff、Pending等状态&#xff0c;更新内核在到5 集群自己就好了 注意&am…

设计模式(三)

设计模式(三) 某些情况&#xff0c;可能会过度地使用继承来扩展对象的功能&#xff1b; 由于继承为类型引入的静态特质&#xff0c;使得这种扩展方式缺乏灵活性&#xff1b; 随着子类增多&#xff0c; 各种子类的组合会导致更多子类的膨胀 需要使用对象功能的扩展&#xff…

openssl 自签证书

生成自签证书脚本 #!/bin/bash KEY_LENGTH4096 DAYS3650 STDongBei LLiaoNing ONASA OUNASA CN*.dongbei.nasa.edu.cn EMAILxxxqq.com# 生成私有证书密钥 openssl genrsa -out server.key ${KEY_LENGTH} # 生成证书请求文件 # 警告:一定要用双引号&#xff08;单引号不解析变量…

信创认证(信创人才考评证书)的含金量?到底有多少?

“信创认证”是什么&#xff1f; 信创认证是由工业和信息化部教育与考试中心推出的国家级权威认证&#xff0c;旨在推动信息技术应用创新产业的发展&#xff0c;并构建完善的信创产业人才培养体系。该认证在个人信息技术领域具有极高的认可度。 信创认证分为初级、中级和高级三…