Do it Now !  
Front Page
Notice | Keyword | Tag | Location | Guestbook | Admin | Write Article   
 
Linux에 해당하는 글 108건
2010/02/04   H8DMU+ 보드에 RHEL5 설치시 문제
2010/01/26   csh 에서 'word too long' 메세지가 뜨는 경우
2010/01/26   oracle 9i 다운로드
2010/01/25   RHEL5 에서 변경된 sort 옵션
2009/12/16   OS 자동화 설치 관련 정리
2009/12/14   리눅스에서 SSD 최적화 설정
2009/12/09   pdsh 설치 및 사용법
2009/11/28   ubuntu 9.10 에서 부팅시 커널 옵션 추가
2009/11/23   RHEL 3.5 버전용 LSI SAS1068 드라이버 만들기
2009/11/18   clusterssh 설치
2009/11/17   ganglia 설치
2009/11/17   repair모드에서 /etc/fstab 파일 수정하기
2009/11/17   RHEL5에 nginx, php5, mysql 설치
2009/08/22   리눅스 메모리, swapping 관련
2009/08/15   RHEL5.3 에 sun jdk 1.6 버전 설치
2009/08/09   DVD 이미지로 yum 레포지토리 만들어 사용하기
2009/08/09   piranha 를 이용한 fail over 구성
2009/08/08   패스워드 입력없이 ssh 로그인 하기
2009/08/07   IP Bonding 설정
2009/08/07   간단한 heartbeat 사용 방법


2010/02/04 08:20 2010/02/04 08:20
H8DMU+ 보드에 RHEL5 설치시 문제
슈퍼마이크로 H8DMU+ 메인보드에 RHEL5 설치를 진행하면 초반에 커널 패닉이 발생한다.

BIOS 버전이 낮아서 그런지는 테스트 해보진 못했지만 우선은 리눅스 설치 CD로

부팅시 'numa=off' 옵션을 주면 정상적으로 설치가 된다.

설치후에도 시스템이 정상 부팅하려면 해당 옵션을 적용해야 한다.
Tag : , ,


2010/01/26 14:50 2010/01/26 14:50
csh 에서 'word too long' 메세지가 뜨는 경우
csh 에서는 변수에 저장할 수 있는 최대 문자가 10240으로 제한되어 있어 이를 초과시에 'word too long' 이라는 메세지가 뜬다.

bash 에서는 잘됨....
Tag : ,


2010/01/26 01:40 2010/01/26 01:40
oracle 9i 다운로드
oracle 홈페이지에 보니 예전 버전인 9i 를 다운로드 받을 수 있는 항목이 없어서 당황했었는데 찾아보니 아래의 사이트를 통해 다운 받을 수 있다.

Tag : , ,


2010/01/25 17:31 2010/01/25 17:31
RHEL5 에서 변경된 sort 옵션
RHEL 4까지는 sort +1  과 같은 옵션이 사용 가능했으나 RHEL 5에서는 posix 를 따르다 보니 해당 옵션을 더이상 사용할 수 없도록 되었다.

그러므로 이를 대신하기 위해서는 -k 옵션을 사용해야 한다.

두 번째 필드를 기준으로 정렬하려면 -k2 옵션을 주면 된다.

