本站用于记录日常工作内容,虚拟化云计算,系统运维,数据库DBA,网络与安全。
html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; } .mac-os-11 { --title-bar-height:28px; } html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; } body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; } iframe { margin: auto; } a.url { word-break: break-all; } a:active, a:hover { outline: 0px; } .in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); } #write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; o...
Haproxy一些高级功能配置  一、基于cookie的会话保持cookie value:为当前server指定cookie值,实现基于cookie的会话黏性1、配置选项cookie name [ rewrite | insert | prefix ][ indirect ] [ nocache ][ postonly ] [ preserve ][ httponly ] [ secure ][ domain ]* [ maxidle <idle> ][ maxlife ] name:cookie 的key名称,用于实现持久连接 insert:如果没有就插入新的cookie indirect:不会向客户端发送服务器已经处理过请求的cookie信息,间接 nocache:当client和hapoxy之间有缓存时,不缓存cookie2、配置实例listen web_host bind 192.168.32.204:80 mode http log global balance roundrobin cookie SERVER-COOKIE insert indirect nocache server web1 10.0.0.201:80 cookie web1 check inter 3000 fall 3 rise 5 server web2 10.0.0.202:80 cookie web2 check inter 3000 fall 3 rise 53、测试[root@node3 ~]# curl --cookie "SERVER-COOKIE=web1" http://192.168.32.204/index.html web01 10.0.0.201 [root@node3 ~]# curl --cookie "SERVER-COOKIE=web2" http://192.168.32.204/index.html web02 10.0.0.20...
 
0

HAPROXY的调度算法

发表者:admin分类:应用服务2023-01-07 11:05:26 阅读[271]
HAPROXY的调度算法一、实验拓扑及环境 System OS: CentOS Linux release 7.8.2003 (Core) 内核:3.10.0-1127.el7.x86_64 web01: node1 10.0.0.201 nginx web02: node2 10.0.0.202 nginx haproxy: node4 192.168.32.204 外网 node4 10.0.0.204 内网 客户机: node3 192.168.32.203实验环境的部署见《二、Haproxy的部署及配置文件说明》https://www.cnblogs.com/yaokaka/二、服务器动态权重调整yum install -y socat #Socat 是 Linux 下的一个多功能的网络工具,名字来由是Socket CAT,Socat 的主要特点就是在两个数据流之间建立通道,且支持众多协议和链接方式。如 IP、TCP、 UDP、IPv6、Socket文件等。 #查看haproxy的信息 echo "show info" | socat stdio /var/lib/haproxy/haproxy.sock # echo "get weight web_port/web01" | socat stdio /var/lib/haproxy/haproxy.sock 1 (initial 1) echo "set weight web_port/web01 2" | socat stdio /var/lib/haproxy/haproxy.sock Backend is using a static LB algorithm and only accepts weights '0%' and '100%'.三、Haproxy的调度算法1、静态算法静态算法:按照事...
 
