Transcript Power Linux

IBM Power Systems
PowerLinux HOWTO
IBM STG Power
BooSeon Yu
SeungGyu Lee
© 2013 IBM Corporation
IBM Power Systems
Index
1. Install


설치 전 구성 및 준비사항
Power Linux Install
2. Setup





Network setup
Etherchannel 구성 (bonding)
YUM 구성
Compiler 설치
IBM Installation Toolkit
3. Others



IBM Simplified Setup Tool
Disk 추가 및 LVM mirroring 설정
DLPAR 구성
4. Power Linux Tuning





2
Power Saver Mode
SMT Disable
Stop Unnecessary Services
Complier Option
sysctl Tuning
© 2013 IBM Corporation
IBM Power Systems
PowerLinux HOWTO
1. Install
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 7R2의 SAS RAID adapter
– Linux의 LVM mirror는 AIX LVM mirror와는 달리 완전한 OS disk의 보호에는 부족하므로, SAS RAID
adpater에 의한 HW mirroring을 구현하는 것이 보통입니다.
– 여기서는 아래와 같은 feature code “EJ0F”를 사용했습니다.
• EJ0F Storage Backplane -- 6 SFF Drives/SATA DVD/RAID/External SAS Port
4
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 SAS RAID 구성 - 개요
– OS를 설치하기 전에, 내장형 SAS RAID adapter에 연결된 내장 disk들을 RAID10으로 format 해야
합니다.
– 이를 위해서는, 먼저 장비에 함께 딸려오는 “Standalone Diagnostic CD”를 이용하여 booting해야
합니다.
– 이 “Standalone Diagnostic CD”로 booting을 하게 되면, AIX에서 “diag” 명령을 수행한 것과 동일한
메뉴가 나오며, 여기서 다음과 같은 순서로 RAID 구성 메뉴를 찾아 들어가면 됩니다.
• Task Selection
• Array RAID Manager
• IBM SAS Disk Array Manager
• Create an Array Candidate pdisk and Format to 528 byte Sectors
• Create a SAS Disk Array
5
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 SMS mode Booting
6
–
“Standalone Diagnostic CD”를 넣고 booting합니다.
–
만약 이미 disk로 booting하도록 설정이 되어 있다면, CD로 booting하기 위해서 HMC를 통해
SMS 메뉴로 boot mode를 바꾸거나, console에서 booting시 5개의 text icon이 뜰 때 1번 키를
눌러 SMS 메뉴로 들어가야 합니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 Boot Device 선택 (SMS)
 다음과 같은 순서로 boot
device 설정 메뉴를 찾아
들어가서, SATA CD-ROM을
boot device로 지정합니다.
– 5. Select Boot Options
– 1. Select Install/Boot Device
– 3. CD/DVD
– 5. SATA
– 1. SATA CD-ROM
– 2. Normal Mode Boot
– 1. Yes
 SMS에서 빠져 나오면 CDROM에 든 media로부터
booting을 하게 됩니다.
7
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 Console 선택 및 diag 최초 메뉴
8
–
최초 화면에서 아래와 같이 key를 눌러 terminal console을 선택합니다.
–
이어서 나오는 diagnostic 메뉴에서 3번 “Task Selection”을 선택합니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 RAID 설정 메뉴
9
–
“Task Selection”의 최초 메뉴는 다음과 같습니다.
–
그 중에서 맨 아래쪽에 있는 “RAID Array Manager”를 선택합니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 Candidate disk 선택 과정
10
–
RAID disk 구성을 위해서는, 먼저 512-byte로 format된 일반 hdisk를 528-byte로 format하여
Candidate disk, 즉 pdisk로 먼저 만들어야 합니다.
–
여기서는 PCIe x4 Insternal 3Gb SAS RAID Adapter에 내장 disk들이 연결되어 있습니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 Candidate disk formatting
11
–
일반 hdisk를 선택하여 format합니다. 이때 시간이 상당히 걸리며, 일부 error가 나오는 것은
상관없으니 무시하십시요.
–
여기까지 하고 나면 528-byte로 format된 candidate disk인 pdisk가 2개 만들어진 것입니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 SAS Disk Array 생성
– “Create a SAS Disk Array” 메뉴로 들어가서, 아까의 해당 adapter를 선택한 뒤, RAID level을 10으로
선택하십시요.
• 원래 RAID1을 선택해야 하지만, 이 adapter는 RAID0/5/10/6 중에 선택이 가능합니다.
12
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 RAID candidate disk의 선택
13
–
Stripe Size를 선택해야 하는데, 사실 대부분의 경우 RAID member disk가 2개 뿐이므로 별 의미는
없습니다. 256KB가 권장값이므로 그것을 선택합니다.
–
이어서 ESC+7 또는 F7을 눌러 candidate disk인 pdisk 2개를 모두 선택합니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 RAID Disk 생성 완료
14
–
확인 메뉴에서 엔터를 누르면 RAID Disk 생성이 완료됩니다.
–
이때 error가 일부 나올 수 있으나, 이는 무시하셔도 됩니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – 설치 전 구성 및 준비사항
 생성된 RAID disk의 확인
15
–
맨 위의 List SAS Disk Array Config 메뉴에서, 생성된 RAID disk를 확인할 수 있습니다.
–
2개의 pdisk로부터, 1개의 RAID10으로 format된 hdisk0가 만들어진 것을 볼 수 있습니다.
–
이후 diag 메뉴에서 빠져 나가면, 자동으로 reboot 됩니다.
© 2013 IBM Corporation
IBM Power Systems
1. Install – Power Linux Install
 Linux DVD를 CD drive에 집어 넣고 다시 SMS 메뉴에서 다시 한번 CD-ROM으로
booting하도록 설정을 한 뒤 SMS 메뉴를 빠져 나오면 linux로 부팅이 되면서 설치 메뉴가
나옵니다.
 “boot: “ 메뉴가 나왔을 때 엔터 키를 누르면 다음 메뉴로 넘어갑니다.
16
© 2013 IBM Corporation
IBM Power Systems
1. Install – Power Linux Install
 “Welcome to Red Hat Enterprise Linux” 창이 나오면 OK에 커서를 두고 엔터키를
입력합니다.
 그 후에 생성되는 Language 설정에서 English를 선택 합니다.
 Disk가 비어있지 않다는 경고메시지가 출력되면, reinitialize all을 선택합니다.
 Location and time zone 메뉴에서 Asia/Seoul 을 선택합니다.
 설치가 완료되고 나면 reboot을 합니다.
17
© 2013 IBM Corporation
IBM Power Systems
PowerLinux HOWTO
2. Setup
© 2013 IBM Corporation
IBM Power Systems
2. Setup – Network Setup
 Linux에서 네트워크를 설정하기 위해서는 네트워크 포트의 script를 편집하여 작성합니다.
 /etc/sysconfig/network-script에서 해당 네트워크 포트의 script를 편집합니다.
# cd /etc/sysconfig/network-scripts
# vi ifcfg-eth0
– BOOTPROTO=“dhcp”  고정 ip 사용시 static으로 변경
– HWADDR=….
– IPADDR=xxx.xxx.xxx.xxx
입력한 ip확인
– NETMASK=255.xxx.xxx.xxx
– GATEWAY=xxx.xxx.xxx.xxx
– TYPE=“Ethernet”
– ONBOOT=“yes”
 # service network restart
19
 yes로 바꿔야 booting시 자동으로 network port를 올립니다.
