问题导读
1.本文绑定双网卡包含了哪些步骤? 2.如何绑定双网卡?
一、停止集群服务 登录regionserver服务器,使用hadp用户操作 hbase-daemon.sh stopregionserver hadoop-daemon.shstop tasktracker hadoop-daemon.shstop datanode /software/servers/zookeeper-3.4.3/bin/zkServer.shstop 二、绑定双网卡 登录regionserver服务器,使用root用户操作 1.备份 mkdir/etc/sysconfig/network-scripts/backup mv/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/backup/ mv/etc/sysconfig/network-scripts/ifcfg-eth1/etc/sysconfig/network-scripts/backup/ mkdir/etc/modprobe.d/backup cp /etc/modprobe.d/dist.conf/etc/modprobe.d/backup/ mkdir /etc/backup cp /etc/rc.local/etc/backup 2.绑定双网卡,注意:一定要填写实际IP shell# vim/etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=static ONBOOT=yes IPADDR=172.XX.XX.XX NETMASK=255.XX.XX.0 GATEWAY=172.XX.XX.XX USERCTL=no TYPE=Ethernet shell# vim/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no TYPE=Ethernet shell# vim/etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes USERCTL=no TYPE=Ethernet shell# vim/etc/modprobe.d/dist.conf alias bond0 bonding options bond0 mode=0miimon=100 shell# vim/etc/rc.local ifenslave bond0 eth0eth1 3.接入物理双网线 4.启动网卡检测状态 打开ilo进行操作 ifconfig eth0 up ifconfig eth1 up service networkrestart ifconfig 5.回滚,在有必要时执行 rm -rf/etc/sysconfig/network-scripts/ifcfg-bond0 rm -rf/etc/sysconfig/network-scripts/ifcfg-eth0 rm -rf/etc/sysconfig/network-scripts/ifcfg-eth1 mv/etc/sysconfig/network-scripts/backup/ifcfg-eth0/etc/sysconfig/network-scripts/ mv/etc/sysconfig/network-scripts/backup/ifcfg-eth1/etc/sysconfig/network-scripts/ rmdir/etc/sysconfig/network-scripts/backup rm -rf/etc/modprobe.d/dist.conf mv/etc/modprobe.d/backup/dist.conf /etc/modprobe.d/ rmdir/etc/modprobe.d/backup rm -rf /etc/rc.local mv/etc/backup/rc.local /etc/ rmdir /etc/backup 三、启动集群服务 登录regionserver服务器,使用hadp用户操作 /software/servers/zookeeper-3.4.3/bin/zkServer.shstart hadoop-daemon.shstart datanode hadoop-daemon.shstart tasktracker hbase-daemon.shstart regionserver
|