(이전의 +1 옵션은 필드값이 0부터 시작하지만 -k 옵션은 필드값이 1부터 시작되므로 사용시 주의해야 한다.

Tag : , ,


2009/12/16 13:12 2009/12/16 13:12
OS 자동화 설치 관련 정리
Master 서버에 필요한 것..

- OS: CentOS 5.3
- DHCP 서버 구성
- tftp 서비스 활성화
- 설치할 OS 파일

1. nfs server 구성

# cat /etc/exports

/os *(ro,sync)
/mnt *(ro,sync)

/os : kickstart 설정 파일이 있음
/mnt : OS 이미지 파일이 마운트 되어 있음

# chkconfig --list nfs
nfs             0:off   1:off   2:on    3:on    4:on    5:on    6:off

2. tftp 구성

# rpm -q tftp-server-0.49-2.el5.centos
tftp-server-0.49-2.el5.centos

# chkconfig --list tftp
tftp            on

# mkdir /tftpboot/boot
# mkdir /tftpboot/pxelinux.cfg

OS 시디안에 있는 initrd.img, vmlinux 파일을 /tftpboot/boot 로 복사.

/tftpboot/pxelinux.cfg/default 파일 작성

# cat default
default install
prompt 0
label install
        kernel boot/vmlinuz
        append initrd=boot/initrd.img ramdisk_size=7000 ks=nfs:<nfs server ip>:/os/ks.cfg


http://www.kernel.org/pub/linux/utils/boot/syslinux/ 에서 파일을 다운받아 압축을 풀어보면
pxelinux.0 파일이 있는 이 파일을 /tftpboot 아래로 복사한다.


3. DHCP 서버 구성

# cat /etc/dhcpd.conf
ddns-update-style interim;

allow booting;
allow bootp;

subnet 192.168.114.0 netmask 255.255.255.0 {

        option routers                  192.168.114.2;
        option subnet-mask              255.255.255.0;
        option domain-name              "domain.org";
        option domain-name-servers      192.168.114.132;


        # we want the nameserver to appear at a fixed address
        group {
                filename "pxelinux.0";
                next-server 192.168.114.132;
                host node01 {
                        option host-name        "node01";
                        hardware ethernet 00:0C:29:5D:2B:50;
                        fixed-address 192.168.114.200;
                }
        }
}

특정 MAC 을 지정하여 IP 주소를 할당하도록 구성 되어 있음.
 
4. 기타

- 시스템을 켜면 자동으로 OS 설치가 시작되는데 이미 OS 가 설치된 시스템들은 로컬 디스크로 부팅하게끔 하려면 아래와 같은 설정을 추가한다.

/tftpboot/pxelinux.cfg 아래에 IP주소를 16진수로 변환한 값을 이름으로 가지는 파일 작성

# cat C0A872C8
default local
prompt 0
label local
        localboot 0


- kickstart 설정 파일은 system-config-kickstart 를 실행하여 쉽게 작성할 수 있음.

- 엑셀에서 10진수를 16진수로 변환방법 : =DEC2HEX(십진수)
Tag : , ,


2009/12/14 09:38 2009/12/14 09:38
리눅스에서 SSD 최적화 설정
1. noatime 옵션 적용

파일 시스템에서 inode 접근 시간을 업데이트 하지 않음

/etc/fstab 팡리 에 옵션 추가

추가로 적용 가능한 옵션 : nodiratime,nobh,data=writeback

2. noop scheduler 사용

최소한의 CPU 인스트럭션을 사용하는 심플한 FIFO 큐이며 메모리 디스크에 최적화 되어 있음.

grub 설정 파일에 'elevator=noop' 커널 부트 옵션 추가

3. 스케줄러 변경 및 확인

ex)

# cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]

# echo noop > /sys/block/sda/queue/scheduler


참고)


Tag : , ,


2009/12/09 10:52 2009/12/09 10:52
pdsh 설치 및 사용법
1. 다운로드


2. 패키지 생성

rpmbuild -ta pdsh-2.18.tar.bz2

rsh 를 사용하기 위한 패키지 생성은

rpmbuild -ta --with rsh pdsh-2.18.tar.bz2

생성되는 패키지

pdsh-2.18-1.src.rpm
pdsh-2.18-1.x86_64.rpm
pdsh-rcmd-rsh-2.18-1.x86_64.rpm
pdsh-rcmd-ssh-2.18-1.x86_64.rpm
pdsh-rcmd-exec-2.18-1.x86_64.rpm
pdsh-mod-machines-2.18-1.x86_64.rpm
pdsh-mod-dshgroup-2.18-1.x86_64.rpm
pdsh-mod-netgroup-2.18-1.x86_64.rpm

3. 사용예

pdsh -w node[01-02] hostname

Tag :


2009/11/28 12:13 2009/11/28 12:13
ubuntu 9.10 에서 부팅시 커널 옵션 추가
ubuntu 9.10 에서는 grub2 가 적용되면서 이전에 사용하던 /boot/grub/menu.lst 파일 편집을 통한 옵션추가 방법은 사용할 수 없으며 아래와 같은 순서로 해야 한다.

 
1. 아래의 명령으로 /etc/default/grub 파일을 엽니다.
sudo vi /etc/default/grub
 