확인 후 network 재시작
© 2013 IBM Corporation
IBM Power Systems
2. Setup - EtherChannel 구성 (Bonding)
 Linux에서 etherchannel 구성
– Linux에서 etherchannel(bonding)을 구성하기 위해서는 network-scripts에서 bond interface script
file을 작성해서 구성합니다.
– Bond option은 아래와 같습니다.
[Bonding mode option]
0: balance-round robin ( 2개의 NIC를 통한 분배 + Fault Tolerance)
1 : active-standby (Active 상태의 NIC에 문제 발생시 Fault Tolerance)
2 : balance-xor (xor 연산을 통해서 통신 + Fault Tolerance)
3 : broadcast (2개의 NIC에 어떤 규칙없이 데이터 통신 + Fault Tolerance)
20
© 2013 IBM Corporation
IBM Power Systems
2. Setup - Ether Channel 구성 (Bonding)
 Linux에서 ether channel 구성
– 먼저 bond0 파일을 /etd/modprobe.d 에 생성하여 아래와 같이 script를 작성합니다.
# vi /etc/modprobe.d/bond0
alias bond0 bonding
– /etc/sysconfig/network-scripts 아래 Bond interface file 생성하여 아래와 같이 script를
작성합니다.
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.xxx.xxx.xxx
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
21
© 2013 IBM Corporation
IBM Power Systems
2. Setup - Ether Channel 구성 (Bonding)
– Bonding 할 network port의 network scripts 수정합니다. 저는 eth0와 eth1로
설정하였습니다.
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
*eth1역시 device name, UUID, HWADDR을 제외하고 위와 같이 수정
d. Network 재시작 및 확인
# service network restart
# cat /proc/net/bonding/bond0
*네트워크가 끊어지니 HMC 상에서 terminal로 작업하시는 것을 권합니다.
22
© 2013 IBM Corporation
IBM Power Systems
2. Setup – YUM Local Repository Setup
 YUM
– Redhat Enterprise Linux에서 RPM 기반의 시스템을 인스톨/업데이트/제거의 편의성을 위해서 yum
이라는 tool을 사용합니다. 설치한 Redhat Linux에서 함께 설치되어 있으며, repository를 기반으로
RPM package에 접근하기 때문에 운영의 편의를 위해 RHEL CD안에서 repository를 추출하여
설정해줍니다.
 RHEL RPM Package 추출
– Install CD에서 RPM fileset들을 추출합니다.
먼저 OS install CD를 CD-ROM에 삽입합니다.
# mount –t iso9660 /dev/sr0 /media/dvd
 media/dvd에 install cd를 mount 합니다.
# df –k 로 mount 확인
# mkdir /home/YUM  YUM repository에서 쓰일 RPM file들을 보관할 디렉터리를 생성합니다.
# cd /media/dvd/Packages
# cp –r . /home/YUM
23
 install CD안의 Packages 디렉터리 파일들을 추출합니다.
© 2013 IBM Corporation
IBM Power Systems
2. Setup – YUM Local Repository Setup
 Repository 생성 fileset 설치
– Repository를 생성하는 createrepo fileset을 설치하기 위해 아래 세 rpm file을 설치합니다.
# cd /media/dvd/Packages
# ls deltarpm*.rpm python-deltarpm*.rpm createrepo*.rpm
# rpm –Uvh deltarpm*.rpm python-deltarpm*.rpm createrepo*.rpm
24
© 2013 IBM Corporation
IBM Power Systems
2. Setup – YUM Local Repository Setup
 Repository data 생성
# cd /home/YUM
# createrepo /home/YUM  /home/YUM 에 repository data들을 생성합니다.
# ls /home/YUM/repodata  생성된 데이터 들을 확인합니다.
 Repository 등록
# vi /etc/yum.repos.d/rhel64-ppc.repo  repository 파일 이름으로 rhel64-ppc.repo로 하였습니다.
[rhel64-ppc.repo]
name=Red Hat Enterprise Linux 6.4 for PPC
(무엇으로 하든 상관없습니다.)
failovermethod=priority
baseurl=file:///home/YUM
enabled=1
metadata_expire=0d
gpgcheck=0
25
© 2013 IBM Corporation
IBM Power Systems
2. Setup – YUM Local Repository Setup
 YUM test
– 설정을 마치고 테스트를 합니다.
26
# yum search telnet
 찾고자 하는 fileset과 관련 된 파일을 검색합니다.
# yum install telnet.ppc64
 해당 fileset을 설치합니다.
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Advanced Toolcahin (컴파일러)
 IBM Advance Toolchain for PowerLinux
– PowerLinux 에서 보다 나은 성능을 위해서 IBM Advance Toolchain 이라는 컴파일러를 제공합니다.
– Advance Toolchain 6.0에서 제공되는 gcc 버전은 4.7.3 입니다. (RHEL에 포함된 gcc는 4.4 입니다.)
– 하기 링크(IBM DeveloperWorks site)에서 다운받으실 수 있습니다.
https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/W51a7ffcf4dfd_4b40_9d82_446ebc23c550/page/IBM%20Advance%2
0Toolchain%20for%20PowerLinux%20Documentation
27
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Advanced Toolcahin (컴파일러)
 IBM Advance Toolchain for PowerLinux
– Downloads 페이지에서 Linux 버전에 맞는 tab을 선택합니다.
– 많은 file list 중에서 아래 네 가지 파일을 download합니다.
(2013년 5월 13일 기준 6.0.4 버전 release)
advance-toolchain-at6.0-runtime.ppc64.rpm
advance-toolchain-at6.0-devel.ppc64.rpm
advance-toolchain-at6.0-mcore-libs.ppc64.rpm
advance-toolchain-at6.0-perf.ppc64.rpm
– SCP를 이용해서 관련파일들을 linux 파티션으로 이동하거나
usb, cd 등을 이용해서 linux 파티션에 복사를 합니다.
28
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Advanced Toolcahin (컴파일러)
 IBM Advance Toolchain for PowerLinux
– YUM을 이용해 bzip2 관련 파일들을 설치합니다. ( Advance Toolchain 설치 시 필요)
# yum search bzip
# yum install bzip2-devel.ppc64 bzip2-libs.ppc64 bzip2.ppc64
29
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Advanced Toolcahin (컴파일러)
 IBM Advance Toolchain for PowerLinux
– 일반 RPM 파일을 설치 하듯 다운받은 네 가지 파일을 설치합니다. 상호 파일간에 의존성이
있으므로 한번에 네 가지 파일을 설치합니다.
# rpm -Uvh advance-toolchain*.ppc64.rpm
– 설치한 Advance Toolchain의 gcc compiler 위치는 /opt/at6.0/bin/gcc 입니다. 기존 gcc 4.4 버전을
이동시키고, 새로 설치한 compiler로 링크를 설정합니다.
# mv /usr/bin/gcc /usr/bin/gcc.4.4
# ln –s /opt/at6.0/bin/gcc /usr/bin/gcc
30
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Advanced Toolcahin (컴파일러)
 Compile 방법
– IBM Advance Toolchain 6.0 (이하 AT6.0)은 gcc 4.7.3 이 포함되어 있습니다.
– AT 6.0은 자체 library와 연계하여 추가적으로 사용할 수 있는 option들이 있습니다.
– AIX와 다르게 Default option으로는 64bit로 compile 되며, 32bit로 compile하기 위해서는 –
m32라는 option을 주어야 합니다.
– Low latency를 구현 하기 위해서는 아래와 같은 option으로 complie하는 것을 권장합니다.
# gcc –O3 –flto –mcpu=power7 –mtune=power7 -ltcmalloc
31
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Installation Toolkit
 IBM Installation Toolkit은 Power Linux에 필요한
