Wednesday 26 June 2013

CentOS 6에서 Intel 10G NIC에서 지원되지 않는 SFP+ 모듈 사용하기



Environment
  • CentOS 6.4 (64bit)
  • Dell OEM Intel 10GB Dual Port NIC
최신 드라이버 설치
tar zxvf ixgbe-3.15.1.tar.gz -C /tmp
cd /tmp/ixgbe-3.15.1/src
make install

드라이버 언로드 및 로드

rmmod ixgbe
modprobe ixgbe allow_unsupported_sfp=1
allow_unsupported_sfp 는 테스트되지 않은 SFP+ 모듈을 로드될 수 있도록 해주는 parameter이다. 하지만 테스트되지 않았기 때문에 안정성은 장담할 수 없다는 것을 명심하자.

드라이버 Parameter 목록 보기

modinfo ixgbe | more

Tuesday 11 June 2013

Creating distributions


다음 화면에서 자동 설치가 가능한 배포본들을 등록한다.

CentOS 6 for i386

Distribution Label
CentOS6-i386
Tree Path
/var/distro-trees/CentOS6/i386
Base Channel
CentOS 6 base i386
Installer Generation
Red Hat Enterprise Linux 6

CentOS 6 for x86_64

Distribution Label
CentOS6-x86_64
Tree Path
/var/distro-trees/CentOS6/x86_64
Base Channel
CentOS 6 base x86_64
Installer Generation
Red Hat Enterprise Linux 6

Populationg the distribution tree

Copy ISO Images

각 ISO 이미지들을 다음 디렉토리에 복사해 놓는다.
[root@spacewalk mnt]# ls -alR /data/ISO
/data/ISO:
total 28
drwxr-xr-x 4 root root 4096 2013-06-11 16:30 .
drwxr-xr-x. 5 root root 4096 2013-06-11 16:31 ..
drwxr-xr-x 4 root root 4096 2013-06-11 16:31 CentOS6
drwx------ 2 root root 16384 2013-04-03 17:20 lost+found
/data/ISO/CentOS6:
total 16
drwxr-xr-x 4 root root 4096 2013-06-11 16:31 .
drwxr-xr-x 4 root root 4096 2013-06-11 16:30 ..
drwxr-xr-x 2 root root 4096 2013-06-11 16:30 i386
drwxr-xr-x 2 root root 4096 2013-06-11 16:31 x86_64
/data/ISO/CentOS6/i386:
total 5109368
drwxr-xr-x 2 root root 4096 2013-06-11 16:30 .
drwxr-xr-x 4 root root 4096 2013-06-11 16:31 ..
-rw-r--r-- 1 root root 3770155008 2013-04-08 10:48 CentOS-6.4-i386-bin-DVD1.iso
-rw-r--r-- 1 root root 1146304512 2013-04-08 10:48 CentOS-6.4-i386-bin-DVD2.iso
-rw-r--r-- 1 root root 315508736 2013-04-08 10:48 CentOS-6.4-i386-minimal.iso
/data/ISO/CentOS6/x86_64:
total 5669712
drwxr-xr-x 2 root root 4096 2013-06-11 16:31 .
drwxr-xr-x 4 root root 4096 2013-06-11 16:31 ..
-rw-r--r-- 1 root root 4353378304 2013-04-08 10:49 CentOS-6.4-x86_64-bin-DVD1.iso
-rw-r--r-- 1 root root 1452388352 2013-04-08 10:50 CentOS-6.4-x86_64-bin-DVD2.iso

ISO 내용 저장 디렉토리 생성

mkdir -p /data/distro-trees/CentOS6
mkdir -p /data/distro-trees/CentOS6/{i386,x86_64}

CentOS 6 ISO 컨텐츠 복사

