【测试平台】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,一经查实,立即删除!

相关文章

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区域内…

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;也能帮助用户修复磁盘坏道、彻底删…

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

基本信息 书名&#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。被广泛的应用在日志数据分析、实时监控…

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

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

新手铲屎官提问,有哪几款噪音低的宠物空气净化器推荐

相信很多铲屎官都明白的的痛就是猫咪掉毛太严重&#xff0c;所以每次看到满天飞的浮毛时只想赶紧逃离&#xff0c;一点都不想清理。但是家是自己的&#xff0c;猫是自己的&#xff0c;健康也是自己的&#xff0c;不清理也得清理。 为了更有效的清理浮毛&#xff0c;我朋友特意…

参会记录|2024 中国计算机大会(CNCC 2024)

前言&#xff1a;2024年10月24-26日&#xff0c;有幸在横店参加了2024年度的中国计算机大会&#xff08;CNCC&#xff09;&#xff0c;本篇博客总结本人在会议期间收听的主要报告内容及收获。 2024.10.24 上午 夏苑海岳开襟 如何实现人工智能在现实场景中的落地&#xff1f; …

OgCloud参加HPE Discover More AI 2024,共建数智化未来!

10月16日&#xff0c;企业科技盛会HPE Discover More AI 2024在香港瑰丽酒店举行。本次大会Hewlett Packard Enterprise (HPE) 联同全球14个科技合作伙伴&#xff0c;聚焦于AI未来走势、混合云创新与边缘安全等领域&#xff0c;以主题演讲、技术展示、研讨会等形式进行&#xf…

从双斜率,野人除法看性能优化

人呐&#xff0c;天生对线性的推崇&#xff0c;却在内心又对线性的不爱。一开始人们总是从最简单的线性过程入手&#xff0c;但最终都难免因为不满足而进入指数过程。 看一个 Linux kernel 老式 O(1) 调度器的时间片计算函数的演化&#xff1a; 早期的 O(1) 是一个连续线性函…

vue 解决:npm ERR! code ERESOLVE 及 npm ERR! ERESOLVE could not resolve 的方案

1、问题描述&#xff1a; 其一、需求为&#xff1a; 想要安装项目所需依赖&#xff0c;成功运行 vue 项目&#xff0c;想要在浏览器中能成功访问项目地址 其二、问题描述为&#xff1a; 在 package.json 文件打开终端平台&#xff0c;通过执行 npm install 命令&#xff0c…

【MySQL】视图特性 用户管理

> 作者&#xff1a;დ旧言~ > 座右铭&#xff1a;松树千年终是朽&#xff0c;槿花一日自为荣。 > 目标&#xff1a;了解什么是视图&#xff0c;我们又该如何管理用户。 > 毒鸡汤&#xff1a;有些事情&#xff0c;总是不明白&#xff0c;所以我不会坚持。早安! >…

kafka 如何减少数据丢失?

大家好&#xff0c;我是锋哥。今天分享关于【kafka 如何减少数据丢失?】面试题&#xff1f;希望对大家有帮助&#xff1b; kafka 如何减少数据丢失? 1000道 互联网大厂Java工程师 精选面试题-Java资源分享网 Apache Kafka 是一个高吞吐量的分布式消息队列&#xff0c;广泛用…

前端对一个增删改查的思考

1、来源&#xff1a;dify dify/web/app/components/workflow/nodes/question-classifier/components/class-list.tsx at main langgenius/dify GitHub 2、代码流程&#xff1a; 3、思索问题&#xff1a; 1、为啥要用return形式&#xff0c;而不是value直接当函数&#xff1…

SQL进阶技巧:如何求组内排除当前行的移动平均值?

目录 0 需求描述 2 数据准备 3 问题分析 4 小结 0 需求描述 -- 按照 日期,省份,等级 分组 求分数的平均值;但是需要剔除当前行的数据 2 数据准备 create table avgtest as (select 2024-10-24 as cdate, 广东 as province,深圳 as city, 2 as level, 200 as scoreunio…

ssm005基于SSM框架的购物商城系统的开发与实现(论文+源码)_kaic

设计题目&#xff1a;购物商城系统的设计与实现 摘 要 网络技术和计算机技术发展至今&#xff0c;已经拥有了深厚的理论基础&#xff0c;并在现实中进行了充分运用&#xff0c;尤其是基于计算机运行的软件更是受到各界的关注。加上现在人们已经步入信息时代&#xff0c;所以对…

【MyBatis】| JavaWeb基础教程学习笔记(上)

01-MyBatis简介 什么是MyBatis? MyBatis是一款优秀的持久层框架&#xff0c;用于简化JDBC开发MyBatis本是Apache的一个开源项目iBatis&#xff0c;2010年这个项目由apache software foundation迁移到了google code&#xff0c;并且改名为MyBatis。2013年11月迁移到Github官网…