파일셋 들의 repository를 제공합니다.
– 아래 url에 접속하여 하단의 package를 클릭하여 iso
이미지를 다운로드 합니다.
http://www-304.ibm.com/webapp/set2/sas/f/lopdiags/installtools/download/home.html
– IBM id 가 필요하며, 로그인 후 간단한 설문조사와
약관 동의를 체크 하시면 다운로드 페이지로
넘어가게 됩니다.
 Image를 scp를 이용해 server로 옮깁니다.
* PC에는 winscp라는 툴을 사용합니다.
* Server에서는 # yum install openssh-clients.ppc64
을 이용해 scp client를 설치 합니다.
 iso이미지를 mount 합니다.
# mkdir /media/IBM_Toolkit
# mount -o loop /root/IBM_Installation_Toolkit_54.iso
/media/IBM_Toolkit/
32
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Installation Toolkit
 IBM Installation Tool kit 설치
# cd /media/IBM_Toolkit
 이미지를 마운트한 디렉터리로 이동합니다.
# ls
 디렉터리를 열어 install file이 있는지 확인합니다.
# ./intall
 install을 수행합니다.
첫 번째 문항에서 local repository를 copy 한다는 y를 선택합니다.
두 번째 문항에서는 update를 받을 것이냐는 문항은 n를 선택합니다.
세 번째 ethernet port를 열어둘 것이냐는 질문은 y를 선택합니다.
네 번째 문항에서는 5번을 선택하여 license를 accept하고,
마지막 문항은 yum repository를 설치하였으므로 4번을 선택합니다.
# yum repolist
33
 설치 완료 후 yum repository가 새로 등록 되었는지 확인합니다.
© 2013 IBM Corporation
IBM Power Systems
2. Setup – IBM Installation Toolkit
34
© 2013 IBM Corporation
IBM Power Systems
PowerLinux HOWTO
3. Others
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 IBM Power Linux에서 제공하는 IBM Installation Toolkit은 Open source workload 의
설정을 web기반 GUI를 이용하여 쉽게 할 수 있도록 하는 Simplified Setup Tool을 포함하고
있습니다.
 IBM SST를 이용하여 아래의 네 가지 서버 환경을 구성하는데 필요한 요소들을 설치 및
설정할 수 있습니다.
– Web server (LAMP) : Linux, Apache, Mysql, PHP 네 가지 오픈소스를 사용하여 구성한 웹서버
– Mail server : PostFix(MTA) 와 IMAP4 프로토콜을 이용해서 mail 서버를 구축합니다.
– File and print server :
– Network Infrastructure server
 SST를 이용하기 위해서는 먼저, Installation Toolkit의 yum repository를 이용하여 설치를
합니다.
# yum install sst-*
36
 sst 관련 모든 파일들을 설치해줍니다.
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 설치가 끝나면 서버와 네트워크로 연결된 PC의 웹브라우져를 통해 SST로 접속합니다.
– 이때 접속하는 주소는 https://(server IP address):6060 입니다.
EX) https://123.456.789.1:6060
– 웹브라우저에서 경고 메시지가 나오면 예외 추가를 하여 진행합니다.
– 좌측하단 “I agree”를 클릭하여 Software license 규정에 동의합니다.
37
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 첫 화면에서 4가지 workload를 볼 수 있고, 아직 configured 되지 않았다는 것을 확인 할 수
있습니다. 설치를 원하는 workload를 선택하여 클릭합니다.
원하는 open source workload 선택
38
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Web Server 구성 (LAMP)
– Web Server를 클릭하면, 변경될 설정들을 보여줍니다. 왼쪽 하단 Next를 클릭하면 구성이
진행됩니다.
– Apache 관련 httpd.conf 파일을 수정하고 네트워크 관련 설정들이 진행됩니다.
39
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 LAMP 구성시 자동으로 설정되는 parameter들
Files that will be changed:
/etc/httpd/conf/httpd.conf
/etc/sysconfig/httpd
/etc/sysctl.conf
/etc/sysconfig/network-scripts/ifup-eth
=================================================================================================
Commands that will be performed:
iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
service iptables save
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.conf.all.arp_filter=1
sysctl -w net.ipv4.tcp_timestamps=0
sysctl -w net.ipv4.tcp_max_tw_buckets=1440000
sysctl -w net.core.rmem_default=16777216
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_default=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.core.optmem_max=16777216
sysctl -w net.ipv4.tcp_rmem="65536 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="65536 87380 16777216"
sysctl -w net.ipv4.tcp_mem="65536 87380 16777216"
sysctl -w net.ipv4.tcp_window_scaling=0
sysctl -w net.ipv4.tcp_dsack=0
sysctl -w net.ipv4.tcp_sack=0
sysctl -w net.core.somaxconn=66636
sysctl -w net.core.netdev_max_backlog =30000
sysctl -w net.ipv4.tcp_max_syn_backlog=16384
ip link set eth3 txqueuelen 60000
chkconfig --level 35 httpd on
service httpd restart
chkconfig --level 35 mysqld on
service mysqld restart
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Mail Server 구성 - Postfix
– Postfix는 SMTP (Simple Mail Transfer Protocol)와 MTA (Mail Transfer Agent) 기능을 구현하는
어플리케이션 입니다.
– 아래에 주어진 필드 값들을 입력하면 /etc/postfix/main.cf 파일이 편집되어 Postfix에 반영됩니다.
My Hostname : 메일서버에서 사용할 hostname을 입력합니다. default값은 localhost.localdomain
입니다. ex) mail.ibm.com
My Domain : 메일 서버에서 사용할 Domain을 입력합니다. ex) ibm.com
Inet Interface : 메일을 수신할 서버를 지정합니다. (기본값은 all 입니다.)
41
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Mail Server 구성
– 다음으로 IMAP Protocol을 설정하는 page에서 사용할 protocol을 설정해 줍니다.
• Protocol : 어떤 메일 프로토콜을 사용할지 설정합니다. 여기서는 IMAP4를 사용합니다.
• Listen : 메일 수신을 허용할 IP address를 입력합니다. default 값은 *(모두)입니다.
42
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Mail Server 구성
– 구성될 정보들을 확인하고 설치를 진행합니다.
43
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 File and Print Server 구성
– Window 사용자를 위한 Workgroup을 지정합니다
– User로 사용될 window PC에서 “내
컴퓨터”아이콘을 우 클릭하여 속성으로 들어가면
작업그룹을 확인 하실 수 있습니다.
– 다음으로 보안 등급을 user level 로 할 것인지
share level로 할 것인지를 선택하고, 좌측 하단
Next 단추를 이용하여 작업을 진행합니다.
44
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 File and Print Server 구성
– 변경되는 사항들을 확인하고, 구성을 진행합니다.
– 앞서 설정한 사항들이 Samba 관련 smb.conf와 rc 데몬 관련 rc.conf 파일들에 적용됩니다.
45
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 File and Print Server 구성시 자동으로 설정되는 parameter들
Files that will be changed:
/etc/samba/smb.conf
/etc/rc.d/local
Commands that will be performed:
iptables -t filter -A SST-INPUT -m udp -p udp --dport 137 -j ACCEPT
iptables -t filter -A SST-INPUT -m udp -p udp --dport 138 -j ACCEPT
iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
iptables -t filter -A SST-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
service iptables save
echo 2048 > /sys/block/ram0/queue/read_ahead_kb
echo 2048 > /sys/block/ram1/queue/read_ahead_kb
…중략…
echo 2048 > /sys/block/ram15/queue/read_ahead_kb
echo 2048 > /sys/block/loop0/queue/read_ahead_kb
echo 2048 > /sys/block/loop1/queue/read_ahead_kb
…중략…
echo 2048 > /sys/block/loop7/queue/read_ahead_kb
echo 2048 > /sys/block/sdb/queue/read_ahead_kb
echo 2048 > /sys/block/sda/queue/read_ahead_kb
echo 2048 > /sys/block/dm-0/queue/read_ahead_kb
echo 2048 > /sys/block/dm-1/queue/read_ahead_kb
…중략…
echo 2048 > /sys/block/dm-7/queue/read_ahead_kb
echo 2048 > /sys/block/sr0/queue/read_ahead_kb
echo deadline > /sys/block/sdb/queue/scheduler
echo deadline > /sys/block/sda/queue/scheduler
echo deadline > /sys/block/dm-0/queue/scheduler
echo deadline > /sys/block/sr0/queue/scheduler
chkconfig --level 35 smb on
service smb restart
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Network infrastructure Server 구성
– DNS 서버인 BIND server를 구성할지 proxy server의 종류인 Squid 서버를 구성할지 선택을 합니다.
47
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Network infrastructure Server 구성
– 서버의 타입을 선택합니다.
• Caching-only : Cache data만 저장할
서버를 구성할 경우
• Master (no Slave) : Slave가 Master로
구성합니다. Master를 선택하는 경우
Master 서버 IP 주소와 Master 서버
도메인 이름을 지정해야 합니다.
• Master (with Slave) : Slave 서버를 갖는
Master 서버로 구성합니다. 이 옵션을
선택하는 경우 Master 서버 IP 주소,
도메인 이름 및 Slave 서버 IP 주소를
지정해야 합니다.
• Slave : 고급 DNS 구성 시, 가용성을
보장하기 위해 별도의 Master 및 Slave
서버를 배치할 수 있습니다. 이 경우에
서버의 유형이 Master 또는 Slave인지를
지정해야 합니다.
48
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Network infrastructure Server 구성
– Squid Proxy 서버를 구성할 경우
– 아래 두 값을 입력하면, /etc/squid/squid.conf
파일에 반영되어 편집이 됩니다.
• IP ACL (Access Control List) : 네트워크에
접속 권한이 있는 IP를 지정합니다. 2개
이상의 IP를 입력 시, 쉼표로 구분할 수
있고, 대쉬를 이용해 범위를 지정할 수도
있습니다.
• Cache size : 캐쉬를 저장할 영역의 size를
입력합니다. 단위는 MB입니다.
49
© 2013 IBM Corporation
IBM Power Systems
3. Others - IBM Simplified Setup Tool
 Network infrastructure Server 구성
