DEVICE=bond0
ONBOOT=yes
IPADDR=xxx.xxx.xxx.xxx
BOOTPROTO=none
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=xxx.xxx.xxx.xxx
USERCTL=no
BONDING_MASTER=yes
BONDING_OPTS="mode=active-backup miimon=100"
~

DEVICE=eth0
HWADDR=d4:85:64:c7:85:ce
NM_CONTROLLED=yes
MASTER=bond0
SLAVE=yes
ONBOOT=no
BOOTPROTO=none
USERCTL=no
 

DEVICE=eth1
HWADDR=D4:85:64:C7:85:D0
NM_CONTROLLED=yes
ONBOOT=no
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no

 

modprobe.conf 에서 /etc/modprobe.d  로 변경

[root@xxx modprobe.d]# vi bonding.conf [파일생성]

alias bond0 bonding

 

본딩모드 숫자로는 안먹네요

 

  • balance-rr or 0 — Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.
  • active-backup or 1 — Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.
  • balance-xor or 2 — Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.
  • broadcast or 3 — Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
  • 802.3ad or 4 — Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.
  • balance-tlb or 5 — Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.
  • balance-alb or 6 — Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.

구체적인 내용이 다를 수도 있으나, 기술해주신 문제 내용과 이전에 유사 사 
례를 바탕으로 판단해보면 동일 이슈로 판단됩니다.

이러한 동작은 RFC 1812의 46-49, 55, 90 페이지에 기술되어있는 표준 반응 
이며, 커널 파라미터인  rp_filter(Reverse Path Filtering)를 disable 하시 
면 문제없이 데이터를 받으실 수 있습니다.

rp_filter는 Source IP를 검증(validation)하는 기능으로, Multicast 패킷 
의 Source IP 주소가 있는 Subnet과 이에 대해 응답하는 인터페이스의 Subnet 
이 다를 경우, 해당 패키지를 Drop하는 역할(필터)를 수행합니다.

특히 Red Hat Enterprise Linux 6에서는 이 필터의 룰이 보다 엄격해졌고, 
파라미터 값도 조금씩 차이가 있습니다. 다음과 같이 적용하신 후에 네트워크 
를 재시작하여 테스트 해보시기 바랍니다.

# vi /etc/sysctl.conf
net.ipv4.conf.default.rp_filter = 2
# sysctl -p
# service network restart

'Linux 이야기. > LInux Article.' 카테고리의 다른 글

Linux Shared Memory에 대한 Handling  (0) 2012.05.25
Linux Memory 매니지먼트  (0) 2012.05.14
Linux Memory의 상태를 분석하라  (0) 2012.05.11
OpenStack RedHat Contribution  (0) 2012.04.19
RHEL6에서 Bonding 하기  (0) 2012.02.29
앞장에서 FCP 영역에 대한 SCSI 디스크들을 모두 Remove 했다면.. 그와 관련된 FCP 디바이스들에 대한

Sysfs들 모두를 Remove 해줄 필요도 있다...굳이 재부팅 하지 않아도 된다는...^^

===================================================================

#!/bin/sh
#
# ------------------------------------------------------------------
# | REMOVES ALL ZFCP-RELATED SYSFS ENTRIES |
# | |
# | Author: Marc Beyerle (marc.beyerle@de.ibm.com), 12/12/2008 |
# | Copyright IBM Corp. 2008 |
# ------------------------------------------------------------------

SYSFS_DIRECTORY="/sys/bus/ccw/drivers/zfcp"

if [ -e "${SYSFS_DIRECTORY}" ]; then
 
   # change to the sysfs directory containing all zfcp adapters
     cd "${SYSFS_DIRECTORY}"
 
 # find all zfcp adapters
   ADAPTERS=$(find . -maxdepth 1 -name "0.0.*" | cut -c 3-)
else
   # the sysfs directory for the zfcp adapters does not exist
   ADAPTERS=""
fi

if [ -z "${ADAPTERS}" ]; then
   # print information
   echo -e "\nNo zfcp adapters found."
fi

# iterate over all zfcp adapters found
for ADAPTER in ${ADAPTERS}; do
    # change to this zfcp adapter's directory
    cd "${SYSFS_DIRECTORY}/${ADAPTER}"

# print information
echo -e "\nNow removing all sysfs entries of zfcp adapter ${ADAPTER}."

# find all wwpns of this zfcp adapter
WWPNS=$(find . -maxdepth 1 -name "0x*" | cut -c 3-)

if [ -z "${WWPNS}" ]; then
   # print information
   echo "No WWPNs found for zfcp adapter ${ADAPTER}."
fi

# iterate over all wwpns found
for WWPN in ${WWPNS}; do
   # change to this wwpn's directory
