防止甲骨文被回收
bash
apt -y update
apt -y install curl build-essential
curl -L http://www.devin.com/lookbusy/download/lookbusy-1.4.tar.gz -o lookbusy-1.4.tar.gz
tar -xzvf lookbusy-1.4.tar.gz
cd lookbusy-1.4/
./configure && make && make install- 新建systemd服务bash
systemctl edit --full --force lookbusy.service - 写入如下配置:格式一定要和下面的一样,包括换行,不要有多余的空格等,等会肯定启动出错bash
[Unit] Description=lookbusy service [Service] Type=simple ExecStart=/usr/local/bin/lookbusy -c 20 -m 5120MB Restart=always RestartSec=10 KillSignal=SIGINT [Install] WantedBy=multi-user.target - 参数 -c指cpu使用率,-m指内存使用率。 可以根据自己的实例配置来适当配置。
- 启动并保存bash
systemctl enable --now lookbusy.service - 如果要停止bash
systemctl disable --now lookbusy.service - 检查机器cpu、内存、负载情况,确定超过甲骨文规定的10%即可:bash
top
- 启动并保存