iSCSI 설정과 사용하기 – ubuntu linux에서

Ubuntu Linux 에서 iSCSI 설정과 사용하기.

작업환경

OS: Ubuntu 12.04.4 LTS(32Bit version)
Box1: 192.168.0.51
Box2: 192.168.0.52

1. iSCSI Target 설정 (iSCSI 볼륨 만들 서버)
Box1 에 iSCSI volume을 만들기위해, 관련 패키지를 설치한다.

# apt-get install iscsitarget scsitarget-source iscsitarget-dkms

주의) 위의 패치지를 설치할때 dkms 부분에서 아래 처럼 make 오류가 발생한다. 버그없는 패키지를 받아서 수동으로 설치했다.

make KERNELRELEASE=3.11.0-15-generic -C /lib/modules/3.11.0-15-generic/build M=/var/lib/dkms/iscsitarget/1.4.20.2/build.....(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.11.0-15-generic (i686)
# wget http://ftp.ubuntu.com/ubuntu/pool/universe/i/iscsitarget/iscsitarget_1.4.20.3+svn499-0ubuntu3_i386.deb
# wget http://ftp.ubuntu.com/ubuntu/pool/universe/i/iscsitarget/iscsitarget-dkms_1.4.20.3+svn499-0ubuntu3_all.deb
# dpkg -i iscsitarget_1.4.20.3+svn499-0ubuntu3_i386.deb
# dpkg -i iscsitarget-dkms_1.4.20.3+svn499-0ubuntu3_all.deb

아래화일에서 false로 되어 있는 부분을 true로 바꾼다.

# vi /etc/default/iscsitarget
ISCSITARGET_ENABLE=true

iSCSI 가 이용할 디스크(2GB)를 만든다. 여기서는 물리 디스크가 없으므로, image 화일을 하나 만들어서 가상의 하드디스크로 사용한다.(물리적인 하드디스크가 있으면 그것을 사용해도 무방하다).

# mkdir /iscsi
# dd if=/dev/zero of=/iscsi/d1.img bs=1024k count=2000
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 13.1235 s, 160 MB/s

만든 화일을 가상의 디스크로 등록한다.

# losetup /dev/loop0 /iscsi/d1.img

아래 화일에 아래와 같은 내용을 추가한다.(사용자id는 fox ,비밀번호는 fox123)

# vi /etc/iet/ietd.conf
Target iqn.2014-06.com.fox:storage.lun1
IncomingUser fox fox123
OutgoingUser
Lun 0 Path=/dev/loop0,Type=fileio
Alias LUN1

target 은 유일한 이름을 가져야하며, iSCSI 표준으로 iqn(iSCSI Qulified Name)형식이 있다. iqn의 형식은 아래와 같다.
iqn.yyyy-mm.[:identifier]

/etc/iet/initiators.allow 화일에서 iscsi 볼륨에 접근할 수 있는 서버를 설정해 준다. 기본은 ALL ALL이지만, Box2에서 만 사용하기 위해 아래와같이 설정을 바꾼다.

# vi /etc/iet/initiators.allow
# ALL ALL
iqn.2014-06.com.fox:storage.lun1 192.168.0.52

2. iSCSI initiator 설정 (iSCSI 볼륨을 이용할 서버)

open-iscsi를 설치한다.

# apt-get install open-iscsi

iscsi node에 자동으로 로그인할지를 설정한다. 기본값은 manual이다.

# vi /etc/iscsi/iscsid.conf
#node.startup = manual #주석처리
node.startup = automatic
# service open-iscsi start

iscsi target에 연결하고, 스토리지가 제공되는지 확인한다.

# iscsiadm -m discovery -t st -p fox1
192.168.0.51:3260,1 iqn.2014-06.com.fox:storage.lun1
# iscsiadm -m node
192.168.0.51:3260,1 iqn.2014-06.com.fox:storage.lun1

사용할 target에 대한 id와 password를 설정한다.(id는 fox, password는 fox123으로 설정했다.)

# iscsiadm -m node --targetname "iqn.2014-06.com.fox:storage.lun1" --portal "192.168.0.51:3260" --op=update --name node.session.auth.authmethod --value=CHAP
root@fox2:~#  iscsiadm -m node --targetname "iqn.2014-06.com.fox:storage.lun1" --portal "192.168.0.51:3260" --op=update --name node.session.auth.username --value=fox
root@fox2:~#  iscsiadm -m node --targetname "iqn.2014-06.com.fox:storage.lun1" --portal "192.168.0.51:3260" --op=update --name node.session.auth.password --value=fox123

위의 설정은 /etc/iscsi/nodes/iqn.2014-06.com.fox:storage.lun1/192.168.0.51,3260,1/default 화일에 저장되므로, 수동으로 설정해도 상관 없다.

설정을 마치고, iscsi initiator 서비스를 실행한다.

iscsi target에 로그아웃/로그인 하기

# iscsiadm -m node --targetname "iqn.2014-06.com.fox:storage.lun1" --portal "192.168.0.51" --logout
Logging out of session [sid: 2, target: iqn.2014-06.com.fox:storage.lun1, portal: 192.168.0.51,3260]
Logout of [sid: 2, target: iqn.2014-06.com.fox:storage.lun1, portal: 192.168.0.51,3260]: successful

# iscsiadm -m node --targetname "iqn.2014-06.com.fox:storage.lun1" --portal "192.168.0.51" --login
Logging in to [iface: default, target: iqn.2014-06.com.fox:storage.lun1, portal: 192.168.0.51,3260]
Login to [iface: default, target: iqn.2014-06.com.fox:storage.lun1, portal: 192.168.0.51,3260]: successful

로그인이 정상적으로 이루어지면, scsi 볼륨이 보일 것이다. 아래에서는 2GB /dev/sdb가 iscsi 볼륨이다. 화일시스템을 만들고 마운트하면, 정상적으로 사용할 수 있다.

# fdisk -l

Disk /dev/sda: 9663 MB, 9663676416 bytes
255 heads, 63 sectors/track, 1174 cylinders, total 18874368 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004d45b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    17825791     8911872   83  Linux
/dev/sda2        17827838    18872319      522241    5  Extended
/dev/sda5        17827840    18872319      522240   82  Linux swap / Solaris

Disk /dev/sdb: 2097 MB, 2097152000 bytes
65 heads, 62 sectors/track, 1016 cylinders, total 4096000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

참고 : CentOS 는 https://blog.boxcorea.com/wp/archives/1811

aix hacmp vg import 오류.

hacmp vg 관련 오류 처리

환경: aix 6.1, hacmp 6.1

오류 상황은 아래와 같다.

aix1, aix2 두 노드가 ha 설정되어 있으며, ha 실행되고 있는 상태.
aix1 에서 foxvg에 foxlv를 만들고(C-SPOC 사용하지 않음) 사용하다가 hacmp를 재시작(양쪽 node모두)했을때 아래 에러 발생
Continue reading

[스크랩] hp mc service guard 관련 커맨드

http://mailsinto.blogspot.kr/p/cluster-commands.html

HP mcservice guard 관련 커맨드가 위 사이트에 정리

Cluster 및 package 상태 보기

# cmviewcl –v

cluster 시작

# cmruncl

Continue reading

NTP server/client 설정, 사용하기 – AIX에서.

aix 에서 NTP 서버/클라이언트 설정과 사용하기.

구성환경:
Box1: 192.168.0.200 – NTP server, AIX 6.1
Box2: 192.168.0.201 – NTP Client, AIX6.1
Box3: 192.168.0.51 – NTP Client, Linux(Ubuntu 12.04)

작업전에, 현재의 timezone과 시간이 제대로 설정되어 있는지 확인.

# date
Tue Jul 1 18:08:15 CDT 2014

CDT 는 북아메리카 시간이므로 timezone을 한국으로 바꾼다.

timezone을 바꾸는 방법은 /etc/environment 화일에서 TZ 항목을 바꾸는 방법과,
chtz 커맨드로 바꾸는 방법이 있다. 변경된 TimeZone은 다시 로그인하면 적용된다.

# chtz 'KORST-9'
# date
Wed Jul 2 08:16:15 KORST 2014

 

Continue reading

errpt 관련 명령어.

AIX 에서 error 관련 명령어.

1. errlogger

운영시 필요한 메시지를 errorlog화일에 남김으로서 다른사람이 참고할 수 있도록 한다.

# errpt
# errlogger "OP MSG test... by snowfox"
# errpt
IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION
AA8AB241 0611202514 T O OPERATOR OPERATOR NOTIFICATION
# errpt -aj AA8AB241
---------------------------------------------------------------------------
LABEL: OPMSG
IDENTIFIER: AA8AB241

Date/Time: Wed Jun 11 20:25:21 CDT 2014
Sequence Number: 1918
Machine Id: 00CE71CE4C00
Node Id: aix1
Class: O
Type: TEMP
WPAR: Global
Resource Name: OPERATOR

Description
OPERATOR NOTIFICATION

User Causes
ERRLOGGER COMMAND

Recommended Actions
REVIEW DETAILED DATA

Detail Data
MESSAGE FROM ERRLOGGER COMMAND
OP MSG test ... by snowfox

 

Continue reading

AIX 로그 보기

AIX 는 다른 unix들과 log 보는 방법이 다르다. 가령,  solaris, hpux, linux에 모두 있는(비록 약간의 차이가 있지만) dmesg 같은 커맨드가 존재하지 않는다.

1. errpt

errpt는 error가 기록 되었을때 이를 report 하는 툴이다. 로그화일은 /var/adm/ras/errolog.  보통 옵션을 주지 않으면 기록된 모든 오류를 보여준다.  하지만, -d 옵션과 -T 옵션을 적절히 사용하면 원하는 오류메시지만 확인이 가능하다. 아래와 같은 에러 타입과 클래스를 사용할 수 있다.

Continue reading

aix NFS 서버/클라이언트 설정, 사용하기.

작업환경: IBM P570
OS: AIX 6100-08-02-1316
NFS 서버 ip주소: 192.168.0.200
NFS Client ip 주소: 192.168.0.213
Server/Client 모두 AIX 사용

client의 cdrom 을 사용할 수 없어, 다른서버에서 mount한 후 nfs를 통해 cdrom을 사용하고자 하였음. 따라서, /etc/exports/에서 -ro 옵션을 주었다.

Continue reading

bacula 백업 – 설치, 구성, 사용

opensource backup 솔루션인 Bacula 설치와 사용하기.

설치환경

백업서버
IP: 59.29.142.85
Hostname: fox1
OS: Ubuntu 12.04

백업 클라이언트(백업대상 서버)
IP: 59.29.142.120
Hostname: ubuntu-1
OS: ubuntu 12.04

Continue reading

ipmitool SOL(Serial Over LAN) 사용하기.

IPMI(Intellient Platform Management Interface) SOL 사용하기.

대상 서버: NEC Express5800/E120d-M
IPMI ip address: 10.17.123.212

참고문서: http://pic.dhe.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=%2Fliaai.ipmi%2Fliaaiipmitoolsol.htm

IPMI는 표준화된 메시지기반의 하드웨어 관리 인터페이스이다. BMC(Baseboard Management Controller)또는 MC(Management Controller)로 알려진 하드웨어 칩은 IPMI의 core를 구현한다.

ipmitool 은 ipmi 를 지원하는 장치의 구성, 모니터링, 관리를 가능하게 하는 유틸리티다.

이 글의 주 목적은 ipmitool을 사용하여 원격지에서 대상 서버의 serial console에 접속하는 것이다.
Continue reading

오픈스택 기본설치 설정화일들.

구성: Basic Installation 문서의 구성을 따랐음.

OS: Ubuntu 13.04

Cloud Controller Node: 59.29.142.9, 192.168.100.1
Network Controller Node: 59.29.142.88, 192.168.100.2
Compute Node: 59.29.142.86, 192.168.100.3

각 Node 공통사항

/etc/hosts

59.29.142.86  fox2
59.29.142.88  fox4
59.29.142.9  tech
192.168.100.1 cloud
192.168.100.2 network
192.168.100.3 compute1

  Continue reading