– 설정을 확인한 뒤, 구성을 진행합니다.
50
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 Linux LVM
– AIX 의 LVM과 마찬가지로 Linux의 LVM 역시 물리적 디스크, 볼륨 그룹, 논리적 디스크 이 세가지
개념으로 구성되어 있습니다.
– 두 운영체제의 LVM의 기본적인 개념은 비슷하지만, 아래와 같은 차이점이 있습니다.
• hdisk[0,1,2,…] 와 sd[a,b,c,…]
 AIX에서 물리적인 disk 단위는 hdisk[0,1,2..] 와 같은 식으로 표현되지만,
Linux에서는 sda, sdb, sdc… (IDE 방식 disk는 hd[a,b,c…) 처럼 표현됩니다.
• PP vs PE, LE vs LP
 물리적 할당 단위인 AIX의 PP(Physical Partition)은 Linux에서 PE (Physical Extend)로 대응
되고, 논리적 할당 단위인 LP(Logical Partition)은 Linux의 LE (Logical Extend)로 대응 됩니다.
• AIX와 Linux 간의 기본적인 LVM 명령어 비교
AIX
51
Linux
비고
Physical
Volume
chdev / rmdev; reducevg –d / lspv
fdisk / pvremove / pvdisplay
PV를 LVM에서 사용하도록 설정
Volume
Group
mkvg / reducevg / lsvg
vgcreate / vgremove / vgdisplay
VG 생성, 제거, 확인
Logical
Volume
mklv / rmlv / lslv
lvcreate / lvremove / lvdisplay
LV 생성, 제거, 확인
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 Physical Disk와 Disk Partition
– Linux에서 sda, adb… 로 구분되는 물리적 디스크는
partition을 나눌 수 있습니다.
– Partition은 disk의 실린더 번호를 기준으로
순차적으로 나뉘어 집니다.
[root@localhost ~]# fdisk -l
Disk /dev/sda: 300.0 GB, 300000000000 bytes
– 디스크 이름 (sda, sdb …)뒤에 숫자(sda1, sda2, sda3
…) 로 구분되며, 낮은 번호부터 시스템에
mount됩니다.
– PowerPC용 RHEL 6.4를 인스톨하면, 장착된 디스크
중, 첫 번째 디스크(sda)를 아래와 같이
파티셔닝합니다.
sda1 : PPC PReP Boot
 PowerPC boot 파티션
sda2 : Linux
 Linux boot를 위한 파티션
sda3 : Linux LVM
 LVM이 관장하는 파티션
128 heads, 32 sectors/track, 143051 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7a170900
Device Boot
/dev/sda1 *
Start
1
End
3
Blocks Id System
4096 41 PPC PReP Boot
Partition 1 does not end on cylinder boundary.
/dev/sda2
3
253
512000 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3
253
143051 292451328 8e Linux LVM
Partition 3 does not end on cylinder boundary.
– fdisk –l 명령어로 System의 전체 디스크의 파티션을
확인 할 수 있습니다.
52
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
[root@localhost ~]# fdisk -l
 LVM Disk 추가
– RHEL 패키지에는 udev 라는 데몬이 포함되어
있어, AIX와는 다르게 디스크를 추가했을 때,
cfgmgr과 같은 명령 없이 system에서 인식을
합니다.
Disk /dev/sda: 300.0 GB, 300000000000 bytes
128 heads, 32 sectors/track, 143051 cylinders
Units = cylinders of…….
.
.
.
Disk /dev/sdb: 300.0 GB, 300000000000 bytes
256 heads, 63 sectors/track, 36330 cylinders
– system에 디스크를 추가하고 fdisk –l 명령으로
확인합니다.
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
– 추가된 디스크를 partitioning 합니다.
여기서는 sdb로 인식하였으므로, 아래 명령으로
partitioning 합니다.
# fdisk /dev/sdb
Command (m for help):
– m을 입력 하여 입력 메뉴를 확인합니다.
53
[root@localhost ~]# fdisk /dev/sdb
Command (m for help):
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM Disk Partitioning
[root@localhost ~]# fdisk /dev/sdb
– ‘n’ 을 입력합니다. (add a new partition)
Command action
e extended
(확장 파티션)
p primary partition (1-4)
(주 파티션)
– ‘p’ 주 파티션을 선택합니다.
– 생성할 파티션 개수를 입력합니다. (1-4개 가능)
First cylinder (1-36330, default 1):
Last cylinder, +cylinders or +size{K,M,G}
– 각 파티션 별로 첫 실린더와 끝 실린더를
입력하여 크기를 설정합니다.
첫 실린더의 경우, 엔터를 입력하면 default값이
입력 되고, 끝 실린더는 +를 이용하여 크기를
지정할 수 있습니다.
ex) Last cylinder : +60G (60G 파티션 생성)
Command (m for help):
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-36330, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-36330, default 36330):
Using default value 36330
54
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM Disk Partitioning
– 디스크에서 사용할 시스템을 지정해 주기 위해서 ‘t’를 입력하여 system id를 설정합니다.
Selected partition : 1 (설정할 파티션 선택)
Hex code (type L to list codes): L
 Hex code로 되어 있는 system id를 입력합니다. ‘L’을 입력하여 list를 확인 할 수 있습니다.