mkdir -p /mnt/cdrom
mount -o loop <path>/CentOS-6.4-i386-bin-DVD1.iso /mnt/cdrom
rsync -avP /mnt/cdrom/* /var/distro-trees/CentOS6/i386/
mount -o loop <path>/CentOS-6.4-i386-bin-DVD2.iso /mnt/cdrom
rsync -avP /mnt/cdrom/* /var/distro-trees/CentOS6/i386/
mount -o loop <path>/CentOS-6.4-x86_64-bin-DVD1.iso /mnt/cdrom
rsync -avP /mnt/cdrom/* /var/distro-trees/CentOS6/x86_64/
mount -o loop <path>/CentOS-6.4-x86_64-bin-DVD2.iso /mnt/cdrom
rsync -avP /mnt/cdrom/* /var/distro-trees/CentOS6/x86_64/

Client Registration


외부 통신(인터넷) 가능 경우

Installing YUM repository

BASEARCH=$(uname -i)
rpm -Uvh http://yum.spacewalkproject.org/1.9/RHEL/6/$BASEARCH/spacewalk-client-repo-1.9-1.el6.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/$BASEARCH/epel-release-6-8.noarch.rpm

Installing client packages

yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin

Register

rhnreg_ks --serverUrl=http://YourSpacewalk.example.org/XMLRPC --activationkey=<key-with-rhel-custom-channel> 
Example
rhnreg_ks --serverUrl=http://spacewalk.abc.org/XMLRPC --activationkey=1-el6-x86_64

Copy SSL certificate

wget http://YourSpacewalk.example.org/pub/RHN-ORG-TRUSTED-SSL-CERT -p /usr/share/rhn/

Installing OSAD(Open Source Architecture Daemon)

rpm -Uhv jabberpy-0.5-0.21.el6.noarch.rpm
rpm -Uhv osad-5.11.18-1.el6.noarch.rpm
OSAD는 Spacewalk에서 Spacewalk 클라이언트를 제어할 수 있도록 해준다.

Run OSAD service

chkconfig osad on
service osad start

외부 통신 불가능 경우

Importing repository GPG Keys

rpm --import RPM-GPG-KEY-EPEL-6
rpm --import RPM-GPG-KEY-spacewalk-2012

Installing required packages

rpm -Uhv pyOpenSSL-0.10-2.el6.x86_64.rpm
rpm -Uhv python-dmidecode-3.10.13-1.el6.x86_64.rpm
rpm -Uhv pygobject2-2.20.0-5.el6.x86_64.rpm
rpm -Uhv python-gudev-147.1-4.el6_0.1.x86_64.rpm
rpm -Uhv python-hwdata-1.7.3-1.el6.noarch.rpm
rpm -Uhv rhnlib-2.5.55-1.el6.noarch.rpm
rpm -Uhv rhn-client-tools-1.9.10-1.el6.noarch.rpm
rpm -Uhv m2crypto-0.20.2-9.el6.x86_64.rpm
rpm -Uhv rhnsd-5.0.9-1.el6.x86_64.rpm --nodeps
rpm -Uhv rhn-setup-1.9.10-1.el6.noarch.rpm
rpm -Uhv yum-rhn-plugin-1.9.4-1.el6.noarch.rpm
rpm -Uhv rhn-check-1.9.10-1.el6.noarch.rpm

Copy SSL certificate

wget http://YourSpacewalk.example.org/pub/RHN-ORG-TRUSTED-SSL-CERT -p /usr/share/rhn/

Installing OSAD(Open Source Architecture Daemon)

rpm -Uhv jabberpy-0.5-0.21.el6.noarch.rpm
rpm -Uhv osad-5.11.18-1.el6.noarch.rpm

Register

rhnreg_ks --serverUrl=http://YourSpacewalk.example.org/XMLRPC --activationkey=<key-with-rhel-custom-channel> 

Run OSAD service

chkconfig osad on
service osad start

Activation Key


클라이언트 설치 시 자동으로 Spacewalk에 등록시키기 위해 Default Key를 생성한다.

기본 CentOS 6 i386 시스템 등록을 위한 Activation Key 생성

Description
Default Activation Key
Key
1-default-key (앞의 숫자 Organization의 ID로 자동으로 부여된다.)
Base Channel
CentOS 6 base i386
Add-On Entitlements
Monitoring, Provisioning
Universal Default
leave

Child Channels 설정 기본 채널로 CentOS 6 base i386을 등록하였으므로 하위 채널들도 등록해 준다.

Child Channels
CentOS 6 updates i386, EPEL 6 i386, Spacewalk Client i386 for EL6

Groups 그룹 단위로 시스템을 쉽게 관리하기위해 미리 생성한 일반 서버 그룹에 등록해 준다.

Group Name
General-32bit-servers

기본 CentOS 6 x86_64 시스템 등록을 위한 Activation Key 생성

Description
Default key for EL6 x86_64
Key
default-key-el6-x86_64
Base Channel
CentOS 6 base x86_64
Add-On Entitlements
Monitoring, Provisioning
Universal Default
check

Child Channels 설정 기본 채널로 CentOS 6 base i386을 등록하였으므로 하위 채널들도 등록해 준다.

Child Channels
CentOS 6 updates x86_64, EPEL 6 x86_64, Spacewalk Client x86_64 for EL6

Groups

그룹 단위로 시스템을 쉽게 관리하기위해 미리 생성한 일반 서버 그룹에 등록해 준다.

Group Name
General-64bit-servers

Configuration



Spacewalk는 설정 파일들을 관리하고 배포할 수 있도록 해주는 기능을 제공한다. 이 기능을 이용하면 공통적으로 적용되어야 할 파일들을 리비전 기능을 통해 쉽게 관리할 수 있다.

  • Configuration Channel 등록

    설정 파일들을 관리할 채널을 새로 생성하여 설정파일을 넣도록 한다.
    Name
    Default Configurations Channel
    Label
    default-configs-channel
    Description
    Default Configuration Channel
    다음은 채널을 등록한 화면이다.
  • Configuration File 추가

    Add Files 링크를 클릭하여 새로운 설정 파일을 등록한다. 이 설정 파일은 로그인 했을 때 보여줄 메시지를 담는 파일로 /etc/motd 라는 경로를 갖는다.
Need Package
서버에서 각 시스템(클라이언트)에게 등록된 Configuration Channel을 적용시키기 위해서는 클라이언트에 rhncfg-action 패키지가 설치되어있어야 함.

Software Channel Management


Adding Software Channel

CentOS 6 Base for i386

Name
CentOS 6 base i386
Label
centos6-base-i386
Parent Channel
None
Parent Channel Architecture
IA-32
Channel Summary
CentOS 6 Base for i386 architecture
Repository
centos6-base-i386
GPG Key URL
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
GPG Key ID
C105B9DE
GPG Key Fingerprint
C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

CentOS 6 Updates for i386

Name
CentOS 6 updates i386
Label
centos6-updates-i386
Parent Channel
centos6-base-i386
Parent Channel Architecture
IA-32
Channel Summary
CentOS 6 updates for i386 architecture
Repository
centos6-updates-i386
GPG Key URL
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
GPG Key ID
C105B9DE
GPG Key Fingerprint
C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

Extra Packages Enterprise Linux(EPEL) 6 for i386

Name
EPEL 6 i386
Label
epel6-i386
Parent Channel
centos6-base-i386
Parent Channel Architecture
IA-32
Channel Summary
Extra Packages Enterprise Linux(EPEL) 6 for i386 architecture
Repository
epel6-i386
GPG Key URL
https://fedoraproject.org/static/0608B895.txt
GPG Key ID
0608B895
GPG Key Fingerprint
8C3B E96A F230 9184 DA5C 0DAE 3B49 DF2A 0608 B895

PostgreSQL 9.1 for i386

Name
PostgreSQL 9.1 i386
Label
postgresql91-i386
Parent Channel
centos6-base-i386
Parent Channel Architecture
IA-32
Channel Summary
PostgreSQL 9.1 i386 Yum Repository
Repository
pgdg91-i386
GPG Key URL
GPG Key ID
442DF0F8
GPG Key Fingerprint
68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8

PostgreSQL 9.2 for i386

Name
PostgreSQL 9.2 i386
Label
postgresql92-i386
Parent Channel
centos6-base-i386
Parent Channel Architecture
IA-32
Channel Summary
PostgreSQL 9.2 i386 Yum Repository
Repository
pgdg92-i386
GPG Key URL
GPG Key ID
442DF0F8
GPG Key Fingerprint
68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8

Spacewalk 1.9 i386

Name
Spacewalk 1.9 i386
Label
spacewalk19-i386
Parent Channel
centos6-base-i386
Parent Channel Architecture
IA-32
Channel Summary
Spacewalk 1.9 i386
Repository
spacewalk19-el6-i386
GPG Key URL
http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
GPG Key ID
863A853D
GPG Key Fingerprint
8F85 8A91 03E3 3965 6BE9 64D0 0E64 6F68 863A 853D

CentOS 6 Base for x86_64

Name
CentOS 6 base x86_64
Label
centos6-base-x86_64
Parent Channel
None
Parent Channel Architecture
x86_64
Channel Summary
CentOS 6 Base for x86_64 architecture
Repository
centos6-base-x86_64
GPG Key URL
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
GPG Key ID
C105B9DE
GPG Key Fingerprint
C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

CentOS 6 Updates for x86_64

Name
CentOS 6 updates x86_64
Label
centos6-updates-x86_64
Parent Channel
centos6-base-x86_64
Parent Channel Architecture
x86_64
Channel Summary
CentOS 6 updates for x86_64 architecture
Repository
centos6-updates-x86_64
GPG Key URL
http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
GPG Key ID
C105B9DE
GPG Key Fingerprint
C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

Extra Packages Enterprise Linux(EPEL) 6 for x86_64

Name
EPEL 6 x86_64
Label
epel6-x86_64
Parent Channel
centos6-base-x86_64
Parent Channel Architecture
x86_64
Channel Summary
Extra Packages Enterprise Linux(EPEL) 6 for x86_64 architecture
Repository
epel6-x86_64
GPG Key URL
https://fedoraproject.org/static/0608B895.txt
GPG Key ID
0608B895
GPG Key Fingerprint
8C3B E96A F230 9184 DA5C 0DAE 3B49 DF2A 0608 B895

PostgreSQL 9.1 for x86_64

Name
PostgreSQL 9.1 x86_64
Label
postgresql91-x86_64
Parent Channel
centos6-base-x86_64
Parent Channel Architecture
x86_64
Channel Summary
PostgreSQL 9.1 x86_64 Yum Repository
Repository
pgdg91-x86_64
GPG Key URL
GPG Key ID
442DF0F8
GPG Key Fingerprint
68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8

PostgreSQL 9.2 for x86_64

Name
PostgreSQL 9.2 x86_64
Label
postgresql92-x86_64
Parent Channel
centos6-base-x86_64
Parent Channel Architecture
x86_64
Channel Summary
PostgreSQL 9.2 x86_64 Yum Repository
Repository
pgdg92-x86_64
GPG Key URL
GPG Key ID
442DF0F8
GPG Key Fingerprint
68C9 E2B9 1A37 D136 FE74 D176 1F16 D2E1 442D F0F8

Spacewalk 1.9 x86_64

Name
Spacewalk 1.9 x86_64
Label
spacewalk19-x86_64
Parent Channel
centos6-base-x86_64
Parent Channel Architecture
x86_64
Channel Summary
Spacewalk 1.9 x86_64
Repository
spacewalk19-el6-x86_64
GPG Key URL
http://yum.spacewalkproject.org/RPM-GPG-KEY-spacewalk-2012
GPG Key ID
863A853D
GPG Key Fingerprint
8F85 8A91 03E3 3965 6BE9 64D0 0E64 6F68 863A 853D

Sync scheduling

GUI


  • GUI는 동기화 진행사항을 확인 할 수 없음 단, /var/log/rhn/reposync/<Channel Label>-<시간>.log 로그 파일로 확인 가능함
  • RPM 저장소 위치는 다음 위치에서 설정가능

  • 특정 채널의 특정 패키지만을 동기화 할 수 없으므로 전체 동기화에 따른 디스크 용량을 반드시 고려해야함

Command

    1. Installing YUM utilities
      yum install yum-utils createrepo -y
    2. Create Local Repositories
      mkdir -p /var/www/html/pub/CentOS6/{i386,x86_64}
    3. Creating cron task
      /etc/cron.daily/spacewalk-repo-sync
      #!/bin/sh
      # try to create the lock and check the outcome
      LOCKFILE=/var/run/spacewalk_sync.lock
      lockfile -r 0 ${LOCKFILE} 1>/dev/null 2>&1
      status=$?
      if [ ${status} -ne 0 ] ;then
              echo "Another instance already running. Aborting."
              exit 1
      fi
      trap "rm ${LOCKFILE}" EXIT
      /usr/bin/spacewalk-repo-sync --channel centos6-base-i386 \
                                   --url http://centos.mirror.cdnetworks.com/6/os/i386/ \
                                   --type yum > /dev/null
      
      /usr/bin/spacewalk-repo-sync --channel centos6-updates-i386 \
                                   --url http://centos.mirror.cdnetworks.com/6/updates/i386/ \
                                   --type yum > /dev/null
      
      /usr/bin/spacewalk-repo-sync --channel centos6-base-x86_64 \
                                   --url http://centos.mirror.cdnetworks.com/6/os/x86_64/ \
                                   --type yum > /dev/null
      
      /usr/bin/spacewalk-repo-sync --channel centos6-updates-x86_64 \
                                   --url http://centos.mirror.cdnetworks.com/6/updates/x86_64/ \
                                   --type yum > /dev/null
      
      reposync --repoid=epel6-i386 -c /etc/reposync.conf -p /var/www/html/pub/CentOS6/i386 -d -l -g -n -q > /dev/null
      cd /var/www/html/pub/CentOS6/i386/epel6-i386
      createrepo /var/www/html/pub/CentOS6/i386/epel6-i386 > /dev/null
      /usr/bin/spacewalk-repo-sync --channel epel6-i386 \
                                   --url file:///var/www/html/pub/CentOS6/i386/epel6-i386/ \
                                   --type yum > /dev/null
      
      reposync --repoid=epel6-x86_64 -c /etc/reposync.conf -p /var/www/html/pub/CentOS6/x86_64 -d -l -g -n -q > /dev/null
      cd /var/www/html/pub/CentOS6/x86_64/epel6-x86_64
      createrepo /var/www/html/pub/CentOS6/x86_64/epel6-x86_64 > /dev/null
      /usr/bin/spacewalk-repo-sync --channel epel6-i386 \
                                   --url file:///var/www/html/pub/CentOS6/x86_64/epel6-x86_64/ \
                                   --type yum > /dev/null
      # chmod 700 /etc/cron.daily/spacewalk_sync.cron
      # chown root:root /etc/cron.daily/spacewalk_sync.cron