Leif160519的blog Leif160519的blog

——————

目录
yapi,nexus,mindoc,jenkins服务启动文件
/  

yapi,nexus,mindoc,jenkins服务启动文件

1.YAPI

Supervisor:

[program:YAPI]
command=node /usr/local/lib/node_modules/yapi-cli/src/commands/my-yapi/vendors/server/app.js
directory=/usr/local/lib/node_modules/yapi-cli/src/commands/my-yapi/vendors/server
user=dell
stdout_logfile=/var/log/YAPI.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT

Systemctl:

[Unit]
Description=YAPI接口服务
After= network.target mongod.service
[Service]
ExecStart=/root/.nvm/versions/node/v8.12.0/bin/node /root/my-yapi/vendors/server/app.js
Restart=on-failure
[Install]
WantedBy=multi-user.target

注意:centos下mongodb的服务名叫mongod,ubuntu下叫mongodb

2.nexus

Supervisor:

[program:maven]
command=/usr/local/nexus-3.14.0-04/bin/nexus run
directory=/usr/local/nexus-3.14.0-04/bin
user=root
stdout_logfile=/var/log/maven.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT

Systemctl:

[Unit]
Description=Nexus
After=network.target
[Service]
ExecStart=/home/nexus-3.14.0-04/bin/nexus run
Restart=on-failure
[Install]
WantedBy=multi-user.target

3.mindoc

supervisor:

[program:mindoc]
command=/usr/local/mindoc/mindoc_linux_amd64
directory=/usr/local/mindoc/
user=root
stdout_logfile=/var/log/mindoc.log
autostart=true
autorestart=true
redirect_stderr=true
stopsignal=QUIT

Systemctl:

[Unit]
Description=MinDoc博客服务
After=network.target mysqld.service
[Service]
ExecStart=/root/mindoc/mindoc_linux_amd64
Restart=on-failure
[Install]
WantedBy=multi-user.target

注意:centos下mysql服务名叫mysqld,ubuntu下叫mysql

4.jenkins

systemctl:

[Unit]
Description=Jenkins
After=network.target
[Service]
ExecStart=/usr/bin/java -jar /root/yang/jenkins.war --httpPort=8888
Restart=on-failure
[Install]
WantedBy=multi-user.target

注意:
1.java也要指定绝对路径
2.限制jvm大小请在-jar之前加上参数:-Xms128m -Xmx512m----Xms表示最小内存,Xmx表示最大内存

注意:
centos的启动文件路径:/usr/lib/systemd/system/lib/systemd/system,这两个路径中的文件完全同步,选择其中一个即可
ubuntu启动文件路径:/lib/systemd/system

注意:
若mysql和mongodb都在docker中,则上述systemctl启动文件中的mysqld.servicemongod.service都要替换成docker.service


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题yapi,nexus,mindoc,jenkins服务启动文件
作  者Leif160519
出  处https://github.icu/articles/2019/10/22/1571712932009.html
关于博主:坐标六朝古都南京,服务器运维工程师+桌面运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!