久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡

這篇文章主要介紹了nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡的相關(guān)知識(shí),內(nèi)容詳細(xì)易懂,操作簡(jiǎn)單快捷,具有一定借鑒價(jià)值,相信大家閱讀完這篇nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡文章都會(huì)有所收獲,下面我們一起來(lái)看看吧。

創(chuàng)新互聯(lián)主要從事成都做網(wǎng)站、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)七星關(guān)區(qū),十年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(wù):13518219792

實(shí)驗(yàn)環(huán)境

前端nginx:ip 192.168.6.242,對(duì)后端的wordpress網(wǎng)站做反向代理實(shí)現(xiàn)復(fù)雜均衡
后端nginx:ip 192.168.6.36,192.168.6.205都部署wordpress,并使用相同的數(shù)據(jù)庫(kù)

1、在后端的兩個(gè)wordpress上配置rsync+inotify,兩服務(wù)器都開(kāi)啟rsync服務(wù),并且通過(guò)inotify分別向?qū)Ψ酵綌?shù)據(jù)
下面配置192.168.6.205這臺(tái)服務(wù)器
vim /etc/rsyncd.conf
uid = nginx
gid = nginx
port = 873
host all = 192.168.6.36     #另外一臺(tái)wordpress使用192.168.6.205
use chroot = on
max connections = 4
timeout = yes
[wordpress]
path = /usr/local/nginx/html/wordpress
comment = rsync files
ignore errors
read only = no
list = yes
auth users = rsync
secrets file = /etc/rsync_server.passwd     #指定帳號(hào)密碼,用于提供另外一個(gè)節(jié)點(diǎn)訪(fǎng)問(wèn)自身的帳號(hào)

vim /etc/rsync_server.passwd
rsync:rsync

vim /etc/rsync_client.passwd
rsync                                                     #用于訪(fǎng)問(wèn)另外一個(gè)wordpress使用的密碼文件

配置inotify同步腳本
#!/bin/bash
host=192.168.6.36                  #另外一個(gè)wordpress
src=/usr/local/nginx/html/wordpress/
dst=wordpress
user=rsync
inotifywait=/usr/local/inotify/bin/inotifywait
rsync=/usr/bin/rsync
$inotifywait -mrq –timefmt '%d/%m/%y %h:%m' –format '%t %w%f' -e modify,delete,create,attrib $src | while read files
do
       $rsync -vzrtopg –delete –progress –password-file=/etc/rsync_client.passwd $src $user@$host::$dst
        echo "${files} was rsynced" >>/tmp/rsync.log 2>&1
done

2、配置前端nginx實(shí)現(xiàn)反向代理
vim /usr/local/nginx/conf/nginx.conf
#在http段中加入
include vhost/wordpress.conf;

mkdir /usr/local/nginx/confi/vhost
vim /usr/local/nginx/confi/vhost/wordpress.conf
upstream wordpress {
   server 192.168.6.205 weight=1;
   server 192.168.6.36 weight=1;
}

server {
   location / {
       proxy_pass http://wordpress;
       proxy_redirect      off;
       proxy_set_header    host        $host;
       proxy_set_header    x-real-ip   $remote_addr;
   }
}

3、修改wordpress中的設(shè)置,必須將這個(gè)了的站點(diǎn)地址改為前端nginx的ip地址或者域名

nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡

關(guān)于“nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對(duì)“nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡”知識(shí)都有一定的了解,大家如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

新聞名稱(chēng):nginx+rsync+inotify怎么配置實(shí)現(xiàn)負(fù)載均衡
分享網(wǎng)址:http://sd-ha.com/article40/gpgoho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、外貿(mào)網(wǎng)站建設(shè)App設(shè)計(jì)關(guān)鍵詞優(yōu)化、網(wǎng)站排名企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

小程序開(kāi)發(fā)