婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > CentOS7 增加tomcat 啟動(dòng)、停止(使用systemctl進(jìn)行配置)

CentOS7 增加tomcat 啟動(dòng)、停止(使用systemctl進(jìn)行配置)

熱門(mén)標(biāo)簽:阿克蘇市地圖標(biāo)注app 河北機(jī)器人電銷(xiāo) 上海營(yíng)銷(xiāo)外呼系統(tǒng)定制 長(zhǎng)沙人工外呼系統(tǒng)公司 ai人工電話機(jī)器人 常州云呼叫外呼系統(tǒng) bs外呼系統(tǒng) 小藍(lán)鴿電話機(jī)器人 京東外呼系統(tǒng)怎么操作
1,centos7 使用 systemctl 替換了 service命令
參考:redhat文檔:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Services.html#sect-Managing_Services_with_systemd-Services-List

查看全部服務(wù)命令:
systemctl list-unit-files --type service
查看服務(wù)
systemctl status name.service
啟動(dòng)服務(wù)
systemctl start name.service
停止服務(wù)
systemctl stop name.service
重啟服務(wù)
systemctl restart name.service增加開(kāi)機(jī)啟動(dòng)
systemctl enable name.service
刪除開(kāi)機(jī)啟動(dòng)
systemctl disable name.service
其中.service 可以省略。


2,tomcat增加啟動(dòng)參數(shù)
tomcat 需要增加一個(gè)pid文件
在tomca/bin 目錄下面,增加 setenv.sh 配置,catalina.sh啟動(dòng)的時(shí)候會(huì)調(diào)用,同時(shí)配置java內(nèi)存參數(shù)。


復(fù)制代碼
代碼如下:

#add tomcat pid
CATALINA_PID="$CATALINA_BASE/tomcat.pid"
#add java opts
JAVA_OPTS="-server -XX:PermSize=256M -XX:MaxPermSize=1024m -Xms512M -Xmx1024M -XX:MaxNewSize=256m"


3,增加tomcat.service

在/usr/lib/systemd/system目錄下增加tomcat.service,目錄必須是絕對(duì)目錄。


復(fù)制代碼
代碼如下:

[Unit]
Description=Tomcat
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/data/tomcat/tomcat.pid
ExecStart=/data/tomcat/bin/startup.sh
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target


[unit]配置了服務(wù)的描述,規(guī)定了在network啟動(dòng)之后執(zhí)行。[service]配置服務(wù)的pid,服務(wù)的啟動(dòng),停止,重啟。[install]配置了使用用戶。

4,使用tomcat.service
配置開(kāi)機(jī)啟動(dòng)

systemctl enable tomcat


啟動(dòng)tomcat
systemctl start tomcat
停止tomcat
systemctl stop tomcat
重啟tomcat
systemctl restart tomcat


因?yàn)榕渲胮id,在啟動(dòng)的時(shí)候會(huì)再tomcat根目錄生成tomcat.pid文件,停止之后刪除。

同時(shí)tomcat在啟動(dòng)時(shí)候,執(zhí)行start不會(huì)啟動(dòng)兩個(gè)tomcat,保證始終只有一個(gè)tomcat服務(wù)在運(yùn)行。

多個(gè)tomcat可以配置在多個(gè)目錄下,互不影響。

標(biāo)簽:甘孜 甘南 泉州 周口 來(lái)賓 忻州 銅仁 邢臺(tái)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS7 增加tomcat 啟動(dòng)、停止(使用systemctl進(jìn)行配置)》,本文關(guān)鍵詞  CentOS7,增加,tomcat,啟動(dòng),停止,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS7 增加tomcat 啟動(dòng)、停止(使用systemctl進(jìn)行配置)》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于CentOS7 增加tomcat 啟動(dòng)、停止(使用systemctl進(jìn)行配置)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 聂拉木县| 英超| 嘉鱼县| 城口县| 大田县| 闵行区| 淄博市| 富宁县| 进贤县| 怀化市| 会宁县| 永州市| 岱山县| 稻城县| 吴忠市| 陕西省| 龙岩市| 五河县| 马山县| 兴仁县| 盖州市| 清丰县| 嘉荫县| 绿春县| 蒙山县| 宣化县| 克东县| 中江县| 夏津县| 寿光市| 石台县| 郴州市| 邵阳市| 攀枝花市| 登封市| 宣武区| 绥芬河市| 东台市| 繁昌县| 汉中市| 新邵县|