Hex code (type L to list codes): 8e
 Linux LVM의 code인 8e를 입력합니다.
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
0
1
2
3
4
5
6
7
8
Empt
FAT12
XENIX root
XENIX usr
FAT16 <32M
Extended
FAT16
HPFS/NTFS
AIX
24 NEC DOS
39 Plan 9
3c PartitionMagic
40 Venix 80286
41 PPC PReP Boot
42 SFS
4d QNX4.x
4e QNX4.x 2nd part
4f QNX4.x 3rd part
81 Minix / old Lin
82 Linux swap / So
83 Linux
84 OS/2 hidden C:
85 Linux extended
86 NTFS volume set
87 NTFS volume set
88 Linux plaintext
8e Linux LVM
.
.
.
bf Solaris
c1 DRDOS/sec (FATc4 DRDOS/sec (FATc6 DRDOS/sec (FATc7 Syrinx
da Non-FS data
db CP/M / CTOS / .
de Dell Utility
df BootIt
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
55
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
Command (m for help): P
 LVM Disk Partitioning, PV 생성
– ‘P’ 를 입력하여 현재 설정을 확인합니다.
Disk /dev/sdb: 300.0 GB, 300000000000 bytes
256 heads, 63 sectors/track, 36330 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x184d40f8
– 설정을 확인한 뒤, 변경 사항이 없으면 ‘w’를
입력하여 설정을 저장한 뒤 빠져나옵니다.
Device Boot
/dev/sdb1
Start
1
End
Blocks Id System
36330 292965088+ 8e Linux LVM
Command (m for help): w
The partition table has been altered!
–
fdisk –l 로 시스템에 반영이 됐는지
확인합니다.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# fdisk -l
– pvdisplay를 입력하여 Physical Volume이
등록되었는지 확인하면, 아직 LVM에는 생성이
되지 않았습니다.
– pvcreate /dev/(디스크파티션) 을 입력하여
PV를 LVM에 생성합니다.
ex) pvcreate /dev/sdb1
Disk /dev/sda: 300.0 GB, 300000000000 bytes
128 heads, 32 sectors/track, 143051 cylinders
Units = cylinders of…….
.
.
.
Disk /dev/sdb: 300.0 GB, 300000000000 bytes
256 heads, 63 sectors/track, 36330 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Device Boot
/dev/sdb1
Start
1
End
Blocks Id System
36330 292965088+ 8e Linux LVM
[root@localhost ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
56
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM Volume Group
– pvdisplay 명령으로 생성한 PV를 확인합니다.
# pvdisplay
– PV를 새로운 Volume Group에 추가 (vgcreate)
# vgcreate (vg이름) /dev/(pv이름)
# vgs  vg확인
– PV를 기존 Volume Group에 추가 (vgextend)
# vgextend (vg이름) /dev/(pv이름)
– VG 삭제 (vgremove)
# vgremove (vg이름)
– Volume Group에서 PV 제거 (vgreduce)
# vgreduce (vg이름) /dev/(pv이름)
[root@localhost ~]# pvdisplay /dev/sdb1
"/dev/sdb1" is a new physical volume of "279.39 GiB"
--- NEW Physical volume --PV Name
/dev/sdb1
VG Name
PV Size
279.39 GiB
Allocatable
NO
PE Size
0
Total PE
0
Free PE
0
Allocated PE
0
PV UUID
7c1OkY-hExy-cBW7-mOA3-b6MX-RGCD-G9Sxma
[root@localhost ~]# vgcreate test_vg /dev/sdb1
Volume group "test_vg" successfully created
[root@localhost ~]# vgs
VG
#PV #LV #SN Attr VSize VFree
VolGroup 1 3 0 wz--n- 278.90g
0
test_vg 1 0 0 wz--n- 279.39g 279.39g
[root@localhost ~]# vgremove test_vg
Volume group "test_vg" successfully removed
[root@localhost ~]# vgs
VG
#PV #LV #SN Attr VSize VFree
VolGroup 1 3 0 wz--n- 278.90g 0
[root@localhost ~]# vgextend VolGroup /dev/sdb1
Volume group "VolGroup" successfully extended
[root@localhost ~]# vgs
VG
#PV #LV #SN Attr VSize VFree
VolGroup 2 3 0 wz--n- 558.29g 279.39g
[root@localhost ~]# vgreduce VolGroup /dev/sdb1
Removed "/dev/sdb1" from volume group "VolGroup"
[root@localhost ~]# vgs
VG
#PV #LV #SN Attr VSize VFree
VolGroup 1 3 0 wz--n- 278.90g 0
57
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM Logical Volume
– VG에 논리 볼륨(LV)을 생성 (lvcreate)
# lvcreate –L (lv 크기) –n (lv이름) (vg이름)
# lvs
 LV 확인
– LV의 크기 변경 (lvresize)
# lvresize –L (변경할 크기) /dev/(vg이름)/(lv이름)
(LV가 디렉터리에 마운트되어 있으면 안 된다.)
ex) lvresize –L +10M /dev/testVG/testLV
 10M 확장
lvresize –L 100M /dev/testVG/testLV
 100M로 크기 변경
lvresize –L -10M /dev/testVG/testLV
 10M 축소
*LV 크기 축소 시 , 데이터 손상에 대한
경고메시지가 출력됩니다.
– LV제거
# lvremove /dev/(vg이름)/(lv이름)
58
[root@localhost /]# lvcreate -L 500M -n test_lv VolGroup
Logical volume "test_lv" created
[root@localhost /]# lvs
LV
VG
Attr
LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_home VolGroup -wi-ao--- 221.32g
lv_root VolGroup -wi-ao--- 50.00g
lv_swap VolGroup -wi-ao--- 7.58g
test_lv VolGroup -wi-ao--- 500.00m
[root@localhost /]# lvresize -L +100M /dev/VolGroup/test_lv
Extending logical volume test_lv to 600.00 MiB
Logical volume test_lv successfully resized
[root@localhost /]# lvs
LV
VG
Attr
LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_home VolGroup -wi-ao--- 221.32g
lv_root VolGroup -wi-ao--- 50.00g
lv_swap VolGroup -wi-ao--- 7.58g
test_lv VolGroup -wi-ao--- 600.00m
[root@localhost /]# lvresize -L 700M /dev/VolGroup/test_lv
Extending logical volume test_lv to 700.00 MiB
Logical volume test_lv successfully resized
[root@localhost /]# lvs
LV
VG
Attr
LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_home VolGroup -wi-ao--- 221.32g
lv_root VolGroup -wi-ao--- 50.00g
lv_swap VolGroup -wi-ao--- 7.58g
test_lv VolGroup -wi-ao--- 700.00m
[root@localhost /]# lvresize -L -200M /dev/VolGroup/test_lv
WARNING: Reducing active and open logical volume to 500.00 MiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce test_lv? [y/n]: y
Reducing logical volume test_lv to 500.00 MiB
Logical volume test_lv successfully resized
[root@localhost /]# lvs
LV
VG
Attr
LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_home VolGroup -wi-ao--- 221.32g
lv_root VolGroup -wi-ao--- 50.00g
lv_swap VolGroup -wi-ao--- 7.58g
test_lv VolGroup -wi-ao--- 500.00m
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
[root@localhost /]# mkdir /test
 LVM File System
– 먼저 file system(fs)을 mount 할 디렉터리를 생성하고,
fs을 생성하여 mount합니다.
# mkdir (mount할 디렉터리 명)
# mkfs –t (fs 타입) /dev/(vg이름)/(lv이름)
# mount –t (fs 타입) /dev/(vg이름)/(lv이름) (mout point)
ex) # mkdir /test
# mkfs –t ext4 /dev/testVG/testLV
# mout –t ext4 /dev/testVG/testLV /test
* ext4는 저널링 파일시스템으로서 리눅스 표준 파일 시스템 타입입니다.
# df –hT  생성한 파일시스템을 확인합니다.
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
– File System 사이즈 변경
•
먼저 mount를 해제 합니다.
# umount (mount point)
•
해당 FS를 검사하고 사이즈를 변경합니다.
# e2fsck –f /dev/(vg이름)/(lv이름)
# resize2fs /dev/(vg이름)/(lv이름) 변경할 size
ex) # resize2fs /dev/VG1/LV1 +100g
59
 100G 확장
