摘要:修改主機(jī)名主機(jī)名服務(wù)器磁盤(pán)掛載將磁盤(pán)掛載修改為方式初始化服務(wù)器安裝程序下載,根據(jù)需求安裝所需與執(zhí)行初始化腳本基礎(chǔ)工作常用類(lèi)庫(kù)常用軟件配置設(shè)置前綴為解除與前綴的對(duì)應(yīng)關(guān)系
1.修改主機(jī)名
vim /etc/hostname vim /etc/hosts hostname <主機(jī)名>2.服務(wù)器磁盤(pán)掛載
vim /data/scripts/auto_fdisk.sh3.將磁盤(pán)掛載修改為uuid方式
blkid /dev/xvdb1 vim /etc/fstab UUID=41852b97-3630-42b1-b2ae-9d8f77922245 /data ext4 defaults 1 24.初始化服務(wù)器
#!/bin/sh yum clean all systemctl stop firewalld.service systemctl disable firewalld.service sed -i "s/enforcing/disabled/g" /etc/selinux/config yum -y install vim openssh* ntp wget screen bash-completion git service ntpd stop ntpdate time.nist.gov sed -i "s/0.centos.pool.ntp.org/time.nist.gov/g" /etc/ntp.conf chkconfig ntpd on service ntpd restart5.安裝程序
下載oneinstack,根據(jù)需求安裝所需memcached與supervisord
6.執(zhí)行cache初始化腳本#!/bin/sh -e ########## 1. 基礎(chǔ)工作 start ########## tmux_conf=/root/.tmux.conf chk_service_super=`systemctl status supervisord.service | grep inactive` if [[ -n $chk_service_super ]] then echo "supervisord is inactive..." else sudo service supervisord stop fi chk_service_hhvm=`systemctl status hhvm | grep inactive` if [[ -n $chk_service_hhvm ]] then echo "hhvm is inactive..." else sudo service hhvm stop fi mkdir -p /data/logs mkdir -p /data/backup mkdir -p /data/components/ mkdir -p /data/scripts mkdir -p /data/softs mkdir -p /data/logs/access mkdir -p /data/logs/general mkdir -p /data/logs/logic mkdir -p /data/logs/error/supervisor chmod -R 777 /data/logs/* chmod -R 777 /data/components/ # 常用類(lèi)庫(kù) sudo yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel # 常用軟件 sudo yum -y install net-tools unzip vim lrzsz subversion tmux # tmux配置 cat > $tmux_conf <7.配置supervisord 7.1 啟動(dòng)supervisord服務(wù) service supervisord start7.2 修改supervisord配置文件vim /etc/supervisord.conf 修改如下信息: [include] files = supervisord.d/*.ini #[program:hhvm] #command=/usr/bin/hhvm --mode server --user www --config /etc/hhvm/server.ini --config /etc/hhvm/php.ini --config /etc/hhvm/config.hdf #numprocs=1 ; number of processes copies to start (def 1) #directory=/tmp ; directory to cwd to before exec (def no cwd) #autostart=true ; start at supervisord start (default: true) #autorestart=unexpected ; whether/when to restart (default: unexpected) #stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)7.4 添加memcached信息vim /etc/supervisord/mc_11211.ini vim /etc/supervisord/mc_11212.ini vim /etc/supervisord/mc_11213.ini添加如下信息
[program:mc_11211] command=/usr/local/memcached/bin/memcached -p 11211 -u memcached -m 2048 -c 10240 -l 10.0.0.51 user=root ;執(zhí)行命令的用戶(hù) numprocs=1 ; 啟動(dòng)幾個(gè)進(jìn)程 默認(rèn) 1 #process_name=%(process_num)02d ;directory= ; 執(zhí)行前要不要先cd到目錄去 autostart=true ; 隨著supervisord的啟動(dòng)而啟動(dòng) autorestart=true ; 是否自動(dòng)重啟 默認(rèn)true startretries=5 ; 啟動(dòng)失敗時(shí)的最多重試次數(shù) 默認(rèn)5 ;;exitcodes=0 ; 正常退出代碼 ;;stopsignal=KILL ; 用來(lái)殺死進(jìn)程的信號(hào) ;;stopwaitsecs=10 ; 發(fā)送SIGKILL前的等待時(shí)間 redirect_stderr=true ; 重定向stderr到stdout stdout_logfile=/data/logs/error/supervisor/mc_11211.log stderr_logfile=/data/logs/error/supervisor/mc_11211.log8.最終配置關(guān)閉防火墻服務(wù)
systemctl stop firewalld.service systemctl disable firewalld.service關(guān)閉memcached服務(wù)
service memcached stop關(guān)閉memcached開(kāi)機(jī)自啟
chkconfig memcached off重啟supervisord,采用supervisord啟動(dòng)memcached
service supervisord restart
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/61722.html
摘要:部署一個(gè)應(yīng)用程序的過(guò)程絕對(duì)是一個(gè)噩夢(mèng)般的經(jīng)歷。準(zhǔn)備開(kāi)始,我們創(chuàng)建一個(gè)一個(gè)中包含怎樣創(chuàng)建你想要的鏡像的指令。使用告知使用官方社區(qū)最新版本的可用鏡像。這個(gè)鏡像在的可用版本。 注:本文由 Mike Ebinum 編寫(xiě),原文地址 Creating a Docker Container to run PHP, NGINX and Hip Hop VM (HHVM) showImg(ht...
摘要:部署一個(gè)應(yīng)用程序的過(guò)程絕對(duì)是一個(gè)噩夢(mèng)般的經(jīng)歷。準(zhǔn)備開(kāi)始,我們創(chuàng)建一個(gè)一個(gè)中包含怎樣創(chuàng)建你想要的鏡像的指令。使用告知使用官方社區(qū)最新版本的可用鏡像。這個(gè)鏡像在的可用版本。 注:本文由 Mike Ebinum 編寫(xiě),原文地址 Creating a Docker Container to run PHP, NGINX and Hip Hop VM (HHVM) showImg(ht...
摘要:基礎(chǔ)工作常用類(lèi)庫(kù)常用軟件配置設(shè)置前綴為解除與前綴的對(duì)應(yīng)關(guān)系將快捷鍵設(shè)置為模式基礎(chǔ)工作部署部署 #!/bin/bash ########## 1. 基礎(chǔ)工作 start ########## tmux_conf=/root/.tmux.conf chk_service_super=`systemctl status supervisord.service | grep inacti...
摘要:作者運(yùn)維博客博客地址文章地址相關(guān)話題是近兩年來(lái)發(fā)展較快,比較活躍,非常清新的一個(gè)管理平臺(tái),提供對(duì)宿主機(jī)和虛機(jī)的統(tǒng)一管理,它有別于自帶的圖形管理工具,讓管理變得更為可視化,對(duì)中小型應(yīng)用場(chǎng)景帶來(lái)了更多方便。作者:SRE運(yùn)維博客博客地址: https://www.cnsre.cn/文章地址:https://www.cnsre.cn/posts/211117937177/相關(guān)話題:https://w...
摘要:上一篇文章第四章網(wǎng)站部署第二節(jié)靜態(tài)文件后臺(tái)運(yùn)行一般調(diào)試過(guò)程中我們使用運(yùn)行網(wǎng)站,方便我們?cè)诿钚兄锌催\(yùn)行狀況。默認(rèn)情況下,會(huì)監(jiān)控子進(jìn)程,并在任何程序意外終止時(shí)重生。配合實(shí)現(xiàn)多進(jìn)程在中添加接受命令行參數(shù)可在配置文件中添加使用代理 上一篇文章:Python:Tornado 第四章:Tornado網(wǎng)站部署:第二節(jié):靜態(tài)文件 1、后臺(tái)運(yùn)行 一般調(diào)試過(guò)程中我們使用python app.py運(yùn)行網(wǎng)...
閱讀 914·2019-08-30 15:54
閱讀 3394·2019-08-29 15:33
閱讀 2768·2019-08-29 13:48
閱讀 1378·2019-08-26 18:26
閱讀 3387·2019-08-26 13:55
閱讀 1577·2019-08-26 10:45
閱讀 1238·2019-08-26 10:19
閱讀 362·2019-08-26 10:16