当前位置: 首页 > news >正文

那个网站做宝贝主图好古腾堡 主题 wordpress

那个网站做宝贝主图好,古腾堡 主题 wordpress,网站怎么推广,邢台太行中学招生电话集群 将很多机器组织到一起#xff0c;作为一个整体对外提供服务 集群在扩展性、性能方面都可以做到很灵活 集群分类#xff1a; 负载均衡集群#xff1a;Load Balance高可用集群#xff1a;High Availability高性能计算#xff1a;High Performance Computing LVS LVS…集群 将很多机器组织到一起作为一个整体对外提供服务 集群在扩展性、性能方面都可以做到很灵活 集群分类 负载均衡集群Load Balance高可用集群High Availability高性能计算High Performance Computing LVS LVSLinux Virtual ServerLinux虚拟服务器 实现负载均衡集群 作者章文嵩。国防科技大学读博士期间编写 LVS的工作模式 NAT网络地址转换DR路由模式TUN隧道模式 术语 调度器LVS服务器真实服务器Real Server提供服务的服务器VIP虚拟地址提供给用户访问的地址DIP指定地址LVS服务器上与真实服务器通信的地址RIP真实地址真实服务器的地址 常见的调度算法共10个常用的有4个 轮询rrReal Server轮流提供服务加权轮询wrr根据服务器性能设置权重权重大的得到的请求更多最少连接lc根据Real Server的连接数分配请求加权最少连接wlc类似于wrr根据权重分配请求 环境准备 pubservereth0-192.168.88.240eth1-192.168.99.240client1eth0-192.168.88.10网关192.168.88.5lvs1: eth0 - 192.168.88.5eth1-192.168.99.5web1eth1-192.168.99.100网关192.168.99.5web2eth1-192.168.99.200网关192.168.99.5虚拟机已关闭selinux和防火墙 。在pubserver上准备管理环境 # 创建工作目录[rootpubserver ~]# mkdir cluster[rootpubserver ~]# cd cluster/#创建主配置文件[rootpubserver cluster]# vim ansible.cfg[defaults]inventory inventoryhost_key_checking false # 不检查主机密钥# 创建主机清单文件及相关变量[rootpubserver cluster]# vim inventory[clients]client1 ansible_host192.168.88.10[webservers]web1 ansible_host192.168.99.100web2 ansible_host192.168.99.200[lb]lvs1 ansible_host192.168.88.5[all:vars] # all是ansible自带的组表示全部主机ansible_ssh_userrootansible_ssh_passa# 创建文件目录用于保存将要拷贝到远程主机的文件[rootpubserver cluster]# mkdir files# 编写yum配置文件[rootpubserver cluster]# vim files/local88.repo[BaseOS]name BaseOSbaseurl ftp://192.168.88.240/dvd/BaseOSenabled 1gpgcheck 0[AppStream]name AppStreambaseurl ftp://192.168.88.240/dvd/AppStreamenabled 1gpgcheck 0[rpms]name rpmsbaseurl ftp://192.168.88.240/rpmsenabled 1gpgcheck 0[rootpubserver cluster]# vim files/local99.repo[BaseOS]name BaseOSbaseurl ftp://192.168.99.240/dvd/BaseOSenabled 1gpgcheck 0[AppStream]name AppStreambaseurl ftp://192.168.99.240/dvd/AppStreamenabled 1gpgcheck 0[rpms]name rpmsbaseurl ftp://192.168.99.240/rpmsenabled 1gpgcheck 0# 编写用于上传yum配置文件的playbook[rootpubserver cluster]# vim 01-upload-repo.yml---- name: config repos.dhosts: alltasks:- name: delete repos.d # 删除repos.d目录file:path: /etc/yum.repos.dstate: absent- name: create repos.d # 创建repos.d目录file:path: /etc/yum.repos.dstate: directorymode: 0755- name: config local88 # 上传repo文件到88网段hosts: clients,lbtasks:- name: upload local88copy:src: files/local88.repodest: /etc/yum.repos.d/- name: config local99 # 上传repo文件到99网段hosts: webserverstasks:- name: upload local99copy:src: files/local99.repodest: /etc/yum.repos.d/[rootpubserver cluster]# ansible-playbook 01-upload-repo.yml 配置LVS NAT模式步骤 配置2台web服务器 # 创建首页文件文件中包含ansible facts变量[rootpubserver cluster]# vim files/index.htmlWelcome from {{ansible_hostname}}# 配置web服务器[rootpubserver cluster]# vim 02-config-webservers.yml---- name: config webservershosts: webserverstasks:- name: install nginx # 安装nginxyum:name: nginxstate: present- name: upload index # 上传首页文件到web服务器template:src: files/index.htmldest: /usr/share/nginx/html/index.html- name: start nginx # 启动服务service:name: nginxstate: startedenabled: yes[rootpubserver cluster]# ansible-playbook 02-config-webservers.yml# 在lvs1上测试到web服务器的访问[rootlvs1 ~]# curl http://192.168.99.100Welcome from web1[rootlvs1 ~]# curl http://192.168.99.200Welcome from web2 确保lvs1的ip转发功能已经打开。该功能需要改变内核参数 # 查看ip转发功能的内核参数[rootlvs1 ~]# sysctl -a # 查看所有的内核参数[rootlvs1 ~]# sysctl -a | grep ip_forward # 查看ip_foward参数net.ipv4.ip_forward 1 # 1表示打开转发0表示关闭转发# 设置打开ip_forward功能[rootpubserver cluster]# vim 03-sysctl.yml---- name: config sysctlhosts: lbtasks:- name: set ip_forwardsysctl: # 用于修改内核参数的模块name: net.ipv4.ip_forward # 内核模块名value: 1 # 内核模块的值sysctl_set: yes # 立即设置生效sysctl_file: /etc/sysctl.conf # 配置写入文件[rootpubserver cluster]# ansible-playbook 03-sysctl.yml# 测试从客户端到服务器的访问[rootclient1 ~]# curl http://192.168.99.100Welcome from web1[rootclient1 ~]# curl http://192.168.99.200Welcome from web2 安装LVS [rootpubserver cluster]# vim 04-inst-lvs.yml---- name: install lvshosts: lbtasks:- name: install lvs # 安装lvsyum:name: ipvsadmstate: present[rootpubserver cluster]# ansible-playbook 04-inst-lvs.yml ipvsadm使用说明 [rootlvs1 ~]# ipvsadm-A: 添加虚拟服务器-E: 编辑虚拟服务器-D: 删除虚拟服务器-t: 添加tcp服务器-u: 添加udp服务器-s: 指定调度算法。如轮询rr/加权轮询wrr/最少连接lc/加权最少连接wlc-a: 添加虚拟服务器后向虚拟服务器中加入真实服务器-r: 指定真实服务器-w: 设置权重-m: 指定工作模式为NAT-g: 指定工作模式为DR 配置LVS # 为web服务器创建虚拟服务器使用rr调度算法[rootlvs1 ~]# ipvsadm -A -t 192.168.88.5:80 -s rr# 查看配置[rootlvs1 ~]# ipvsadm -Ln # L是列出n是使用数字而不是名字# 向虚拟服务器中添加RIP[rootlvs1 ~]# ipvsadm -a -t 192.168.88.5:80 -r 192.168.99.100 -w 1 -m[rootlvs1 ~]# ipvsadm -a -t 192.168.88.5:80 -r 192.168.99.200 -w 2 -m# 查看配置[rootlvs1 ~]# ipvsadm -Ln# 验证[rootclient1 ~]# for i in {1..6} do curl http://192.168.88.5 doneWelcome from web2Welcome from web1Welcome from web2Welcome from web1Welcome from web2Welcome from web1# 删除配置。如果配置有错用以下命令删除重配置[rootlvs1 ~]# ipvsadm -D -t 192.168.88.5:80# 修改调度模式为加权轮询[rootlvs1 ~]# ipvsadm -E -t 192.168.88.5:80 -s wrr# 验证配置[rootclient1 ~]# for i in {1..6}; do curl http://192.168.88.5; doneWelcome from web2Welcome from web2Welcome from web1Welcome from web2Welcome from web2Welcome from web1 LVS DR模式 LVS DR模式LVS主机和web服务器都是单网卡。它们连在同一网络中 修改实验环境 client1eth0- 192.168.88.10lvs1eth0-192.168.88.5删除eth1的IPweb1eth0-192.168.88.100删除eth1的IPweb2eth0-192.168.88.200删除eth1的IP # 删除lvs虚拟服务器配置[rootlvs1 ~]# ipvsadm -D -t 192.168.88.5:80[rootlvs1 ~]# ipvsadm -Ln# 删除lvs1上eth1的配置[rootlvs1 ~]# nmcli connection modify eth1 ipv4.method disabled ipv4.addresses [rootlvs1 ~]# nmcli connection down eth1# 修改web1的配置停掉eth1的地址。配置eth0的地址为192.168.88.100# 进入网卡配置文件目录[rootweb1 ~]# cd /etc/sysconfig/network-scripts/# eth0网卡的配置文件叫ifcfg-eth0[rootweb1 network-scripts]# ls ifcfg-eth*ifcfg-eth0 ifcfg-eth1# 配置eth0地址[rootweb1 network-scripts]# vim ifcfg-eth0TYPEEthernet # 网络类型为以太网BOOTPROTOnone # IP地址是静态配置的也可以用staticNAMEeth0 # 为设备重命名DEVICEeth0 # 网卡设备名ONBOOTyes # 开机激活网卡IPADDR192.168.88.100 # IP地址PREFIX24 # 子网掩码长度GATEWAY192.168.88.254 # 网关[rootweb1 ~]# systemctl restart NetworkManager # 重启网络服务# 在web1上停掉eth1[rootweb1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1TYPEEthernetBOOTPROTOnoneNAMEeth1DEVICEeth1ONBOOTno[rootweb1 ~]# nmcli connection down eth1 # 终端卡住关掉它在新终端重新连# 修改web2的网络[rootweb2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 TYPEEthernetBOOTPROTOnoneNAMEeth0DEVICEeth0ONBOOTyesIPADDR192.168.88.200PREFIX24GATEWAY192.168.88.254[rootweb2 ~]# systemctl restart NetworkManager[rootweb2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1TYPEEthernetBOOTPROTOnoneNAMEeth1DEVICEeth1ONBOOTno[rootweb2 ~]# nmcli connection down eth1# 修改pubserver的主机清单文件[rootpubserver cluster]# cp inventory inventory.bak[rootpubserver cluster]# vim inventory[clients]client1 ansible_host192.168.88.10[webservers]web1 ansible_host192.168.88.100web2 ansible_host192.168.88.200[lb]lvs1 ansible_host192.168.88.5[all:vars]ansible_ssh_userrootansible_ssh_passa# 修改2台web服务器yum配置文件中的地址[rootweb1 ~]# sed -i s/99/88/ /etc/yum.repos.d/local99.repo[rootweb1 ~]# cat /etc/yum.repos.d/local99.repo[BaseOS]name BaseOSbaseurl ftp://192.168.88.240/dvd/BaseOSenabled 1gpgcheck 0[AppStream]name AppStreambaseurl ftp://192.168.88.240/dvd/AppStreamenabled 1gpgcheck 0[rpms]name rpmsbaseurl ftp://192.168.88.240/rpmsenabled 1gpgcheck 0 配置LVS DR模式 在lvs1的eth0上配置vip 192.168.88.15。 [rootpubserver cluster]# vim 05-config-lvsvip.yml---- name: config lvs viphosts: lbtasks:- name: add viplineinfile: # 确保文件中有某一行内容path: /etc/sysconfig/network-scripts/ifcfg-eth0line: IPADDR2192.168.88.15notify: restart eth0 # 通知执行handlers中的任务handlers: # 被通知执行的任务写到这里- name: restart eth0shell: nmcli connection down eth0; nmcli connection up eth0[rootpubserver cluster]# ansible-playbook 05-config-lvsvip.yml# 在lvs1查看添加的IP地址[rootlvs1 ~]# ip a s eth0 | grep 88inet 192.168.88.5/24 brd 192.168.88.255 scope global noprefixroute eth0inet 192.168.88.15/24 brd 192.168.88.255 scope global secondary noprefixroute eth0 2.在2台web服务器的lo上配置vip 192.168.88.15。lo:0网卡需要使用network-scripts提供的配置文件进行配置 [rootpubserver cluster]# vim 06-config-webvip.yml---- name: config webservers viphosts: webserverstasks:- name: install network-scripts # 安装服务yum:name: network-scriptsstate: present- name: add lo:0 # 创建lo:0的配置文件copy:dest: /etc/sysconfig/network-scripts/ifcfg-lo:0content: |DEVICElo:0NAMElo:0IPADDR192.168.88.15NETMASK255.255.255.255NETWORK192.168.88.15BROADCAST192.168.88.15ONBOOTyesnotify: activate lo:0handlers:- name: activate lo:0 # 激活网卡shell: ifup lo:0[rootpubserver cluster]# ansible-playbook 06-config-webvip.yml# 查看结果[rootweb1 ~]# cd /etc/sysconfig/network-scripts/[rootweb1 network-scripts]# cat ifcfg-lo:0DEVICElo:0NAMElo:0IPADDR192.168.88.15NETMASK255.255.255.255NETWORK192.168.88.15BROADCAST192.168.88.15ONBOOTyes[rootweb1 network-scripts]# ifconfig # 可以查看到lo:0网卡信息lo:0: flags73UP,LOOPBACK,RUNNING mtu 65536inet 192.168.88.15 netmask 255.255.255.255loop txqueuelen 1000 (Local Loopback) 3.在2台web服务器上配置内核参数使得它们不响应对192.168.88.15的请求  [rootweb1 ~]# sysctl -a | grep arp_ignorenet.ipv4.conf.all.arp_ignore 1net.ipv4.conf.lo.arp_ignore 0[rootweb1 ~]# sysctl -a | grep arp_announcenet.ipv4.conf.all.arp_announce 2net.ipv4.conf.lo.arp_announce 0[rootweb1 ~]# vim /etc/sysctl.conf net.ipv4.conf.all.arp_ignore 1net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.lo.arp_announce 2[rootweb1 ~]# sysctl -p[rootweb2 ~]# vim /etc/sysctl.conf net.ipv4.conf.all.arp_ignore 1net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.lo.arp_announce 2[rootweb2 ~]# sysctl -p 4.在lvs1上配置虚拟服务器 # 创建虚拟服务器[rootlvs1 ~]# ipvsadm -A -t 192.168.88.15:80 -s wlc# 向虚拟服务器中加真实服务器[rootlvs1 ~]# ipvsadm -a -t 192.168.88.15:80 -r 192.168.88.100 -w 1 -g[rootlvs1 ~]# ipvsadm -a -t 192.168.88.15:80 -r 192.168.88.200 -w 2 -g# 查看配置[rootlvs1 ~]# ipvsadm -Ln# 客户验证[rootclient1 ~]# for i in {1..6}; do curl http://192.168.88.15/; doneWelcome from web2Welcome from web1Welcome from web2Welcome from web2Welcome from web1Welcome from web2 附出错时排错步骤 # 在lvs上可以访问到web服务器[rootlvs1 ~]# curl http://192.168.88.100/192.168.99.100[rootlvs1 ~]# curl http://192.168.88.200/apache web server2# 查看vip[rootlvs1 ~]# ip a s eth0 | grep 88inet 192.168.88.5/24 brd 192.168.88.255 scope global noprefixroute eth0inet 192.168.88.15/24 brd 192.168.88.255 scope global secondary noprefixroute eth0[rootweb1 ~]# ifconfig lo:0lo:0: flags73UP,LOOPBACK,RUNNING mtu 65536inet 192.168.88.15 netmask 255.255.255.255loop txqueuelen 1000 (Local Loopback)# 查看内核参数[rootweb1 ~]# sysctl -pnet.ipv4.conf.all.arp_ignore 1net.ipv4.conf.lo.arp_ignore 1net.ipv4.conf.all.arp_announce 2net.ipv4.conf.lo.arp_announce 2# 查看规则[rootlvs1 ~]# ipvsadm -LnIP Virtual Server version 1.2.1 (size4096)Prot LocalAddress:Port Scheduler Flags- RemoteAddress:Port Forward Weight ActiveConn InActConnTCP 192.168.88.15:80 wlc- 192.168.88.100:80 Route 1 0 12- 192.168.88.200:80 Route 2 0 18
http://www.zqtcl.cn/news/944268/

