1 Star 0 Fork 3

zhanggengxing/autotest_server

forked from 梁孔林/autotest_server 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
测试平台nginx+uwsgi部署.txt 2.06 KB
一键复制 编辑 原始数据 按行查看 历史
ubantu服务器需要在命令前加sudo 获取root权限。centos7不需要加sudo
前端:
启动nginx
sudo nginx
# 进入FasterWeb项目根目录
cd /home/faster/FasterWeb/
# 把配置文件复制到nginx默认配置目录下
sudo cp default.conf /etc/nginx/conf.d/fasterweb.conf
npm run build
sudo cp -r dist/* /usr/share/nginx/html/
后端
启动rabbimq : rabbitmq-server -detached
启动uwsgi服务
uwsgi --ini 文件路径
firewall-cmd --zone=public --add-port=8080/tcp --permanent
关闭使用该端口的所有应用:sudo fuser -k 8001/tcp
定时任务celery配置
后台启动 celery multi start w1 -A AutoTestRunner -l info --logfile = celerylog.log --pidfile = celerypid.pid
关闭 ps auxww | grep 'celery' | awk '{print $2}' | xargs kill -9
配置celery_worker.sh 文件
#!/bin/sh
case $1 in
start) cd /root/project/TestProjectFile/autotest_server/ && celery multi start w1 -A AutoTestRunner-l info;; # django项目根目录 : /root/project/TestProjectFile/autotest_server/
stop) cd /root/project/TestProjectFile/autotest_server/ && celery multi stop w1 -A AutoTestRunner-l info;; # django项目根目录 : /root/project/TestProjectFile/autotest_server/
*) echo "require start|stop" ;;
esac
启动celery_worker:./celery_worker start
停止celery_worker:./celery_worker stop
配置celery_beat.sh文件
#!/bin/sh
case $1 in
start) cd /root/project/TestProjectFile/autotest_server/ && celery -A AutoTestRunner beat -l info > out.file 2>&1 & ;; # 启动beat ; django项目根目录 : /root/project/TestProjectFile/autotest_server/
stop) su root /root/project/TestProjectFile/autotest_server/beat_stop.sh start ;; # 关闭beat(根据beat_stop.sh脚本的路径适当变化)
*) echo "require start|stop" ;;
esac
配置beat_stop.sh文件
#!/bin/sh
PROCESS=`ps -ef|grep celery|grep -v grep|grep -v PPID|awk '{ print $2}'`
for i in $PROCESS
do
echo "Kill the $1 process [ $i ]"
kill -9 $i
done
启动celery_worker:./celery_beat start
停止celery_worker:./celery_beat stop
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/zhanggengxing/autotest_server.git
[email protected]:zhanggengxing/autotest_server.git
zhanggengxing
autotest_server
autotest_server
master

搜索帮助