# resize2fs /dev/VG2/LV2 -50m

# resize2fs /dev/VG3/LV3 150g

[root@localhost /]# mkfs -t ext4 /dev/VolGroup/test_lv
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
50M 축소
150G 로 변경
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost /]# mount -t ext4 /dev/VolGroup/test_lv /test/
[root@localhost /]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
ext4 50G 8.4G 39G 18% /
tmpfs
tmpfs 7.5G 0 7.5G 0% /dev/shm
/dev/sda2 ext4 485M 44M 416M 10% /boot
/dev/mapper/VolGroup-lv_home
ext4 218G 3.0G 204G 2% /home
/dev/mapper/VolGroup-test_lv
ext4 485M 11M 449M 3% /test
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM - /etc/fstab 설정
– 마운트한 파일시스템은 파일시스템들의 마운트 설정에 관한 정보가 있는 etc/fstab 파일에 등록하여야 합니다.
– fstab에는 다음 6가지 항목이 순서대로 한 행에 입력되어 있습니다.
[file system device name] [mount point] [file system type] [options] [dump] [file check options]
ex) /dev/sys /sys sysfs defaults 0 0
/dev/mapper/Volgroup-lv_home /home ext4
defaults
12
• file system device name : 파일시스템의 장치 명을 입력합니다. /dev/sdc2 와 같이 시스템 장치명의 위치로
표시할 수 있고, “label”명을 주어 label로 표시할 수도 있습니다.
• mount point : 파일시스템이 마운트 될 위치를 입력합니다.
• file system type : 파일시스템의 종류를 입력합니다. linux에서 사용하는 대표적인 파일시스템의 종류는
아래와 같습니다.
ext, ext2, ext3, ext4 : 초기 리눅스에서 부터 사용되었던 파일시스템 타입으로 현재 ext4까지 발전되어왔습니다. ext는
현재 사용하지 않고, PowerPC용 RHEL 6.4에서는 ext4을 지원합니다.
iso9660 : DVD 또는 CD-ROM의 표준 파일시스템으로서 read only로 사용합니다.
nfs : Network File System을 사용할 때 쓰는 파일시스템 입니다.
system에서 지원 가능한 파일 시스템은 /proc/filesystems 에서 확인 가능합니다.
•
options : 파일시스템의 속성을 설정하는 option입니다. default option을 주게 되면, rw(read&write), auto
(부팅시 자동 마운트), exec(실행 파일 실행 허용) 등 기본적인 option이 설정됩니다.
좀더 많은 정보를 원하면, man mount 명령으로 확인 가능합니다.
•
•
60
dump : 데이터 백업 등을 위한 dump의 가능 여부를 설정합니다. 0 또는 1 값만 가질 수 있으며, 1은
dump가 가능한 파일 시스템, 0은 불가능한 파일시스템 입니다.
file check options : 부팅 시 선행되는 파일시스템의 검사(fsck) 순서를 설정합니다.
0 : 부팅 시, fsck가 실행되지 않는 설정
1 : 우선적으로 검사 (root)
2 : 1번이 끝난 후 체크
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM - /etc/fstab 설정
– 먼저, 생성한 LV에 label을 만들어 줍니다.
# e2label /dev/(VG 이름)/(LV 이름) LV label 확인
# e2label /dev/(VG 이름)/(LV 이름) /(label 이름)
– vi 편집기를 이용해 /etc/fstab에 아래와 같은 항목을 추가합니다.
LABEL=(label이름)
(mount point 주소)
ext4
default
1
2
[root@localhost IBM_Toolkit]# e2label /dev/VolGroup/test_lv
[root@localhost IBM_Toolkit]# e2label /dev/VolGroup/test_lv /test-label
[root@localhost IBM_Toolkit]# e2label /dev/VolGroup/test_lv
/test-label
[root@localhost IBM_Toolkit]# vi /etc/fstab
------------------------------------------------------------------------------------------------V I 편집 --------------------------------------------------------------------------------------------------------------------------------#
# /etc/fstab
# Created by anaconda on Fri Apr 26 14:29:09 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root /
ext4 defaults
11
UUID=8d3e75bb-248d-4d15-8a9f-cf0ee906d9a9 /boot
ext4 defaults
12
/dev/mapper/VolGroup-lv_home /home
ext4 defaults
12
/dev/mapper/VolGroup-lv_swap swap
swap defaults
00
LABEL=/test-label
/test
tmpfs
/dev/shm
61
ext4 defaults
tmpfs defaults
22
00
 추가된 항목
© 2013 IBM Corporation
IBM Power Systems
3. Others – Linux LVM (Logical Volume Manager)
 LVM Mirroring
