keepalived解決Nginx單點問題

2021-08-30 13:33:44 字數 1250 閱讀 6150

一、nginx安裝配置

mainline version:主線版本

stable version:穩定版本

legacy versions:舊版本

yum -y install pcre-devel

yum -y install  zlib-devel

tar -zxvf nginx.tar.gz

cd nginx

支援socket: ./configure --prefix=/usr/local/nginx --with-stream

make & make install

安裝編譯後預設路徑:/usr/local/nginx

啟動:./sbin/nginx

指定配置檔案啟動:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

停止:./sbin/nginx -s stop

重啟:./sbin/nginx -s reload

please install libnfnetlink headers.

rpm -i libnfnetlink-devel-0.0.40-1.el5.rf.x86_64.rpm --force --nodeps

編譯:make && make install

建立快捷方式:

ln -s /usr/local/keepalived/sbin/keepalived /sbin/  --建立軟鏈結

cp /usr/local/keepalived-1.3.4/keepalived/etc/init.d/keepalived /etc/init.d

chkconfig –add keepalived  -- 新增到系統服務

chkconfig keepalived on    -- 檢測是否新增成功

啟動keepalived:service keepalvied start|stop|restart

/etc/keepalived/目錄下載入keepalived.conf配置檔案

日誌:/var/log/messages

三、keepalived配置:

! configuration file for keepalived

global_defs

vrrp_instance vi_1

virtual_ipaddress

}#虛擬服務位址

virtual_server 192.168.0.100 80 }}

keepalived 解決系統單點問題

1 安裝 wget tar zxvf keepalived 1.2.15.tar.gz cd keepalived 1.2.15 configure sysconf etc with kernel dir usr src kernels 2.6.32 573.8.1.el6.x86 64 常見三種錯...

18 解決keepalived不同步題

通過前面學習keepalived的工作原理,我們知道keepalived實際上是通過傳送vrrp廣播包來檢測keepalived程序是否正常,來判斷nginx伺服器是否掛了,從而進行nginx主備切換,因此nginx主備的說法其實不完全正確。也就是說nginx伺服器高可用其實是keepalived來...

MediaSoup demo模組增加nginx

相關連線 webrtc 框架學習 一 mediasoup基本框架學習 使用docker 搭建mediasoup服務 mediasoup demo模組增加nginx 使用docker 搭建mediasoup服務 github專案路徑 docker hub 路徑 nginx 配置檔案 nginx.con...