相关文章:

  • 滨州建设厅网站长沙好的做网站品牌
  • 教务系统网站建设模板下载为网站开发
  • 成都市建设招标网站加载wordpress外部文件
  • 网站做兼容处理怎么浙江seo博客
  • 设计商城的网站建设电商网站建设与管理实践
  • 怎样建一个英文网站制作视频的手机软件
  • 昆明做网站费用被骗去国外做网站网站推广
  • 京东商城网站怎么做静态网页有什么特点
  • 网站上线准备工作网站源码运行
  • 视频剪辑自学网站wordpress怎样改头像
  • 女装网站模板青岛开发区网站
  • dede网站后台海外网络服务器
  • 三合一企业网站模板wordpress做的外贸网站
  • 常州做企业网站的公司亚马逊雨林有原始部落吗
  • 临沂网站设计哪家好qq浏览器网页版进入
  • seo资料站哔哩哔哩官方网站首页
  • 前端怎么做网站万网域名管理入口
  • asp.net 做网站实例特别酷炫网站
  • 个人网站的内容网页设计图片显示不出来怎么弄
  • 福建省建设人才与科技发展中心网站首页关于制作网站收费标准
  • 什么软件可以发帖子做推广中山优化网站
  • 中山网站建设开发网络营销的基本功能
  • 温州平阳县网站建设兼职免费下载简历模板
  • 导购网站 转化率wordpress 拓展
  • 美文分享网站源码互联网网站建设
  • 做网站用php还是python建设网站价格
  • 平台网站怎么做诱导网站怎么做
  • 网站建设人员构成网址申请域名
  • 微网站建设找哪家公司好郑州一凡网站建设
  • 江阴网站制作公司泉州网站建设论坛