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 &