2. GRUB_CMDLINE_LINUX= " " 항목에 아래와 같이 내용을 추가한 후에 저장합니다.

GRUB_CMDLINE_LINUX= "acpi=off"
 
3. 다음 명령을 실행한 후에 시스템을 재부팅합니다.
 
sudo update-grub
 
4. 재부팅 후 다음의 명령으로 위의 설정이 제대로 적용되었는지 확인합니다.
 
cat /proc/cmdline
 



Tag : ,


2009/11/23 23:41 2009/11/23 23:41
RHEL 3.5 버전용 LSI SAS1068 드라이버 만들기
아직도 오래된 버전의 OS를 사용하는 곳이 있어서 작업했던 내용을 정리해 본다.

1. SAS 드라이버 다운로드

사용자 삽입 이미지

위 화면은 LSI 홈페이지에서 SAS1068로 검색 후 드라이버 다운로드 항목에 보이는 내용이다. 잘보면 알겠지만 현재는 RHEL4, 5 버전용 드라이버만 지원하고 있다.

이 때는 위의 'Archived' 항목을 체크하면 아래와 같이 RHEL3 버전용 드라이버가 보일 것이다. 이것을 다운받으면 된다.

사용자 삽입 이미지



2. OS 설치 시 사용할 SAS 드라이버  만들기

다운로드한 드라이버의 압축을 풀면 아래와 같은 여러 파일이 보인다.
여기서 사용할 것은 mptlinux-2.06.77.00-1.rhel3.i686.thumb.gz 이다.

# unzip MPTLINUX_RHEL3_SLES8_PROJ-2.06.77.00.zip
# cd mptlinux; tar xvzf mptlinux_2.06.77.00-1_release.tar.gz
# cd pkg-1/thumb/
# ls
mptlinux-2.06.77.00-1.rhel3.amd32.thumb.gz
mptlinux-2.06.77.00-1.rhel3.amd64.thumb.gz
mptlinux-2.06.77.00-1.rhel3.athlon.thumb.gz
mptlinux-2.06.77.00-1.rhel3.em64t.thumb.gz
mptlinux-2.06.77.00-1.rhel3.i686.thumb.gz
mptlinux-2.06.77.00-1.rhel3.ia64.thumb.gz

# gzip -d mptlinux-2.06.77.00-1.rhel3.i686.thumb.gz
# file mptlinux-2.06.77.00-1.rhel3.i686.thumb
mptlinux-2.06.77.00-1.rhel3.i686.thumb: Linux rev 1.0 ext2 filesystem data

ext2 파일시스템 데이터이므로 아래와 같이 마운트 해서 사용해야 한다.

# mount -o loop  mptlinux-2.06.77.00-1.rhel3.i686.thumb /tmp/mptlinux
# cd /tmp/mptlinux; ls
lost+found  modinfo  modules.cgz  modules.dep  packages.py  pcitable  rhdd-6.1
# du -sh modules.cgz
3.3M    modules.cgz

위에서 보이는 것과 같이 플로피 디스켓에 써넣기에는 용량이 너무 크기 때문에 용량을 줄여줘야 한다.

# gzip -dc modules.cgz | cpio -idumv
# ls
2.4.21-15.EL         2.4.21-32.ELBOOT     2.4.21-47.ELhugemem
2.4.21-15.ELBOOT     2.4.21-32.ELhugemem  2.4.21-47.ELsmp
2.4.21-15.ELhugemem  2.4.21-32.ELsmp      2.4.21-4.EL
2.4.21-15.ELsmp      2.4.21-37.EL         2.4.21-4.ELBOOT
2.4.21-20.EL         2.4.21-37.ELBOOT     2.4.21-4.ELhugemem
2.4.21-20.ELBOOT     2.4.21-37.ELhugemem  2.4.21-4.ELsmp
2.4.21-20.ELhugemem  2.4.21-37.ELsmp      2.4.21-50.EL
2.4.21-20.ELsmp      2.4.21-40.EL         2.4.21-50.ELBOOT
2.4.21-27.EL         2.4.21-40.ELBOOT     2.4.21-50.ELhugemem
2.4.21-27.ELBOOT     2.4.21-40.ELhugemem  2.4.21-50.ELsmp
2.4.21-27.ELhugemem  2.4.21-40.ELsmp      fusion.mptctl_2.4
2.4.21-27.ELsmp      2.4.21-47.EL         modules.cgz
2.4.21-32.EL         2.4.21-47.ELBOOT