– LVM이 관장하는 볼륨을 미러링 합니다.
– Linux LVM Type(8e)이 아닌, boot image와 Linux영역은 LVM을 이용하여 mirroring 할 수 없습니다.
– lvconvert 명령에서 m1 옵션을 주어 lv의 속성을 mirroring 할 수 있도록 변경합니다.
# lvconvert –m1 /dev/(vg이름)/(lv 이름)
– lvs에 –a 옵션(all)과 –o +devices 옵션(LV의 물리적 위치)을 주어 mirroring 된 상태를 확인합니다.
# lvs –a –o +devices
[root@localhost IBM_Toolkit]# lvconvert -m1 /dev/VolGroup/lv_home
VolGroup/lv_home: Converted: 0.0%
VolGroup/lv_home: Converted: 0.2%
.
.
.
VolGroup/lv_home: Converted: 99.8%
VolGroup/lv_home: Converted: 100.0%
[root@localhost ~]# lvs -a -o +devices
LV
VG
Attr
LSize Pool Origin Data% Move
Log
Cpy%Sync
lv_home VolGroup mwi-aom-221.32g
lv_home_mlog 100.00
[lv_home_mimage_0] VolGroup iwi-aom-- 221.32g
[lv_home_mimage_1] VolGroup iwi-aom-- 221.32g
[lv_home_mlog] VolGroup lwi-aom-- 4.00m
lv_root
VolGroup -wi-ao--50.00g
lv_swap
VolGroup -wi-ao--7.58g
62
Convert
Devices
lv_home_mimage_0(0),lv_home_mimage_1(0)
/dev/sda3(12800)
/dev/sdb1(125)
/dev/sdb1(56784)
/dev/sda3(0)
/dev/sda3(69459)
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 HMC 와 파티션 간의 네트워크 확인
– 먼저, HMC와 Linux 파티션이 같은 네트워크 안에 구성되어 있는지 확인합니다.
# ping xxx.xxx.xxx.xxx
(linux 파티션에서 HMC로 ping이 가는지 확인)
HMC 창에서 HMC관리  네트워크 연결테스트  파티션의 IP입력 후 ping test
63
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 Linux 파티션에서 RMC 네트워크 데몬 설치
– HMC와 파티션간의 네트워크가 구성되어 있으나, DLPAR 시도 시, 아래와 같은 메시지가
출력됩니다.
– Linux 파티션의 터미널 창에서 YUM을 이용해 RMC Network를 구성하는 아래 file 들을 설치합니다.
• 해당 파일들은 IBM Installation Toolkit으로 구성한 YUM repository에 있습니다.
• Korn shell에서 설치를 해야 하므로, 먼저 kshell을 구성합니다.
# yum install ksh.ppc64
src.ppc
rsct.core.utils.ppc
rsct.core.ppc
devices.chrp.base.ServiceRM.ppc
DynamicRM.ppc64
ibm-power-managed-rhel6.ppc64
• YUM을 이용해 위 여섯 개의 파일들을 찾아서 install 합니다.
(bold 표시한 키워드로 찾으면 쉽습니다.)
# yum search src rsct servicerm dynamicrm ibm-power-managed
64
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 Linux 파티션에서 RMC 네트워크 데몬 설치 (계속)
# yum install src.ppc rsct.core.utils.ppc devices.chrp.base.ServiceRM.ppc DynamicRM.ppc64
rsct.core.ppc ibm-power-managed-rhel6.ppc64
# reboot
65
 install 후 reboot을 합니다.
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 Linux 파티션에서 RMC 네트워크 데몬 실행
# lssrc –g rsct_rm
Subsystem
IBM.ServiceRM
IBM.DRM
IBM.ERRM
IBM.AuditRM
IBM.SensorRM
IBM.MgmtDomainRM
IBM.HostRM
 rsct_rm 그룹에 해당 데몬들이 설치되었는지 확인합니다.
Group
PID
Status
rsct_rm
2630
active
rsct_rm
2632
active
rsct_rm
inoperative
rsct_rm
inoperative
rsct_rm
inoperative
rsct_rm
inoperative
rsct_rm
inoperative
# lssrc -a
Subsystem
ctrmc
IBM.ServiceRM
IBM.DRM
ctcas
IBM.ERRM
IBM.AuditRM
IBM.SensorRM
IBM.MgmtDomainRM
IBM.HostRM
66
Group
rsct
rsct_rm
rsct_rm
rsct
rsct_rm
rsct_rm
rsct_rm
rsct_rm
rsct_rm
PID
1261
2630
2632
Status
active
active
active
inoperative
inoperative
inoperative
inoperative
inoperative
inoperative
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 Linux 파티션에서 RMC 네트워크 데몬 실행
– 네트워크 데몬을 시작합니다.
# startsrc -g rsct_rm
0513-059 The IBM.ERRM Subsystem has been started. Subsystem PID is 3492.
0513-059 The IBM.AuditRM Subsystem has been started. Subsystem PID is 3493.
0513-059 The IBM.SensorRM Subsystem has been started. Subsystem PID is 3494.
0513-029 The IBM.ServiceRM Subsystem is already active.
Multiple instances are not supported.
0513-059 The IBM.MgmtDomainRM Subsystem has been started. Subsystem PID is 3495.
0513-029 The IBM.DRM Subsystem is already active.
Multiple instances are not supported.
0513-059 The IBM.HostRM Subsystem has been started. Subsystem PID is 3496.
# lssrc -g rsct_rm
Subsystem
IBM.ServiceRM
IBM.DRM
IBM.ERRM
IBM.AuditRM
IBM.SensorRM
IBM.HostRM
IBM.MgmtDomainRM
67
Group
rsct_rm
rsct_rm
rsct_rm
rsct_rm
rsct_rm
rsct_rm
rsct_rm
PID
2630
2632
3492
3493
3494
3496
3560
Status
active
active
active
active
active
active
active
© 2013 IBM Corporation
IBM Power Systems
3. Others – Power Linux DLPAR 구성
 Dynamic Lpar 동작 확인
# ppc64_cpu --cores-on
 Lpar에 현재 할당된 CPU를 확인합니다. (4core activate)
Number of cores online = 4
– HMC 상에서 CPU 제거
# ppc64_cpu –cores-on
68
(3core 할당)
 확인
© 2013 IBM Corporation
IBM Power Systems
PowerLinux HOWTO
4. Tuning
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Power Saver Mode
 Power Saver Mode – HMC에서 ASM launching
– Power Save Mode를 disable하는 것이 짧은 transaction의 응답 시간 향상에 좋습니다.
– 이의 disable을 위해서는 ASM (Advanced System Management) 메뉴에 접속해야 합니다.
– ASM은 PowerLinux 서버의 serial port를 통해 접속할 수도 있으나, 여기서는 HMC를 이용해서 접속하는 방법을
소개합니다.
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Power Saver Mode
 Power Saver Mode – ASM에 접속
– 앞 페이지의 ASM 메뉴를 launch하면, 아래 왼쪽 화면과 같이 service processor IP를 선택하는 메뉴가 나옵니다.
(보통 PowerLinux에서는 service processor가 1개이므로 그냥 OK를 선택하면 됩니다.)
– 이어서 나오는 ASM 초기 메뉴에서, id는 admin, password도 admin으로 login 합니다.
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Power Saver Mode
 Power Saver Mode - Disable Power Saver mode
– Brower 왼쪽 window의 “System Configuration” 메뉴의 sub-menu 중 “Power Management”를 택합니다.
– 그 sub-menu 중 “Power Mode Setup”을 선택합니다.
– 이어서 나타나는 오른쪽 window에서, “Disable Power Saver mode”를 선택하고 아래의 “Continue” 버튼을 누릅니다.
Low latency에는
이것을 선택 !
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Power Saver Mode
 Power Saver Mode – Idle Power Saver disable
– (POWER7+ 이전 model에서는 이 메뉴가 존재하지 않을 수 있으니 무시하십시오.)
– Sub-menu 중 “Power Mode Setup” 바로 아래에 있는 “Idle Power Saver”를 이어서 선택합니다.
– 이어서 나타나는 오른쪽 window에서, “Idle Power Saver Enable”의 값을 disable로 선택합니다.
– 기타 항목들이나, 왼쪽 window의 ““Idle Power Saver” 밑의 “Tuning Parameters”는 모두 무시해도 됩니다. (Power
Saver mode를 enable할 때 사용되는 parameter들이므로, 여기서는 무관합니다.)
Low latency에는
이것을 선택 !
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – SMT Disable
 SMT disable
