[抛砖引玉]大家都是怎么在linux 上部署java服务的?

如果单纯使用shell脚本来管理启动,停止,也不是不行,但是稍微繁琐点,并且没办法批量管理各个服务的运行情况
我最近尝试注册服务的方式来管理java服务
在/lib/systemd/system 中添加服务
例如添加文件:xxx.service

[Unit]

Description=****

After=network.target

#StandardOutput=/root/****/api/****/log.out

[Service]

Type=simple

ExecStart=/usr/bin/java -jar /root/****/api/****/****.jar>>/root/****/api/****/log.out 2>&1

#ExecStop=/bin/sh /root/****/api/****/stop.sh

#StandardOutput=null

Restart=on-failure

RestartSec=10s

[Install]

WantedBy=multi-user.target

但是比较坑爹的是,这种方式好像没办法输出日志到指定位置
不知道大家平时是怎么部署java项目的?


回答:

Jenkins+docker一把刷


回答:

阿里云效流水线+docker


回答:

既然用了systemd管理服务, 那就用 journalctl 看日吧. systemd的execStart不支持>>

以上是 [抛砖引玉]大家都是怎么在linux 上部署java服务的? 的全部内容, 来源链接: utcz.com/p/944749.html

回到顶部