nginx负载均衡器中主机的配置过程
时间:2025-05-23 09:32 文章来源于网友投稿,仅供参考!
对于一些企业,我们不用花费大把的资金去购进负载均衡设备,也可以进行负载均衡的实现, nginx负载均衡器中主机的配置过程。现在我们来说一下nginx负载均衡器,这种适合于中小型企业的设备,同样可以达到负载平衡的效果,现在我们就来介绍一下nginx负载均衡器的相关安装和设置问题。一?拓扑环境: 用途 IP 主nginx负载均衡器 192.168.0.154 辅nginx负载均衡器 192.168.0.155 VIP地址 192.168.0.188 二?安装keepalived wgetkeepalived.org/software/keepalived-1.1.15.tar.gz tarzxvfkeepalived-1.1.15.tar.gz cdkeepalived-1.1.15 ./configure--prefix=/usr/local/keepalived make makeinstall cp/usr/local/keepalived/sbin/keepalived/usr/sbin/ cp/usr/local/keepalived/etc/sysconfig/keepalived/etc/sysconfig/ cp/usr/local/keepalived/etc/rc.d/init.d/keepalived/etc/init.d/ mkdir/etc/keepalived cd/etc/keepalived/ vimkeepalived.conf !ConfigurationFileforkeepalived global_defs{ notification_email{ yuhongchun027@163 } notification_email_fromkeepalived@chto smtp_server127.0.0.1 smtp_connect_timeout30 router_idLVS_DEVEL } vrrp_instanceVI_1{ stateMASTER interfaceeth0 virtual_router_id51 mcast_src_ip192.168.0.154<==主nginx负载均衡器的IP地址 priority100 advert_int1 authentication{ auth_typePASS auth_passchto } virtual_ipaddress{ 192.168.0.188<==vip地址 } } #servicekeepalivedstart 主nginx负载均衡器日志: #tail/var/log/messages Oct603:25:03ltosavahi-daemon:Registeringnewaddressrecordfor192.168.0.188h0. Oct603:25:03ltosavahi-daemon:Registeringnewaddressrecordfor192.168.0.154h0. Oct603:25:03ltosavahi-daemon:RegisteringHINFOrecordwithvalues'I686'/'LINUX'. Oct603:25:23ltosavahi-daemon:Withdrawingaddressrecordforfe80::20c:29ff:feb9:eeabh0. Oct603:25:23ltosavahi-daemon:Withdrawingaddressrecordfor192.168.0.154h0. Oct603:25:23ltosavahi-daemon:Hostnameconflict,retryingwithOct603:25:23ltosavahi-daemon:Registeringnewaddressrecordforfe80::20c:29ff:feb9:eeabh0. Oct603:25:23ltosavahi-daemon:Registeringnewaddressrecordfor192.168.0.188h0. Oct603:25:23ltosavahi-daemon:Registeringnewaddressrecordfor192.168.0.154h0. Oct603:25:23ltosavahi-daemon:RegisteringHINFOrecordwithvalues'I686'/'LINUX'. 编辑推荐负载均衡技术基础专题 当前,无论在企业网、园区网还是在广域网上,即使按照当时最优配置建设的网络,业务量的发展都超出了过去.. 探寻负载均衡器的算法和原理安装步骤详解之Apusic负载均衡器Apusic负载均衡器运行的细节知识F5负载均衡器的功能介绍和配置图示辅助nginx负载均衡器的配置说明 |