推出全新OEM分銷體系
具有殺傷力的價(jià)格,超大利潤(rùn)
容器云設(shè)置自動(dòng)啟動(dòng)服務(wù)[西數(shù)鏡像] 默認(rèn)是使用supervisor來(lái)管理啟動(dòng)程序,默認(rèn)已經(jīng)安裝和配置好了sshd,如果您有自己的程序需要容器啟動(dòng)時(shí)自動(dòng)啟動(dòng),請(qǐng)按照下面教程設(shè)置。 比如啟動(dòng)寶塔面板命令為 supervisorctl start bt: (如果沒有效果,先執(zhí)行:rm -rf /www/server/panel/logs/panel.pid) 非[西數(shù)鏡像]請(qǐng)參考本教程末尾說(shuō)明 Centos 系統(tǒng)配置文件目錄 /etc/supervisord.d/,文件后綴為ini Ubuntu、Debian系統(tǒng)配置文件目錄/etc/supervisor/conf.d/, 文件后綴為conf 本教程使用nginx作為示例 1. 先安裝配置好應(yīng)用程序,編譯安裝、yum、apt-get均可,安裝步驟略。 2. 建立配置文件 centos: /etc/supervisord.d/nginx.ini Ubuntu、Debian: /etc/supervisor/conf.d/nginx.conf [program:nginx] command=/usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;' autorestart=True 3.更新配置文件 在終端中輸入命令 supervisorctl update root@e9f9b9578ebb:/# supervisorctl update nginx: added process group 4.查看狀態(tài) 在終端中輸入命令 supervisorctl status root@e9f9b9578ebb:/# supervisorctl status nginx RUNNING pid 440, uptime 0:00:37 sshd RUNNING pid 26, uptime 0:41:50 狀態(tài)是RUNNING表示運(yùn)行中。 supervisroctl常用命令 supervisorctl stop nginx # 停止nginx supervisorctl start nginx # 啟動(dòng)nginx supervisorctl restart nginx # 重啟nginx supervisorctl stop all # 停止所有進(jìn)程 supervisorctl start all # 啟動(dòng)所有進(jìn)程 supervisorctl restart all # 重啟所有進(jìn)程 supervisorctl reload # 重新加載supervisor supervisorctl status # 查看服務(wù)狀態(tài) supervisorctl update # 更新supervisor,一般增加或者修改啟動(dòng)配置文件后要運(yùn)行該命令生效 常用程序啟動(dòng)配置文件(文件路徑請(qǐng)按照自己實(shí)際路徑) apache [program:httpd] command=/usr/sbin/httpd -D FOREGROUND autorestart=True mysql [program:mysqld] command=/usr/bin/pidproxy /tmp/mysqld.pid /usr/sbin/mysqld_safe --datadir=/home/mysql_data --pid-file=/tmp/mysqld.pid autorestart=True user=mysql redis [program:redis] command=/usr/local/bin/redis-server /etc/redis.conf autorestart=True tomcat [program:tomcat] directory=/www/server/tomcat/bin command=/www/server/tomcat/bin/catalina.sh run autorestart=True 非[西數(shù)鏡像]時(shí),請(qǐng)登錄到容器管理頁(yè)面,找到啟動(dòng)命令 如果啟動(dòng)命令是腳本文件,在容器中找到該腳本,把要隨容器啟動(dòng)的程序的命令行,添加到此啟動(dòng)腳本中。
|
|||||
>> 相關(guān)文章 | |||||
關(guān)注我們
最新動(dòng)態(tài)
新浪微博
交流互動(dòng)
關(guān)于我們
|
聯(lián)系我們
|
付款方式
|
人才招聘
|
友情鏈接
|
域名資訊
|
提交工單
|
我要評(píng)價(jià)
|
投訴建議
|
域名投訴
|
網(wǎng)站備案
|
百科知識(shí)
|
手機(jī)站
《中華人民共和國(guó)增值電信業(yè)務(wù)經(jīng)營(yíng)許可證》編號(hào):B1-20172600 川B1-20080058 蜀ICP備12028237號(hào)
《中華人民共和國(guó)互聯(lián)網(wǎng)域名服務(wù)許可證》編號(hào):川 D3-20220002
電話總機(jī):028-62778877(20線) 400電話:400-028-5800
400-028-5800
028-62778877
您好,非正常上班時(shí)間若有緊急技術(shù)問(wèn)題,請(qǐng)撥總機(jī)后按7號(hào)鍵, 其他問(wèn)題請(qǐng)?zhí)峤还位蛟谏习鄷r(shí)間聯(lián)系,謝謝支持!