RHEL 3.5 에 사용할 드라이버만 빼고 나머지는 모두 삭제한 다음 modules.cgz 파일을 다시 만든다.

# ls
2.4.21-32.EL  2.4.21-32.ELBOOT  2.4.21-32.ELhugemem  2.4.21-32.ELsmp
# find . | cpio -ov | gzip -c > modules.cgz
.
./2.4.21-32.ELsmp
./2.4.21-32.ELsmp/mptlan.o
./2.4.21-32.ELsmp/mptctl.o
./2.4.21-32.ELsmp/mptscsih.o
./2.4.21-32.ELsmp/mptbase.o
./2.4.21-32.ELBOOT
./2.4.21-32.ELBOOT/mptlan.o
./2.4.21-32.ELBOOT/mptctl.o
./2.4.21-32.ELBOOT/mptscsih.o
./2.4.21-32.ELBOOT/mptbase.o
./2.4.21-32.ELhugemem
./2.4.21-32.ELhugemem/mptlan.o
./2.4.21-32.ELhugemem/mptctl.o
./2.4.21-32.ELhugemem/mptscsih.o
./2.4.21-32.ELhugemem/mptbase.o
./2.4.21-32.EL
./2.4.21-32.EL/mptlan.o
./2.4.21-32.EL/mptctl.o
./2.4.21-32.EL/mptscsih.o
./2.4.21-32.EL/mptbase.o
1678 blocks

만들어진 파일을 modules.cgz 파일을 /tmp/mptlinux 에 있는 파일에 덮어쓰기 한다.