– 증권사 FEP 등과 같이 thread 수가 많지 않고 CPU 부하가 높지 않은 서버에서는 SMT를 disable하는
것이 성능상 더 유리한 경우가 있습니다.
– SMT의 disable은 다음 명령으로 수행합니다.
– 이 명령은 reboot 후에는 효력을 상실하므로, AIX의 /etc/inittab에 해당하는
/etc/rc.d/rc3.d/S99local에 아래와 같이 입력해두어야 합니다.
[root@PowerLinux2 ~]# ppc64_cpu --cores-on
Number of cores online = 4
[root@PowerLinux2 ~]# ppc64_cpu --smt
SMT is on
[root@PowerLinux2 ~]# ppc64_cpu --smt=off
[root@PowerLinux2 ~]# ppc64_cpu --smt
SMT is off
[root@PowerLinux2 ~]# vi /etc/rc.d/rc3.d/S99local
…
touch /var/lock/subsys/local
/usr/sbin/ppc64_cpu --smt=off
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Stop Unnecessary Services
 Stop unnecessary services
– auditd, dovecot 등과 같이 불필요한 서비스를 모두 중단합니다.
[root@PowerLinux2 ~]# /sbin/chkconfig
auditd
0:off
1:off
2:on
crond
0:off
1:off
2:on
ip6tables
0:off
1:off
2:on
iprdump
0:off
1:off
2:on
iprinit
0:off
1:off
2:on
iprupdate
0:off
1:off
2:on
iptables
0:off
1:off
2:on
lvm2-monitor
0:off
1:on
2:on
multipathd
0:off
1:off
2:on
netconsole
0:off
1:off
2:off
netfs
0:off
1:off
2:off
network
0:off
1:off
2:on
postfix
0:off
1:off
2:on
rdisc
0:off
1:off
2:off
restorecond
0:off
1:off
2:off
rhnsd
0:off
1:off
2:on
rhsmcertd
0:off
1:off
2:off
rsyslog
0:off
1:off
2:on
rtas_errd
0:off
1:off
2:on
saslauthd
0:off
1:off
2:off
sshd
0:off
1:off
2:on
udev-post
0:off
1:on
2:on
..
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:off
4:off
5:off
3:on
4:on
5:on
3:on
4:on
5:on
3:on
4:on
5:on
3:off[root@PowerLinux2
4:off
5:off
3:off[root@PowerLinux2
4:off
5:off
3:on [root@PowerLinux2
4:on
5:on
3:on
4:on
5:on
[root@PowerLinux2
3:on
4:on
5:on
[root@PowerLinux2
3:on
4:off
5:on
3:off[root@PowerLinux2
4:off
5:off
3:on [root@PowerLinux2
4:on
5:on
3:on [root@PowerLinux2
4:on
5:on
[root@PowerLinux2
[root@PowerLinux2
[root@PowerLinux2
[root@PowerLinux2
[root@PowerLinux2
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]# /sbin/chkconfig
6:off
~]#
~]#
~]#
~]#
~]#
/sbin/chkconfig
/sbin/chkconfig
/sbin/chkconfig
/sbin/chkconfig
/sbin/chkconfig
--level
--level
--level
--level
--level
--level
--level
--level
--level
--level
--level
--level
--level
3
3
3
3
3
3
3
3
3
3
3
3
3
auditd off
ip6tables off
iprdump off
iprinit off
iprupdate off
iptables off
lvm2-monitor off
netfs off
postfix off
rhnsd off
rhsmcertd off
rtas_errd off
rsyslog off
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Compiler Option
 Compiler option
– PowerLinux에는 advance-toolchain이라는 gcc 4.7.3 + library들이 설치되어 있습니다.
– RHEL 6.3의 기본 gcc인 4.4를 이것으로 replace하여 soft-link를 걸어 놓았습니다.
– 이것을 사용하시면 더 좋은 성능을 얻을 수 있고, 사용법은 동일합니다.
[root@localhost ~]# ls -l /usr/bin/gcc
lrwxrwxrwx. 1 root root 18 Jun 11 16:02 /usr/bin/gcc -> /opt/at6.0/bin/gcc
[root@localhost ~]# rpm -qa | grep advance
advance-toolchain-at6.0-runtime-6.0-4.ppc64
advance-toolchain-at6.0-devel-6.0-4.ppc64
[root@localhost seed]# /usr/bin/gcc4.4 -O3 -lpthread -lm -o seed seed.c
seed.c: In function ‘
main’:
seed.c:299: warning: cast to pointer from integer of different size
[root@localhost seed]# ./seed
cpu:0 size:1400 enc:5(msec), dec:4(msec), throughput:40000Kpps 448Mbps, 25us
cpu:1 size:1400 enc:5(msec), dec:4(msec), throughput:40000Kpps 448Mbps, 25us
[root@localhost seed]# /usr/bin/gcc -O3 -lpthread -lm -o seed seed.c
seed.c: In function ‘
main’:
seed.c:299:54: warning: cast to pointer from integer of different size
[root@localhost seed]# ./seed
cpu:1 size:1400 enc:3(msec), dec:4(msec), throughput:66666Kpps 746Mbps, 15us
cpu:0 size:1400 enc:3(msec), dec:4(msec), throughput:66666Kpps 746Mbps, 15us
암호화
seed.c
성능 테스트
기존 gcc 4.4
AT gcc 4.7.3
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – Compiler Option
 IBM Advance Toolchain의 추가적인 compiler option
– AdvanceToolchain에서 제공되는 몇 가지 추가 option을 넣으면 더 나은 성능을 내는 경우도 있습니다.
– 그러나 항상 +효과를 내는 것은 아니며, 업무 성격에 따라 –효과를 내는 경우도 자주 있습니다.
– 많은 경우에, -O3만 넣는 것이 가장 좋은 효과를 내기도 합니다.
gcc -O3 -flto -mcpu=power7 -mtune=power7 -ltcmalloc -mno-vsx
link time optimization을 해주는 option
“Preserve compile-time information
within object files to permit further
inter-compilation-unit optimizations at
link time.”
Thread-caching 성능에 최적화된 malloc
library를 사용하도록 하게 해주는 option
“Thread-Caching Malloc library, a fast,
low-overhead, low-contention memory
allocation/deallocation library”
power7에 최적화된 code를 만드는 option
power7의 VSX option을 안 쓰도록 하는 option
© 2013 IBM Corporation
IBM Power Systems
4. Power Linux Tuning – sysctl Tuning
 일반적인 sysctl tuning
– 일반적으로 권고되는 sysctl tuning 값입니다.
– Reboot 이후에도 같은 효과를 유지하기 위해서는 /etc/sysctl.conf에 해당 값들을 등록하면 됩니다.
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
/sbin/sysctl
vm.min_free_kbytes="65536"
vm.swappiness="30"
vm.dirty_ratio="50"
net.core.netdev_max_backlog="250000"
net.core.optmem_max="524287"
net.ipv4.igmp_max_memberships="30"
net.ipv4.tcp_no_metrics_save="1"
net.ipv4.tcp_reordering="9"
net.ipv4.tcp_timestamps="0"
net.ipv4.tcp_window_scaling="1"
net.ipv4.tcp_adv_win_scale="1"
net.ipv4.tcp_sack="0"
net.ipv4.tcp_low_latency="1"
net.ipv4.tcp_moderate_rcvbuf="1"
net.core.wmem_default="65536"
net.core.rmem_max="16777216"
net.core.wmem_max="16777216"
net.ipv4.tcp_rmem="8192 8388608 16777216"
net.ipv4.tcp_wmem="4096 8388608 16777216"
net.ipv4.tcp_mem="8388608 8388608 8388608"
net.ipv4.route.flush="1"
net.ipv4.udp_wmem_min="4096"
net.ipv4.udp_rmem_min="8192"
net.ipv4.udp_mem="2322816 3097088 4645632"
© 2013 IBM Corporation
IBM Power Systems
© 2013 IBM Corporation