电话

0431-85663671

0431-85636186

联系我们

关注我们

xkzjsjwxgzpt
首页

就业新闻

万博官网manbetx电脑版展企业级CENTOS集群脚本出炉
发布时间:2017-02-19 07:48:37| 浏览次数:

万博官网manbetx电脑版展版权所有 盗用必究!

#!/bin/bash
#product xkz computer school

#by 2016
clear
echo "---------------------------------------------------------------------------------"
echo "            Welecome to xkz cluster setup model            "
echo "----------------------------------------------------------------------------------"



echo "LDirector setup....."


i="/sbin/ifconfig"
#-----------network setup
read -p "please input your DIPCARD:" dcard
read -p "please input your VIPCARD:" vcard
read -p "please input your DIP:" dip
read -p "please input your VIP:" vip
read -p "please input your DNS:" dns
read -p "please input your GATEWAY:" gateway
read -p "please input NO.1realserverIP:" aip
read -p "please input NO.2realserverIP:" bip
$i $dcard $dip up
$i $vcard $vip up
echo "nameserver $dns">/etc/resolv.conf
route add default gw $gateway
echo "1">/proc/sys/net/ipv4/ip_forward
clear
echo "network OK!"
sleep 2
#------------secrity setup
iptables -F
chkconfig --level 35 iptables off
setenforce 0
echo 'SELINUX=disabled'>/etc/sysconfig/selinux
echo 'SELINUXTYPE=targeted'>>/etc/sysconfig/selinux
echo "secrity OK"
sleep 2
#-------------software setup
yum -y install ipvsadm*
clear
echo "ipvsadm-setup OK"
sleep 2

#-------------ipvsadm setup
read -p "choose your cluster service:" cs
read -p "choose your cluster algorithm:" sf
ipvsadm -A -t $vip:$cs -s $sf
ipvsadm -a -t $vip:$cs -r $aip -m
ipvsadm -a -t $vip:$cs -r $bip -m
clear
echo "cluster LD-setup OK..."
sleep 3


clear
echo "--------------NO.1realserver-setup----------------"
echo "--------------------------------------------------"
echo "--------------------------------------------------"
read -p "please set NO.1realserverIP:192.168.1.213 to return to press any key to continue..." var
rs1="192.168.1.213"
ssh-keygen -t rsa -P ''
ssh-copy-id -i .ssh/id_rsa.pub root@$rs1
clear
echo "ssh-setup OK"
sleep 2
ssh  $rs1 'route add default gw 192.168.1.1'
ssh $rs1 'echo "nameserver 118.118.118.1">/etc/resolv.conf'
ssh $rs1 'yum -y install httpd'
ssh $rs1 'echo "web1">/var/www/html/index.html'
ssh $rs1 'echo "DEVICE=eth0">/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "ONBOOT=yes">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "BOOTPROTO=static">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "IPADDR=172.16.0.2">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "DNS1=118.118.118.1">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "GATEWAY=172.16.0.1">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "SELINUX=disabled">/etc/sysconfig/selinux'
ssh $rs1 'echo "SELINUXTYPE=targeted">>/etc/sysconfig/selinux'
ssh $rs1 'chkconfig --level 35 iptables off'
ssh $rs1 'chkconfig --level 35 httpd on'
ssh $rs1 'init 6'
clear
echo "NO.1realserver setup OK"
sleep 3


clear
echo "--------------NO.2realserver-setup----------------"
echo "--------------------------------------------------"
echo "--------------------------------------------------"
read -p "please set NO.1realserverIP:192.168.1.215 to return to press any key to continue..." var
rs1="192.168.1.215"
ssh-keygen -t rsa -P ''
ssh-copy-id -i .ssh/id_rsa.pub root@$rs1
clear
echo "ssh-setup OK"
sleep 2
ssh  $rs1 'route add default gw 192.168.1.1'
ssh $rs1 'echo "nameserver 118.118.118.1">/etc/resolv.conf'
ssh $rs1 'yum -y install httpd'
ssh $rs1 'echo "web2">/var/www/html/index.html'
ssh $rs1 'echo "DEVICE=eth1">/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "ONBOOT=yes">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "BOOTPROTO=static">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "IPADDR=172.16.0.3">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "DNS1=118.118.118.1">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "GATEWAY=172.16.0.1">>/etc/sysconfig/network-scripts/ifcfg-eth0'
ssh $rs1 'echo "SELINUX=disabled">/etc/sysconfig/selinux'
ssh $rs1 'echo "SELINUXTYPE=targeted">>/etc/sysconfig/selinux'
ssh $rs1 'chkconfig --level 35 iptables off'
ssh $rs1 'chkconfig --level 35 httpd on'
ssh $rs1 'init 6'
clear
echo "NO.2realserver setup OK"




clear
echo "---------------------the xkz cluster------------------------ "
echo "----------------------VIP is:$vip----------------------------"
echo "---------------------SERVICE is:web--------------------------"
echo "-----------REALSERVER:2(172.16.0.2 172.16.0.3)---------------"
sleep 5
exit 0

 
 
打印本页 || 关闭窗口
 上一篇:万博官网manbetx电脑版展教你Excel中输入数字自动转换为中文大写数字
 下一篇:万博官网manbetx电脑版展2017年初万博官网手机版本登陆实战排尺成功进行

万博官网manbetx电脑版_万博体育app手机下载_万博官网手机版本登陆

  • <tr id='bf8c34'><strong id='bf8c34'></strong><small id='bf8c34'></small><button id='bf8c34'></button><li id='bf8c34'><noscript id='bf8c34'><big id='bf8c34'></big><dt id='bf8c34'></dt></noscript></li></tr><ol id='bf8c34'><option id='bf8c34'><table id='bf8c34'><blockquote id='bf8c34'><tbody id='bf8c34'></tbody></blockquote></table></option></ol><u id='bf8c34'></u><kbd id='bf8c34'><kbd id='bf8c34'></kbd></kbd>

    <code id='bf8c34'><strong id='bf8c34'></strong></code>

    <fieldset id='bf8c34'></fieldset>
          <span id='bf8c34'></span>

              <ins id='bf8c34'></ins>
              <acronym id='bf8c34'><em id='bf8c34'></em><td id='bf8c34'><div id='bf8c34'></div></td></acronym><address id='bf8c34'><big id='bf8c34'><big id='bf8c34'></big><legend id='bf8c34'></legend></big></address>

              <i id='bf8c34'><div id='bf8c34'><ins id='bf8c34'></ins></div></i>
              <i id='bf8c34'></i>
            1. <dl id='bf8c34'></dl>
              1. <blockquote id='bf8c34'><q id='bf8c34'><noscript id='bf8c34'></noscript><dt id='bf8c34'></dt></q></blockquote><noframes id='bf8c34'><i id='bf8c34'></i>