# cp modules.cgz /tmp/mptlinux/
cp: overwrite `/tmp/mptlinux/modules.cgz'? y
# cd /tmp/mptlinux/
# ls
lost+found  modinfo  modules.cgz  modules.dep  packages.py  pcitable  rhdd-6.1
# du -sh modules.cgz
376K    modules.cgz

마지막으로 ext2 (or fat) 로 포맷된 플로피에 해당 파일을 복사해서 리눅스 설치시 사용하면
된다.

참고)
LinuxMPT_Rel_Notes_2.06.77.00-1.txt 파일에 보면 OS 버전별 내용이 나오는데 DUD를 지원하는 버전의 경우에는 위와 같은 별도의 작업이 필요치 않으며 DUSs 디렉토리에 있는 파일을 직접 플로피로 만들어 사용하면 된다.
Tag : ,


2009/11/18 15:29 2009/11/18 15:29
clusterssh 설치
OS 환경 : RHEL 5.3, CentOS 5.3 (x86_64)

다운로드



설치

# rpmbuild -ta --target x86_64 clusterssh-3.27.tar.gz
# rpm -Uvh /usr/src/redhat/RPMS.noarch/clusterssh-3.27-1.noarch.rpm

error: Failed dependencies:
        perl(Tk) >= 800.022 is needed by clusterssh-3.27-1.noarch
        perl(Tk::Dialog) is needed by clusterssh-3.27-1.noarch
        perl(Tk::LabEntry) is needed by clusterssh-3.27-1.noarch
        perl(Tk::ROText) is needed by clusterssh-3.27-1.noarch
        perl(Tk::Xlib) is needed by clusterssh-3.27-1.noarch
        perl(X11::Keysyms) is needed by clusterssh-3.27-1.noarch
        perl(X11::Protocol) is needed by clusterssh-3.27-1.noarch
        perl(X11::Protocol::Constants) is needed by clusterssh-3.27-1.noarch

의존성 에러 해결 : 아래의 두 패키지를 다운받아 설치한다.



참고글



Tag : , ,


2009/11/17 16:37 2009/11/17 16:37
ganglia 설치
ganglia 는 클러스터와 그리드 시스템의 상태를 모니터링 하는 프로그램이다.

설치에 대한 내용은 아래의 페이지에 기술되어 있으나 2002년에 작성된 것으로서 소스 파일을 컴파일하여 설치하는 방법이다. 이를 참고하여 최신 버전을 RPM 으로 설치하는 방법에 대해 정리해 본다.



OS 버전 : CentOS 5.3 (x86_64)


다운로드


ganglia monitor core 소스 파일을 받는다. (현재 버전은 3.1.2) 이 파일을 가지고 RPM 파일로 만들기 위해서는 아래와 같은 명령을 실행한다.

# rpmbuild -ta --target x86_64 ganglia-3.1.2.tar.gz

이 때 아래와 같은 에러가 발생한다.

에러메세지 : /usr/lib/libexpat.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

이를 해결하기 위한 방법은 두 가지가 있는데  expat-devel, apr-devel i386 패키지를 삭제하거나 autoreconf 를 실행해줘야 한다. autoreconf 명령은 해당 소스 파일의 압축을 푼 후에 실행해야 한다.

자세한 내용은 여기 참조...

libconfuse 패키지 설치가 필요하면 여기서 다운 받아 설치한다.

컴파일이 끝난후 만들어진 패키지는 아래와 같다.

ganglia-devel-3.1.2-1.x86_64.rpm
ganglia-gmetad-3.1.2-1.x86_64.rpm
ganglia-gmond-3.1.2-1.x86_64.rpm
ganglia-gmond-modules-python-3.1.2-1.x86_64.rpm
libganglia-3_1_0-3.1.2-1.x86_64.rpm
ganglia-web-3.1.2-1.noarch.rpm

모니터링 서버쪽에는 libganglia-3_1_0-3.1.2-1.x86_64.rpm, ganglia-gmetad-3.1.2-1.x86_64.rpm, ganglia-web-3.1.2-1.noarch.rpm 패키지를 모니터링을 할 node 에는 libganglia-3_1_0-3.1.2-1.x86_64.rpm, ganglia-gmond-3.1.2-1.x86_64.rpm 패키지를 설치해 주면된다.

웹으로 확인은 http://localhost/ganglia 로 접속해 보면 된다.

cluster name 설정 /etc/ganglia/gmetad.conf 에서 아래 부분에 지정해 주고

data_source "my cluster" localhost

/etc/ganglia/gmond.conf 에서는 아래와 같이 지정해 주면 된다.

cluster {
  name = "my cluster"
  owner = "unspecified"
  latlong = "unspecified"
  url = "unspecified"
}





Tag : ,


2009/11/17 15:57 2009/11/17 15:57
repair모드에서 /etc/fstab 파일 수정하기
/etc/fstab 파일에 설정이 잘못 되어 있으면 부팅시 repair 모드로 빠지게 되는데 이때는  /  파일 시스템이 읽기 전용으로 마운트 되어 있어 fstab 파일을 바로 수정할 수는 없다.

이때는 아래의 명령으로 / 파일 시스템을 읽고 쓸 수 있도록 재마운트 해주면 된다.

# mount -o remount /
Tag : , ,


2009/11/17 15:45 2009/11/17 15:45
RHEL5에 nginx, php5, mysql 설치

패키지 설치

php5, mysql 은 OS 시디에 포함된 패키지를 그대로 사용하면 되고 nginx 와 php 연동에 필요한 fastcgi 관련 패키지들은 아래의 사이트에서 별도로 다운받는다.

lighttpd-1.4.18-1.el5.rf.x86_64.rpm
lighttpd-fastcgi-1.4.18-1.el5.rf.x86_64.rpm

http://dag.wieers.com/rpm/packages/lighttpd/

nginx-0.6.39-1.el5.x86_64.rpm

http://rpm.pbone.net/index.php3/stat/4/ ··· rpm.html


패키지 설치 후의 설정

/etc/php.ini 에 'cgi.fix_pathinfo = 1' 추가

/etc/rc.local 에 '/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u nginx -g nginx -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid' 추가

/etc/nginx/nginx.conf 내용 수정

# index.php 추가
 location / {
            root   /usr/share/nginx/html;
            index  index.php index.html index.htm;
        }

# 아래 부분은 주석 처리 제거하고 수정
      location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }


서비스 시작 및 테스트

# service nginix start

# cat /usr/share/nginx/html/index.php
<? phpinfo() ?>

# 웹브라우저로 접속 확인

Tag :


2009/08/15 09:35 2009/08/15 09:35
RHEL5.3 에 sun jdk 1.6 버전 설치
RHEL Supplementary 에서 다음의 패키지를 다운로드 후 설치하면 된다.

java-1.6.0-sun-1.6.0.11-1jpp.1.el5.x86_64.rpm
java-1.6.0-sun-demo-1.6.0.11-1jpp.1.el5.x86_64.rpm
java-1.6.0-sun-devel-1.6.0.11-1jpp.1.el5.x86_64.rpm
java-1.6.0-sun-jdbc-1.6.0.11-1jpp.1.el5.x86_64.rpm
java-1.6.0-sun-plugin-1.6.0.11-1jpp.1.el5.i586.rpm
java-1.6.0-sun-src-1.6.0.11-1jpp.1.el5.x86_64.rpm

혹시 설치 중 의존성 에러가 난다면 아래 패키지도 깔아야함.

unixODBC-devel-2.2.11-7.1.i386.rpm
unixODBC-devel-2.2.11-7.1.x86_64.rpm

sun jdk 1.6 설치 전

[root@rhel5b ~]# java -version
java version "1.6.0"
OpenJDK  Runtime Environment (build 1.6.0-b09)
OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)

sun jdk 1.6 설치 후

[root@rhel5b ~]# java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b16, mixed mode)
Tag : , ,


2009/08/09 20:33 2009/08/09 20:33
DVD 이미지로 yum 레포지토리 만들어 사용하기
RHN에서 DVD 이미지 다운로드 (rhel-server-5.3-x86_64-dvd.iso)
# mkdir /repo
# mount -o loop rhel-server-5.3-x86_64-dvd.iso /mnt
# cd /mnt; cp -a * /repo
# cd /repo; createrepo .
/etc/yum.repos.d 디렉토리 아래에 dvd.repo 파일 작성
[dvd]
mediaid=1231287803.932941
name=DVD for RHEL5
baseurl=file:///mnt/iso/Server
enabled=1
gpgcheck=0

[dvd-cluster]
mediaid=1231287803.932941
name=DVD for RHEL5 - Cluster
baseurl=file:///mnt/iso/Cluster
enabled=1
gpgcheck=0

[dvd-cluster-storage]
mediaid=1231287803.932941
name=DVD for RHEL5 - ClusterStorage
baseurl=file:///mnt/iso/ClusterStorage
enabled=1
gpgcheck=0

[dvd-vt]
mediaid=1231287803.932941
name=DVD for RHEL5 - VT
baseurl=file:///mnt/iso/VT
enabled=1
gpgcheck=0 
다른 클라이언트 시스템에서 웹으로 사용할 수 있도록 하기 위해서는
# cd /var/www/html
# ln -s /repo
# service httpd start

클라이언트 설정은 /etc/yum.repos.d 디렉토리 아래에 repo 파일을 만듬
[RH53-Server]
name= RHEL 5.3 Server Repository
baseurl=http://192.168.123.133/repo/Server
enabled=1
gpgcheck=0

[RH53-Cluster]
name= RHEL 5.3 Cluster Repository
baseurl=http://192.168.123.133/repo/Cluster
enabled=1
gpgcheck=0

[RH53-ClusterStorage]
name= RHEL 5.3 ClusterStorage Repository
baseurl=http://192.168.123.133/repo/ClusterStorage
enabled=1
gpgcheck=0

[RH53-vt]
name= RHEL 5.3 VT Repository
baseurl=http://192.168.123.133/repo/VT
enabled=1
gpgcheck=0
Tag : , ,


2009/08/09 20:15 2009/08/09 20:15
piranha 를 이용한 fail over 구성
hearbeat 을 이용한 것과 동일하게 Fail Over를 구성하는데 RHEL 5.3 Cluster Suite  에 포함되어 있는 piranha 패키지를 사용하는 방법을 간단히 정리해 보면...

1. RHEL 5.3 DVD 안에 Cluster 디렉토리에 들어있는 piranha 패키지 설치

(의존성이 어떻게 걸려있을지 몰라 DVD 이미지를 사용하여 yum repository 로 구성하여 yum gruopinstall Clustering 명령으로 Cluster 관련 패키지 전체를 설치함)

2. piranha 설정

웹접속

- piranha-passwd  명령으로 패스워드 설정
- service piranha_gui start 실행
- http://localhost:3636 으로 접속 (ID: piranha, Password 입력)

직접수정

/usr/share/doc/piranha-0.8.4/sampl.cf 파일을 복사 후 수정하여 /etc/sysconfig/ha/lvs.cf
로 저장

service = fos
primary = 192.168.123.122
backup = 192.168.123.121
backup_active = 1
heartbeat = 1
heartbeat_port = 539
keepalive = 6
deadtime = 18
network = direct
debug_level = NONE

failover web {
     active = 1
     address = 192.168.123.150 eth0:1
     vip_nmask = 255.255.255.255
     port = 80
     send = "GET / HTTP/1.0\r\n\r\n"
     expect = "HTTP"
     timeout = 10
     start_cmd = "/etc/rc.d/init.d/httpd start"
     stop_cmd = "/etc/rc.d/init.d/httpd stop"
}


failover ftp {
     active = 1
     address = 192.168.123.150 eth0:1
     vip_nmask = 255.255.255.255
     port = 21
     send = "\n"
     timeout = 10
     start_cmd = "/etc/rc.d/init.d/vsftpd start"
     stop_cmd = "/etc/rc.d/init.d/vsftpd stop"
}


3. lvs.cf 는 양쪽 시스템 모두 동일해야 하고 마지막으로 'service pulse start' 실행

(이 때 에러가 발생한다면 대부분 lvs.cf 설정 파일의 문제임...)

길게 테스트 해보지는 못했지만 primary 서버의 네트워크 접속이 끊기면 backup 서버로 자동 연결되었다가 primary 네트워크가 살아나도 서비스는 옮겨오지 않는다. backup 서버에 문제가 생길 경우 ip와 서비스가 primary 로 넘어옴. (뭔가 구성이 잘못된 건지 원래 그런건지...??)


개인적으로는 이런 단순한 Fail Over 구성시에는 heartbeat 이 훨씬 사용하기 쉽고 잘 작동하는 듯하다.


Tag : , ,


2009/08/08 08:28 2009/08/08 08:28
패스워드 입력없이 ssh 로그인 하기
rhel5a 시스템의 testuser 계정으로 rhel5b 시스템의 testuser1 계정으로 ssh 로 로그인 하는데 패스워드 입력없이 로그인 하는 방법.

1. rhel5a 에서  키생성 (그냥 엔터키만 누르고 진행)

[testuser@rhel5a ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/testuser/.ssh/id_dsa):
Created directory '/home/testuser/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/testuser/.ssh/id_dsa.
Your public key has been saved in /home/testuser/.ssh/id_dsa.pub.
The key fingerprint is:
4d:bd:bc:b9:92:bf:eb:22:a8:5a:af:14:de:41:ad:a2 testuser@rhel5a

2. rhel5b의 testuser1 계정으로 키 복사

[testuser@rhel5a ~]$ ssh-copy-id -i .ssh/id_dsa.pub testuser1@rhel5b
15
The authenticity of host 'rhel5b (192.168.123.121)' can't be established.
RSA key fingerprint is 02:c1:b0:19:9e:10:0f:00:f9:a2:95:9e:3b:60:3e:d4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rhel5b,192.168.123.121' (RSA) to the list of known hosts.
testuser1@rhel5b's password:
Now try logging into the machine, with "ssh 'testuser1@rhel5b'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

3. 원격 접속 확인 

[testuser@rhel5a ~]$ ssh testuser1@rhel5b
Last login: Sat Aug  8 08:19:14 2009 from rhel5a
Tag : ,


2009/08/07 21:45 2009/08/07 21:45
IP Bonding 설정
RHEL 5.3 에서 IP Bonding 설정

1. /etc/modprobe.conf

  alias bond0 bonding
 
2. /etc/sysconfig/network-scripts/ifcfg-bond0

  DEVICE=bond0
  IPADDR=192.168.50.111
  NETMASK=255.255.255.0
  USERCTL=no
  BOOTPROTO=none
  ONBOOT=yes
  BONDING_OPTS="mode=0 miimon=100"

mode 0 : round robin
mode 1 : active / backup

(mode 1로 구성시 primary=eth0 옵션 추가 가능 : primary 인터페이스가 정상으로 돌아오면 그 인터페이스를 자동으로 사용하게 된다 )

사용 가능한 모드에 대한 설명

3. /etc/sysconfig/network-scripts/ifcfg-ethX

  DEVICE=ethX
  USERCTL=no
  ONBOOT=yes
  MASTER=bond0
  SLAVE=yes
  BOOTPROTO=none

4. 재부팅

* bonding 상태 확인 : /proc/net/bonding/bond0
 
Tag :


2009/08/07 20:20 2009/08/07 20:20
간단한 heartbeat 사용 방법
갑자기 작업할 건이 생겨서...제 대로 된 HA 구성은 아니지만 간단하게 정리해 본다.

테스트 조건 및 환경

- L2 스위치 아래 리눅스 서버 두 대가 있는데 Active/Standby 형태로 구성하여 한 대의 서버에 문제가 생겼을 경우에도 서비스를 지속적으로 할 수 있어야 한다.
- 구성 서비스 : 어떤 서비스를 할 것 인지 모른다. 그래서 IP 주소를 넘겨주는 것만 테스트함
- 공유 데이터 없음.
- 리눅스 서버는 각가 NIC 2개를 bonding으로.. 서비스 NIC와 heartbeat 용 NIC를 같이 사용함


 VIP : 192.168.123.150
 rhel5a : 192.168.123.120
 rhel5b : 192.168.123.121

OS버전 : RHEL 5.3

이렇게 구성하면 외부에서는 192.168.123.150 로 접속하면 rhel5a 서버로 연결이 되고 rhel5a 서버가 다운되었을 경우에는 rhel5b 서버로 연결된다.

1. hearbeat 설치

설치할 프로그램

heartbeat-2.1.4-4.1.x86_64.rpm
heartbeat-pils-2.1.4-4.1.x86_64.rpm
heartbeat-stonith-2.1.4-4.1.x86_64.rpm


설치

# rpm -ivh heartbeat-2.1.4-4.1.x86_64.rpm heartbeat-pils-2.1.4-4.1.x86_64.rpm heartbeat-stonith-
2.1.4-4.1.x86_64.rpm

2. hearbeat 설정

환경설정 파일 복사

# cp /usr/share/doc/packages/heartbeat/ha.cf /etc/ha.d
# cp /usr/share/doc/packages/heartbeat/authkeys /etc/ha.d
# cp /usr/share/doc/packages/heartbeat/haresources /etc/ha.d

[root@rhel5a ha.d]# grep -v '^#' ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
udpport 694
bcast  bond0 # Linux
auto_failback on
node rhel5a
node rhel5b

[root@rhel5a ha.d]# grep -v '^#' haresources
rhel5a 192.168.123.150

[root@rhel5a ha.d]# grep -v '^#' authkeys
auth 1
1 md5 Hello!

- authkeys 파일 퍼미션은 600으로 설정
- rhel5b 에도 동일하게 설정

추후에 공유할 서비스는 /etc/ha.d/haresources 디렉토리 아래에 두면 된다.

서비스 등록 : chkconfig --add heartbeat

참고문서



Tag : , , ,


BLOG main image
IT 관심 분야 및 개인적인 취미 활동 에 대한 History 저장소
 Notice
My Profile
 Category
전체 (238)
Linux (108)
Certification (13)
Laptop (12)
Book (78)
Useful Tips (20)
osx (7)
 Calendar
«   2010/03   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
 Recent Entries
H8DMU+ 보드에 RHEL5 설치...
csh 에서 'word too long'...
oracle 9i 다운로드
RHEL5 에서 변경된 sort 옵션
100명에게 아이폰을 쏜다!
 Recent Comments
300mb 이하의 파일만 접근...
rfid 관리사 공부하고 있...
공부열심히 하셔서 합격하...
공유해주셔서 감사합니다....
일일이 테스트 해보지는...
 Recent Trackbacks
flogsta의 생각
flogsta's me2DAY
VMware 보안 취약점
뎅꽁이의 보안창고
 Archive
2010/02
2010/01
2009/12
2009/11
2009/09
 Visitor Statistics
Total : 97390
Today : 5
Yesterday : 99
rss