服务器部署常用相关linix指令

1 启项目

1·利用gunicorn 启用你的web服务器进程 (team为项目含启动文件的文件名)

gunicorn -c  gunicorn_config.py team:app

2·查看gunicorn进程树

pstree -ap|grep gunicorn

3·查看本地所有进程

ps -aux

4·删除非空文件夹

rm -rf xxx

5·创建文件夹

mkdir xxxx

6·访问网址

curl https://www.baidu.com/

7·进入虚拟环境

source bin/activate

8·退出虚拟环境

deactivate 

9·更改更目录路径

import sys
rootPath = '/home/User_portrait/'
sys.path.append(rootPath)

10·杀死进程

kill -9 $(lsof -i:8020 |awk '{print $2}' | tail -n 2)

2.大数据集群查看

1·查看集群进程

yarn application -list

2·通过集群查询

set hive.execution.engine=spark;
set spark.executor.memory=2g;
set spark.executor.cores=2;
set spark.executor.instances=2;
再写你得sql

3·结束进程

yarn application -kill application_1577329577290_4262

3.nohup进程日志管理

查看文件内倒数100条

tail -100 nohup.out

1·日志重定向存储路径

#常规
nohup python managetest.py &
#重定向日志
nohup python managetest.py > logs/test.out 2>&1 &

2·清除日志(逻辑就是重写文件,内容为空值)
法一

cp /dev/null test.out

法二

cat /dev/null > test.out

3·不输出日志

nohup python managetest.py  >/dev/null 2>&1 &
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值