0
一、Haproxy在centos7上的部署1、实验环境System OS: CentOS Linux release 7.8.2003 (Core) 内核:3.10.0-1127.el7.x86_642、yum安装[root@node4 ~]# yum provides haproxy Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile haproxy-1.5.18-9.el7.x86_64 : TCP/HTTP proxy and load balancer for high availability environments Repo : base [root@node4 ~]# yum install -y haproxy #yum部署的haproxy版本为比较旧3、第三方安装包部署 #https://pkgs.org/download/haproxy #下载rpm包 #部署步骤 #准备工作 mkdir /app cd /app #Download latest cheese-release rpm from #http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release.html wget http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release-7-1.noarch.rpm #Install cheese-release rpm: rpm -Uvh cheese-release*rpm #查看可以安装的haproxy版本 [root@node4 ~]# yum provides haproxy Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile haproxy-1.5.15-1.el...
Nginx+MySQL+keepalived高可用+lsyncd双向同步方案点击打开查看完整文档  一,双机高可用方案。  1,主机环境。主机:IP:192.168.122.10,Centos7,MySQL5.7,nginx,keepalived,rsync备机:IP:192.168.122.20,Centos7,MySQL5.7,nginx,keepalived,rsyncVIP:192.168.122.30实现效果:两台主机配置mysql双主同步,nginx+rsync实现web资源实时双向同步,vip提供高可用,JAVA应用需手动同步。  2,业务系统高可用拓扑图二,keepalived安装与配置。1,keepalived简介简单地说,keepalived 就是通过管理 VIP 来实现机器的高可用的,在使用 keepalived 的情况下,只有一台服务器能够提供服务(通过 VIP 来实现),当 Master 主机宕机后,VIP 会自动飘移到另一台服务器。keepalived 采用 Master/Slave 模式, 在 Master 上设置配置文件的 VIP,当 Master 宕机后,VIP 自动漂移到另一台 keepalived 服务器上。keepalived 可以用来做各种软件的高可用集群,它会一直检测服务器的状态,如果有一台服务器宕机,或工作出现故障,keepalived 将检测到,并将有故障的服务器从系统中剔除,同时使用其他服务器代替该服务器的工作,当服务器工作正常后 keepalived 自动将服...
yum 安装时提示 manged by the "local" yum plugin[root@server252 ~]# yum install libssl.so已加载插件:aliases, auto-update-debuginfo, axelget, changelog, copr, dellsysid, fastestmirror, filter-data, fs-snapshot, keys, langpacks, list-data,          : local, merge-conf, ovl, post-transaction-actions, pre-transaction-actions, priorities, protectbase, ps, remove-with-leaves, rpm-warm-          : cache, show-leaves, tmprepo, tsflags, upgrade-helper, verify, versionlockTraceback (most recent call last):  File "/usr/bin/yum", line 29, in <module>    yummain.user_main(sys.argv[1:], exit_code=True)  File "/usr/share/yum-cli/yummain.py", line 375, in user_main    errcode = main(args)  File "/usr/share/yum-cli/yummain.py", line 184, in main    result, resultmsgs = base.doCommands()  File "/usr/share/yum-cli/cli.py", line 585, in doCommand...
Centos 7下如何配置SMTP SSL(邮箱发送功能)简介: Centos 7下如何配置SMTP SSL(邮箱发送功能)1.安装opensslyum install -y openssl openssl-devel2.安装mailxyum -y install mailx3.启用SSL功能mkdir -p /root/.certs/ cd $HOME echo n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE/,/END CERTIFICATE/p' > ~/.certs/qq.crt certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt certutil -L -d /root/.certs 说明:在执行以上命令过程中,如果没有出现错误提示,说明操作成功;否则需要把这个问题解决才能做后面的操作4.配置mail.rc文件vim /etc/mail.rc在mail.rc文件末尾增加如下内容set from= set smtp=smtps://smtp.qq.com:465 set smtp-auth-user= set smtp-auth-password= set smtp-auth=login set ssl-verify=ignore set nss-config-dir=/root/.certs#使用qq邮箱来发送邮件set from=XXXXX@qq.com    #你要使用的邮箱地址set smtp=smtps://smtp....
完美解决xhost +报错: unable to open display oracle安装先切换到root用户,执行 xhost +然后再切换到oracle用户,执行export DISPLAY=:0.0  出现乱码执行export LANG=US_en在这里给大家介绍下两种情况的常见问题:一种是本地运行的命令,另一种则是远程ssh命令安装。DISPLAY变量是用来设置将图形显示到何处.比如CENTOS,你用图形界面登录进去,DISPLAY自动设置为DISPLAY=:0.0表示显式到本地监视器,那么通过终端工具(例如:xshell)进去,运行图形界面的程序,如果没有设置,系统是不允许程序启动的。在执行xhost +命令(使得所有客户都可以访问)正常返回信息为:access control disabled,clients can connect from any host如果xhost +不能执行,报错:xhost :  unable to open display 可以输入命令:export DISPLAY=:0执行一下再执行xhost +xhost + ip (name表示该ip机器可以使用该服务)远程ssh安.先切换到root用户,执行xhost +()正常返回:access control disabled,clients can connect from any&nb...
 
0
Centos7/RHEL7调整时区为CST中国时区1,查询系统中有哪些时区。#: timedatectl list-timezones如果只有UTC时区,说明,tzdata软件没有安装。2,安装tzdata后才可以使用命令调整时区。#:yum  -y install tzdata 3,更换时区。#:timedatectl set-timezone Asia/Shanghai4,查看时区信息与时间。[root@server252 ~]# date2022年 07月 27日 星期三 11:14:00 CST [root@server252 ~]# timedatectl      Local time: 三 2022-07-27 11:14:06 CST  Universal time: 三 2022-07-27 03:14:06 UTC        RTC time: 三 2022-07-27 03:14:06       Time zone: Asia/Shanghai (CST, +0800)     NTP enabled: yesNTP synchronized: yes RTC in local TZ: no      DST active: n/a修改系统时间与硬件时间方法        1.查看当前系统时间 date       2.修改当前系统时间 date -s "2018-2-22 19:10:30       3.查看硬件时...
CentOS7设置为X11显示图形软件操作(终端) vi /etc/ssh/sshd_config#AllowAgentForwarding yes AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes X11DisplayOffset 10 // 这里注意,如果修改为10,那么系统中 DISPLAY:10.0 。 X11UseLocalhost no //网上很多说明这里保持默认不需要修改 #PermitTTY yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yesyum install -y xorg-x11-xauth          #安装x11组件包 yum -y install wqy-zenhei-fonts*    #安装中文字库yum install -y gedit systemctl  restart sshd最后测试下gedit命令,是否能打开软件图形界面
    总共46页,当前第3页 | 页数:
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13