中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

容器云設(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)命令

image.png


 如果啟動(dòng)命令是腳本文件,在容器中找到該腳本,把要隨容器啟動(dòng)的程序的命令行,添加到此啟動(dòng)腳本中。





編輯:西部數(shù)碼
日期:2019-07-26

收藏 】 【 打印 】   
您可對(duì)文檔進(jìn)行評(píng)分喲~

勾選遇到的問(wèn)題提交給我們,收到反饋后保證及時(shí)修正更新!

提交反饋需要先登陸會(huì)員帳號(hào)

上一篇:香港高防機(jī)房云主機(jī)綁定普通IP
下一篇:容器云共享IP公網(wǎng)安裝使用寶塔面板
若文檔內(nèi)容對(duì)您沒有幫助,不能解決問(wèn)題? 您還可以 咨詢?cè)诰客服提交工單搜索常見問(wèn)題 ,我們將竭誠(chéng)為您服務(wù)。
  >> 相關(guān)文章
 
分享至:
Top

24小時(shí)客服熱線

400-028-5800

028-62778877

您好,非正常上班時(shí)間若有緊急技術(shù)問(wèn)題,請(qǐng)撥總機(jī)后按7號(hào)鍵, 其他問(wèn)題請(qǐng)?zhí)峤还位蛟谏习鄷r(shí)間聯(lián)系,謝謝支持!