cd "${SYSFS_DIRECTORY}/${ADAPTER}/${WWPN}"

# find all luns of this wwpn
LUNS=$(find . -maxdepth 1 -name "0x*" | cut -c 3-)

if [ -z "${LUNS}" ]; then
   # print information
   echo "No LUNs found for WWPN ${WWPN}."
fi

# iterate over all luns found
for LUN in ${LUNS}; do
   # print information
   echo -n "Removing LUN ${LUN}... "

# remove this lun
echo ${LUN} > unit_remove

 if [ "${?}" -eq "0" ]; then
    # print success message (otherwise the error is printed above)
    echo "OK"
  fi
done

# change (again) to this zfcp adapter's directory
cd "${SYSFS_DIRECTORY}/${ADAPTER}"

# print information
echo -n "Removing WWPN ${WWPN}... "

# remove this wwpn
echo ${WWPN} > port_remove

  if [ "${?}" -eq "0" ]; then
      # print success message (otherwise the error is printed above)
      echo "OK"
  fi
   done
done
# print an empty line
echo
==================================================================

그냥 가져다 써도..잘 작동하네..
일반적인 zLinux의 디스크 운영은 DASD 디스크와 FCP (scsi) 디스크의 혼합해서 운영을 하는 것이 일반적이다.

LVM으로 구성된 SCSI 영역을 Rebooting 없이 SCSI 영역을 Remove 하고..Port 또한 정상적으로  Remove 할수 있는

유용한 스크립트인듯 하다.. (첨부파일 참조)

A.1 Set all SCSI devices offline
File name:

/usr/local/sbin/remove_scsi_devices.sh

A.1 Set all SCSI devices offline

File name:
/usr/local/sbin/remove_scsi_devices.sh

File contents:
#!/bin/sh
#
# ------------------------------------------------------------------
# | REMOVES ALL SCSI DEVICES |
# | |
# | Author: Marc Beyerle (marc.beyerle@de.ibm.com), 12/12/2008 |
# | Copyright IBM Corp. 2008 |
# ------------------------------------------------------------------
#
# the sysfs directory containing all scsi devices
SYSFS_DIRECTORY="/sys/class/scsi_device"

if [ -e "${SYSFS_DIRECTORY}" ]; then
   # change to the sysfs directory containing all scsi devices
   cd "${SYSFS_DIRECTORY}"

  # find all scsi devices
  DEVICES=$(find . -maxdepth 1 | grep -v "^.$" | cut -c 3-)
else
   # the sysfs directory for the scsi devices does not exist
   DEVICES=""
fi

# print an empty line
echo

if [ -z "${DEVICES}" ]; then
   # print information
   echo "No SCSI devices found."
fi

# iterate over all scsi devices found
for DEVICE in ${DEVICES}; do
     # change to this scsi device's directory
     cd "${SYSFS_DIRECTORY}/${DEVICE}/device"

# print information
echo -n "Removing SCSI device ${DEVICE}... "

# remove this scsi device
echo 1 > delete

if [ "${?}" -eq "0" ]; then
   # print success message (otherwise the error is printed above)
   echo "OK"
    fi
done
# print an empty line
echo
====================================================================
스크립트 수행후  lssci 명령어를 수행했을때 SCSI 디스크들이 보이지 않으면 정상..

그냥 가져다가 수행해도..잘 돌아가네..


리눅스에서 파일 시스템을 클러스터를 적용하여  Local 시스템에 대한 Mount가 잘 되었는지 확인이
필요할때가 있다. /proc/mounts 의 정보를 Gathering 하여 간략하게 스크립트화 해보자.

#!/bin/sh

####################################
#check filesystem mount
###################################
count=0

for i in $(seq 1 3)
do
if grep -qs "tsalv$i" /proc/mounts; then
        let count=count+1
else
    echo "tsalv0$i not mount"
fi
done;

if  [ $count -eq 3 ]
then
        exit 1
else
        exit 2
fi

exit 0

=======================================
쉘스크립트에 있어서 Return 값을 확인하여 정상적으로 모든 파일시스템이
마운트 되었는가를 확인한다.


파일시스템 체크
==================================================================

#!/bin/sh
#
# local_fs - check and mount local filesystems
#
PATH=/sbin:/bin ; export PATH

fsck -ATCp
if [ $? -gt 1 ]; then
  echo "Filesystem errors still exist!  Manual intervention required."
  /bin/sh
else
  echo "Remounting / as read-write."
  mount -n -o remount,rw /
  echo -n >/etc/mtab
  mount -f -o remount,rw /
  echo "Mounting local filesystems."
  mount -a -t nonfs,nosmbfs
fi
#
# end of local_fs

+ Recent posts