블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글

Service management details

svcs(1) command

System administrators can more easily monitor services using Solaris Service Manager’s service status information and service activation/deactivation interfaces based on the commands (svcs(1), svcadm(1) etc). Until Solaris 9, it was a complicated procedure to understand service status. Service level information was not provided and system administrators have to assume service status from their own analysis of kernel level information. A slow and error prone process.

svcadm(1M) command

Services and the services on which they depend are started in their appropriate order using the Solaris Service Manager svcadm(1) command. System administrators are longer required to run complicated service startup operations.

For example, if there are two services, Service A and Service B, and Service A depends on Service B, previously the system administrator needed to start the services paying close attention to their dependent relationship. Now with Solaris10, they only have to start Service A. Solaris Service Manager automatically detects that Service B needs to be started, and starts the services in the right sequence.

사용자 삽입 이미지

With Solaris 10 the traditional service stop procedure using the kill(1) or pkill(1) commands is no longer available. This is because, once stopped, Solaris Service Manager will automatically restart them. So a new command, svcadm (1M) is now used for stopping services.

References
 Solaris 9 or earlier versionsSolaris 10
Service statusps(1) command 
(only process information is shown)
svcs(1) or ps(1) command
Service stop# /etc/init.d/cron stop# svcadm disable -t 
system/cron:default
Service restart (temporary)# /etc/init.d cron start# svcadm enable -t 
system/cron:default
Service stop 
After service restart the service isn't started
(1)# /etc/init.d/cron stop 
(2)# mv /etc/rc2.d/S75cron /etc/rc2.d/_S75cron 
(Need to rename the service start script)
# svcadm disable -t 
system/cron:default
Service restart (permanent)(1) # /etc/init.d/cron stop 
(2) # /etc/init.d/cron start
# svcadm restart -t 
system/cron:default


- Solaris 10 간단한 재실행
# svcs cron
STATE          STIME    FMRI
online          4월_26  svc:/system/cron:default
svcadm restart cron
#
# svcs cron
STATE          STIME    FMRI
online         11:26:41 svc:/system/cron:default

Posted by redkite
, |

sendmail은 목적지를 확인하지 못한 메일을 clientmqueue에 임시로 저장했다가 목적지가 확인되면 mqueue로 보내서 메일을 발송하는 거라고 한다. 그런데 sendmail을 사용하지 않는 시스템에서 이러한 일이 발생하는 것은 logwatch에서 주요로그보고서를 메일로 발송하는 것 때문에 이러한 문제가 발생한다고 한다.

 

logwatch의 메일발송기능을 없애려면 /etc/contab의 내용에서 MAILTO=root의 내용에서 root로 지정된것을 뺴주면 된다고 한다.

 

엄청나게 많은 파일이 생긴 clientmqueue디렉토리는 한번에 지우기가 어려운데 아래의 명령으로 한번에 지울수 있다고 한다.

해당 디렉터리로 이동 후 아래 명령을 실행한다.
ls | xargs rm -f

 

아니면, 아예 폴더 자체를 날려버리고 새로 만들어도 상관 없다.

rm -rf /var/spool/clientmqueue

mkdir /var/spool/clientmqueue

chown smmsp.smmsp /var/spool/clientmqueue

 

주기적으로 지워지게 crontab에 삭제 명령어를 등록할 수도 있따.

$ crontab -e
30 0 * * * /usr/bin/find /var/spool/clientmqueue -mtime +30 | xargs rm -f 

Posted by redkite
, |

0022. [AIX] 시스템 정보 확인

[AIX] 명령어 모음

1. 제조사
- 회사명 = lsattr -El sys0
- 모델명 = prtconf (하드웨어config)
2. OS version
- 버전 = oslevel -r
3. CPU
- Arch = prtconf
- Hz = lsattr -El proc0 (단위 Hz)
- 개수 = lsdev -Cc processor|wc -l

4. Memory
- 용량 = lsattr -El sys0, prtconf
5. Virtual Memory
- 용량 = lsps -a
6. Internal Disk
- size = bootinfo -s hdisk(숫자) (Mb단위)
- 개수 = lsdev -Cc disk
7. External Disk (SSA)
- size = bootinfo -s hdisk(숫자) (Mb단위)
- 개수 = lsdev -Cc pdisk , lsdev -Ct hdisk
8. rootvg mirror(y/n)
- not mirror = lsvg rootvg (ACTIVE PVs = 1)
- mirror = lsvg rootvg (ACTIVE PVs = 2)
9. NIC
- 속도, 개수 = lsparent -Ck ent
10. 시스템에 장착된 부품들에 위치확인
- lscfg -vp
* 일반적 정보
prtconf = list system configuration
lscfg [-v] = devices (-v = verbose for microcode levels, etc)
lscfg -v = devices verbose (microcode level, firmware, etc)
lsdev -Cc adapter = adapter cards
lsdev -Cc disk = disks
lsdev -Cc processor = CPU s
lsattr -El sys0 = serial number, model number, memory
* AIX 관련 정보
oslevel = AIX OS level
instfix -i |grep ML = AIX maintenance level
lslpp -l = installed SW and levels
* Disk 관련 정보
lsvg -o = active volume groups
lsvg -p vgname = disk drives in VG
lsvg -l vgname = LV s in VG
lslv lvname = LV detail
lslv -l lvname = LV disk location
lspv = disks
lspv -l hdisk# = LV s residing on a disk

* Network 관련 정보
lsdev -Cc if = List network interfaces
netstat -rn = List network gateways
* lsdev -C 명령으로 해당 장치명을 알아낸후

lsattr -El 해당장치명 <enter>하시면 해당장치의 상세 정보를 알수 있습니다.
(예) lsattr -El mem0 이런식으로요.....
AIX에서는 CPU속도를 알려주는 명령이 없습니다. 그래서 명령외 다른 방법을 사용해야 합니다.
우선, uname 명령을 실행하면 다음 형태의 결과를 볼 수 있습니다.

#uname -m
xxyyyyyymmss

각 부분의 의미는 다음과 같습니다.
xx = 00
yyyyyy = 유일한 CPU ID
mm = Model ID <- CPU속도를 결정
ss = 00 (Submodel)

"uname -m"에서 나온 "mm"값을 가지고 찾는거죠...
시스템 기기정보
#prtconf
시스템 모델: IBM,9119-590
기계 일련 번호: 5115E9C
프로세서 유형: PowerPC_POWER5
프로세서 수: 4
프로세서 시계 속도: 1656 MHz
CPU 유형: 64-bit
커널 유형: 64-bit
LPAR 정보: 2 15E9C-lpar1
메모리 크기: 16384 MB
양호한 메모리 크기: 16384 MB
플랫폼 펌웨어 레벨: 사용할 수 없음
펌웨어 버전: IBM,SF225_095
콘솔 로그인: enable
자동 재시작: true
전체 코어: false
[AIX]자주쓰는 명령어들
****************** IBM bundles install. ****************************
#vi /usr/sys/inst.data/user_bundles/MyBundle.bnd
I:sysmgt.websm.security. // write the file which you want to install.
#smitty easy_install
// select Mybundle which you've made and Enter.
lslpp -Lb Mybundle // verify whethere bundle was installed successfully.
smitty list_installed // verify what is installed in server.
******************** AIX 용량 확장하기 ******************************
lsvg rootvg
chfs -a size=+100M /
******************** AIX 네트워크 설정하기 **************************
smit chgenet
smitty mktcpip -> N/W interface 선택
******************** 파일셋 및 fix(AIX) 설치 여부 확인 **************
lslpp -l bos.adt.base // 파일 셋 인스톨 여부 체크
instfix -i -k "IY4390" // fix 설치 여부 체크

******************** AIX 데몬 재시작 ********************************
refresh -s inetd
startsrc -g inetd
IBM filesets 설치

#oslevel -r // OS 레벨 확인
#instfix -i|grep ML // 파일셋 버전별 설치 현황
#instfix -icqk 5300-02_AIX_ML|grep :-: // 업데이트가 필요한 filesets
download site.
www.ibm.com/servers/eserver/support/pseries/aixfixes.html
***************************** cd mount ************************************
#mount -vcdrfs -oro /dev/cd0 /mnt
#geninstall -d/dev/cd0 bos.alt_disk_install.rte // install fileset in cd.
lspv // see hard-drive information.
#bootlist -m normal hdisk1 hdisk13 // select which disk you want to boot
# bootlist -m normal -o // see which disk is on.
hdisk13

▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷
★★★ 명령어 ★★★
▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷▷
# lslpp -l | grep nim : 설치된 파일셋보기
# osrevel -r : o/s 버전보기.ml 포함
# lsconf | more : 서버 사양보기 (prtconf 와 동일)
# instfix -i | grep ML : O/S ML 정보 보기(All filesets for 5.3.0.0_AIX_ML were found.)
# export TERM=vt100 : display 의 화면모드 전환, smitty 시 F1,F2.. 키를 먹도록 한다.
# smit service_software : 서버에 설치된 파일셋보기
# smit compare_report : 서버에 부족한 파일셋 설치하기
# instfix -k IY58143 -d /dev/cd0 : cd에 들어있는 IY58143 을 찾아 설치한다.
# instfix -ik IY58143 : i 는 infomation 으로 설치는 하지않고, 정보를 본다
# bootinfo -y : h/w 적으로 64bit 가 지원되는지 확인
# bootinfo -K : o/s kernel 이 몇 bit 인지 확인
# alog -ot boot | more : booting 될때 에러가 있는지 로그점검 (smit alog 도 가능)
# lscft | grep ent : lan 카드 확인명령어
# stopsrc -s qdaemon / startsrc -s qdaemon : 데몬 내리고 올리기
# smit mlang : 언어선택하기
# ls -l /dev : 외부장치 디렉토리의 리스트확인
# lsdev -C -H : 설치된 장치리스트 보기
# lsattr -El fcs0 : 장치에 대한 설정정보 보기
# chvg -t2 rootvg : rootvg 를 t2로 바꾸어준다. max pp 갯수가 1016 -> 2032 로 증가
# lspv -p hdisk0 : pv의 lv 정보를 확인
# lsvg -l rootvg : vg 에 있는 lv의 정보를 확인
# lqueryvg -Atp hdisk0 : vgda(volum group discripter)를 보는데 vgda를 odm이 아닌 실제 disk에서 가져옴
# more /etc/filesystems : df 했을때 보여지는 filesystem 정보와 동일하다
# lscfg -vl fcs0 : fcs0의 상세정보 보기
# lsvg -p rootvg : 물리적으로 볼륨구성보기
# chvg -g volumegroup : 볼륨그룹을 재정리 해준다
# migratepv -l hdisk0 hdisk6 : hdisk0 의 모든데이터를 디스크단위로 hdisk6 로 이동한다.
# migratepv -l lv02 hdisk0 hdisk6 : hdisk0의 lv02를 hdisk6 에 이동(move)한다.
# chfs -a size =+500M /home : 파일시스템의 용량을 500M 추가한다
# chfs -a size = 1G /home : 파일시스템의 용량을 기존용량+추가용량 1GB로 증가시킨다
# df -k / df -m / df -g : 각 단위별로 파일시스템 보기
# du ./ | sort -r -n : 현재 디렉토리 아래에서 큰파일순으로 정렬한다
# # lslpp -L | pg : 설치된 모든 프로그램 보기.
www.redbooks.ibm.com 전세계 엔지니어들의 장애처리 경험
www.aixservice.net ibm 실장님이 운영하며 신규기술이 많음.
naver cafe 에 빠른 처리가잘되는 aix 카페
www.ibm.com/kr/education
# smitty tcpip 네트워크에 대한 설정을 해줄 수 있다
# startsrc -g tcpip, stopsrc -g tcpip //
#importvg -y testvg hdisk1 하드디스크 마운트하기.

# /usr/spool/cron/crontabs : 사용자별 클론 설정 위치
# /var/adm/cron/cron.deny, allow : 사용자별 클론 접근허용 및 거부 설정.
# lsps -a : 페이징 스페이스 정보 보기.
# fsck -y /dev/hd1 : 파일 시스템 체크
# mkuser user_name : 유저 생성.
# mkgroup group_name
# passwd user_name : 암호 설정.
# rmuser -p user_name : 유저 삭제.
# rmgroup group_name
# who /var/adm/wtmp or /var/adm/utmp : 사용자 접속 확인.
# who /etc/security/failedlogin : 접속 실패 확인.
# more /var/adm/sulog : su를 사용한 사용자 확인.
# last root, last reboot
# varyonvg vg_name : vg 활성화
# varyoffvg vg_name : vg 비활성화
# exportvg vg_name : vg 반출
# savevg vg_name : vg 백업
# extendvg pv_name : pv 확장
# reducevg pv_name : pv 삭제
# lsvg -l rootvg : vg에 대한 lv(Logical Volume) 확인
# mklvcopy lv_name hdisk_name

************ System Backup ***************************
# mkszfile
# cp /var/adm/ras/bosinst.data /root/
# mksysb /dev/rmt0
# tctl -f /dev/rmt0 rewind
# tctl -f /dev/rmt0.1 fsf 3
# restore -xqvf /dev/rmt0.1 /tmp/myfile
# backup -if /dev/rmt0 large_file
# mkdev -l rmt0 : 장치 상태 보기, 삭제
# rmdev -l rmt0

# smitty dev : serial 연결, Tape 특성, Device 설치

# errpt : 에러 보기(/var/adm/ras/errlog)
# errclear : 로그 삭제
# /usr/lib/errdemon : 에러로그 시작
# /usr/lib/errstop : 에러로그 중지
************** VG 미러링 ****************************
# mklv -y hd7 -t dump rootvg PP갯수 hdisk_name : dump device 생성
# snap -ac : dump file 생성

hdisk0 : rootvg hdisk1 : mirror
# extendvg rootvg hdisk1
# chvg -Qn rootvg
# mklvcopy hd1 2 hdisk1 : 미러링
# mklvcopy hd2 2 hdisk1
# mklvcopy hd3 2 hdisk1
# mklvcopy hd4 2 hdisk1
# mklvcopy hd5 2 hdisk1
# mklvcopy hd6 2 hdisk1
# mklvcopy hd7 2 hdisk1
# mklvcopy hd8 2 hdisk1
# mklvcopy hd9var 2 hdisk1
# syncvg -v rootvg : 새로생성한 미러 디스크를 sync 시킨다.
# bosboot -a -d /dev/hdisk1 : 부트 레코드및 장치 초기화.
# boolist -m normal hdisk0 hdisk1 : 부트 리스트를 초기화.
# shutdown -Fr
# lsvg -l rootvg : 확인

일단은 jdk1.4가 설치가 되었는지 확인하는 방법은
lslpp -L | grep Java14
그리고 jdk가 설치되는 위치는 버전별로 아래와 같습니다.
-------------------------------------------------------
- Java 1.4.x 32-bit /usr/java14
- Java 1.4.x 64-bit /usr/java14_64
- Java 1.3.1 32-bit /usr/java131
- Java 1.3.1 64-bit /usr/java13_64
- Java 1.3.0 /usr/java130
- Java 1.2.2 /usr/java_dev2
- Java 1.1.8 /usr/jdk_base
진단툴
/usr/lpp/diagnostics/bin/diagrpt

nmon # to see status of cpu and memory.
[AIX]Smitty jfs(저널 파일시스템)
특정 Volume Group 에 File System 만들기 [To make File system on AIX 5.3]
1. root 로 로그인한다.
[YOU HAVE NEW MAIL]
root@DMS:/ >
2. lspv 를 눌러 현재 Volume Group List 를 확인한다.
root@DMS:/ >lspv
hdisk0 00ceb31adae0d192 rootvg active
hdisk1 00ceb31ad4679f47 oraclevg active
3. 첫번째 디스크의 Volume Group 을 확인한다. (디스크 장애시 image 를 떠야하므로 free 영역을 그대로 두는게 좋다)
root@DMS:/ >lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00ceb31a00004c0000000107dae0d65d
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 546 (69888 megabytes)
MAX LVs: 256 FREE PPs: 349 (44672 megabytes)
LVs: 12 USED PPs: 197 (25216 megabytes)
OPEN LVs: 11 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
4. 두번째 디스크의 Volume Group 을 확인한다. (54 GIGA 정도가 Free 상태로, File system 을 잡을 수 있음)
root@DMS:/ >lsvg oraclevg
VOLUME GROUP: oraclevg VG IDENTIFIER: 00ceb31a00004c0000000107dc4107fc
VG STATE: active PP SIZE: 128 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 546 (69888 megabytes)
MAX LVs: 256 FREE PPs: 425 (54400 megabytes)
LVs: 2 USED PPs: 121 (15488 megabytes)
OPEN LVs: 2 QUORUM: 2
TOTAL PVs: 1 VG DESCRIPTORS: 2
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 1 AUTO ON: yes
MAX PPs per VG: 32512
MAX PPs per PV: 1016 MAX PVs: 32
LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable
5. 해당 Volume Group 이 어떠한 Type 으로 설정되어 있는지 확인한다. (jfs2 로 설정되어 있음)
root@DMS:/ >lsvg -l oraclevg
oraclevg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
oraclelv jfs2 120 120 1 open/syncd /oracle
loglv00 jfs2log 1 1 1 open/syncd N/A
6. smitty 를 이용하여 jfs2 파일 시스템을 만든다.
root@DMS:/ >smitty jfs2
6.1. 아래와 같은 화면이 나오면 첫번째 행을 선택한다.
Move cursor to desired item and press Enter.
Add an Enhanced Journaled File System
Add an Enhanced Journaled File System on a Previously Defined Logical Volume
Change / Show Characteristics of an Enhanced Journaled File System
Remove an Enhanced Journaled File System
Manage Quotas for an Enhanced Journaled File System
Defragment an Enhanced Journaled File System
List Snapshots for an Enhanced Journaled File System
Create Snapshot for an Enhanced Journaled File System
Mount Snapshot for an Enhanced Journaled File System
Remove Snapshot for an Enhanced Journaled File System
Unmount Snapshot for an Enhanced Journaled File System
Change Snapshot for an Enhanced Journaled File System
Rollback an Enhanced Journaled File System to a Snapshot
6.2. Unit Size 는 Free PPs 로 잡혀있는 단위와 같은 Megabytes 로 선택한다. (Tab 을 이용)
6.3. Number of units 는 Free PPs 에 잡혀있는 54400 과 같거나 작은 값을 입력한다.
6.4. MOUNT POINT 는 Mount 하고자 하는 폴더명을 /oracledata 와 같은 형식으로 입력한다.
6.5. Mount AUTOMATICALLY at system restart 는 Tab 을 이용하여 yes 로 변경한다.
6.6. Enter 를 눌러 작업을 종료한다.
Add an Enhanced Journaled File System
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Volume group name oraclevg
SIZE of file system
Unit Size Megabytes +
* Number of units [] #
* MOUNT POINT []
Mount AUTOMATICALLY at system restart? no +
PERMISSIONS read/write +
Mount OPTIONS [] +
Block Size (bytes) 4096 +
Logical Volume for Log +
Inline Log size (MBytes) [] #
Extended Attribute Format Version 1 +
ENABLE Quota Management? no +
7. mount all 을 눌러 모든 폴더를 mount 시킨다.
root@DMS:/ >mount all
mount: 0506-324 Cannot mount /dev/hd1 on /home: The requested resource is busy.
mount: 0506-324 Cannot mount /proc on /proc: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/hd10opt on /opt: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/cd0 on /cdrom: The device is not ready for operation.
mount: 0506-324 Cannot mount /dev/fslv00 on /imsi: The requested resource is busy.
mount: 0506-324 Cannot mount /dev/oraclelv on /oracle: The requested resource is busy.
8. df -k 를 눌러 제대로 잡혔는지 확인한다.
root@DMS:/ >df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 262144 243224 8% 2202 4% /
/dev/hd2 1966080 162960 92% 39089 49% /usr
/dev/hd9var 131072 122260 7% 390 2% /var
/dev/hd3 524288 522932 1% 56 1% /tmp
/dev/fwdump 393216 392828 1% 4 1% /var/adm/ras/platform
/dev/hd1 131072 130680 1% 11 1% /home
/proc - - - - - /proc
/dev/hd10opt 131072 3868 98% 3823 77% /opt
/dev/fslv00 4194304 2520496 40% 49 1% /imsi
/dev/oraclelv 15728640 679500 96% 20075 12% /oracle
/dev/fslv01 55705600 55696768 1% 4 1% /oracledata

Posted by redkite
, |

0070. [솔라리스] 디스크 미러링

RAID Information

The Sun Fire V215 and V245 servers support RAID 0 and RAID 1 configurations. You should use the Solaris OS raidctl(1M) command to configure the volumes.

With Solaris 10 8/07 OS release, the raidctl(1M) command has been updated. The usage of the command has changed dramatically. Two potential areas of concern are:

  • The previous version of the command required entering only raidctl to get volume and disk status. The command now requires the -l option and the volume-name argument. The change was prompted by the concern here a disk or volume in a nonoptimal or failed state might go unnoticed.
  • There are options and features listed that are not supported on many platforms (for example, hot-spares) that might cause you to think they are available.

Before you use the command, read the updated raidctl(1M) man page.

For more information about RAID, the use of the raidctl(1M) command, and managing volumes, refer to the following resources:

  • BigAdmin site: http://www.sun.com/bigadmin/home/

There are numerous articles on RAID that can be found by searching on RAID.

  • Sun BluePrints site: http://www.sun.com/blueprints/
  • Solaris Volume Manager Administration Guide (819-2789), which can be found at the following site:

http://docs.sun.com/

  • raidctl(1M) man page, which can be found in the Solaris 10 Reference Manual Collection at:

http://docs.sun.com/

  • VERITAS Volume Manager Administration Guide, Solaris (875-3529-10), which can be found at:

http://www.sun.com/products-n-solutions/hardware/docs/

 

Caution - If you remove the system board, you must run service-only OpenBoot PROM commands to recover the volumes. Contact your service representative for more information about these commands.

 

Note - The raidctl(1M) command does not support non-hot-pluggable devices. To service non-hot-pluggable components, you must shut down the server.

 

RAID Technology

There are several levels of RAID configurations that provide varying degrees of data availability with corresponding trade-offs in performance and cost. This section describes the RAID configurations that are supported on the Sun Fire V215 and V245 servers.

RAID 0 - Disk Striping

Disk striping (RAID 0) is a technique for increasing system throughput by using several disk drives in parallel. In nonstriped disks the operating system writes a single block to a single disk. In a striped arrangement, each block is divided and portions of the data are written to different disks simultaneously. No data is shared. Data is written across all disks (concatenated) in exactly one location. Write operations are committed in a round-robin fashion across all member disks, so performance is increased in some workload scenarios. Read operations are satisfied at one location (performs as a single disk).

When you create a RAID volume, all data contained on the drive is lost. If a single disk fails, data is lost. If a RAID 0 volume is disabled (broken), data is lost.

System performance using RAID 0 will be better than using RAID 1, but the possibility of data loss is greater because there is no way to retrieve or reconstruct data stored on a failed disk drive.

RAID 1 - Disk Mirroring

Disk mirroring (RAID 1) is a technique that uses data redundancy (two complete copies of all data stored on two separate disks) to protect against loss of data due to disk failure. One logical volume is duplicated on two separate disks (primary and secondary configuration). You can configure hardware disk mirroring using the SAS controller. This configuration provides higher performance than conventional software mirroring using volume management software. If you mirror the boot drive, you must create the RAID volume before you install the operating system.

Whenever the operating system needs to write to a mirrored volume, both disks are updated. The disks are maintained at all times with exactly the same information. When the operating system needs to read from the mirrored volume, the operating system reads from whichever disk is more readily accessible at the moment, which can result in enhanced performance for read operations.

If a single disk fails, the data is still available, but the volume will be in the degraded mode. You can replace and resynchronize the failed disk. If the volume is disabled (that is, the mirror is broken), you must relabel the drives, which causes all of the data to be lost.

On the Sun Fire V215 and V245 servers, the SAS controller supports internal hardware disk mirroring using the Solaris OS raidctl utility. A hardware disk mirror created under the raidctl utility behaves slightly differently than a disk mirror created using volume management software. Under a software mirror, each device has its own entry in the virtual device tree, and read-write operations are performed to both virtual devices. Under hardware disk mirroring, only one device (the master) appears in the device tree. The mirrored device (the slave) is invisible to the OS and is accessed only by the SAS controller.

 

Caution - Creating or restoring a disk mirror destroys all data previously stored on the disk drive.

 

RAID Volume and Drive Status

After you create a RAID volume or during the normal operation of the system, the volume can have one of the following status conditions:

  • OK - The volume is optimal.
  • DEGRADED - The volume has a failed drive (mirror) or is otherwise functionally minimized.
  • RESYNCING - The volume is synchronizing (mirror).
  • FAILED - The volume is offline.

At any time during the normal operation of the system, any one or more of the drives can have one of the following status conditions:

  • OK - Disk is operating normally.
  • MISSING - Disk is removed or otherwise offline.
  • FAILED - Disk is in a failed state and needs service.

Physical Disk Slot Numbers, Physical Device Names, and Logical Device Names

To perform a RAID procedure, you must know the physical or logical device name for the drive that you want to use. You can use TABLE 2-1 to associate internal disk slot numbers with the logical and physical device names for each hard disk drive.

1. Verify that a hardware disk path:

 

# iostat -nE

c0t1d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

Vendor: SEAGATE Product: ST914602SSUN146G Revision: 0603 Serial No: 081795NJZE

Size: 146.56GB <146561286144 bytes>

Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0

Illegal Request: 0 Predictive Failure Analysis: 0

c0t0d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0

Vendor: SEAGATE Product: ST914602SSUN146G Revision: 0603 Serial No: 081995W462

Size: 146.56GB <146561286144 bytes>

Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0

Illegal Request: 0 Predictive Failure Analysis: 0

 

The example indicates that no RAID volume exists. The logical device names might appear differently on your system, depending on the number and type of add-on disk controllers installed.

TABLE 2-1 Disk Slot Numbers, Logical Device Names, and Physical Device Names

Disk Slot Number

Logical Device Name[1]

Physical Device Name

Slot 0

c0t0d0

/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@0,0

Slot 1

c0t1d0

/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@1,0

Slot 2

c0t2d0

/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@2,0

Slot 3

c0t3d0

/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@3,0

 

RAID Operations With the Solaris OS Commands

This section contains instructions on how to create RAID volumes using the Solaris OS commands.

Creating a Disk Stripe With the Solaris OS Commands

When you create a disk stripe on two or more drives, the data on all of the drives will be lost. In addition, no file systems can be mounted on any of these drives.

The RAID volume has the ability to use the capacity of all the disks that are combined. However, the smallest common size is used.

 

To Create a Disk Stripe With the Solaris OS Commands

1. Verify that a hardware disk stripe does not already exist by typing:

 

# raidctl -l

No RAID volumes found.

 

The example indicates that no RAID volume exists. The logical device names might appear differently on your system, depending on the number and type of add-on disk controllers installed.

2. Type the following command:

 

# raidctl -c -r 0 disk1disk2 [disk3]

 

For example:

 

# raidctl -c -r 0 c0t1d0 c0t2d0 c0t3d0

 

The RAID volume c0t1d0 is created.

Before you can use the volume, you must label it in the Solaris OS by using the format(1M) command. For instructions on labeling the volume, see Labeling a Volume.

Creating a Disk Mirror With the Solaris OS Commands

When you create a disk mirror, all of the data on all of the drives is lost. The RAID volume will have the capacity of one drive. No file systems can be mounted on either drive. The secondary drive must be as large as the primary drive.

 

To Create a Disk Mirror With the Solaris OS Commands

1. Verify that a hardware disk mirror does not already exist by typing:

 

# raidctl -l

No RAID volumes found.

 

The example indicates that no RAID volume exists. The logical device names might appear differently on your system, depending on the number and type of add-on disk controllers installed.

2. Type the following command:

 

# raidctl -c master slave

 

For example:

 

# raidctl -c c0t0d0 c0t1d0

 

RAID volume c0t0d0 is created. When you create a RAID mirror, the slave drive (in this case, c0t1d0) disappears from the Solaris OS device tree.

3. To check the status of a RAID mirror, type the following command:

 

# raidctl -l

RAID RAID RAID Disk

Volume Status Disk Status

--------------------------------------------------------

c0t0d0 RESYNCING c0t0d0 OK

c0t1d0 OK

 

The example indicates that the RAID mirror is still resynchronizing with the backup drive.

The following example shows that the RAID mirror is completely restored and online.

 

# raidctl -l

RAID RAID RAID Disk

Volume Status Disk Status

------------------------------------

c0t0d0 OK c0t0d0 OK

c0t1d0 OK

 

Under RAID 1 (disk mirroring), all data is duplicated on both drives. If a drive fails, replace that drive with a working drive and restore the mirror.

For more information about the raidctl utility, see the raidctl(1M) man page.

Before you can use the volume, you must label it in the Solaris OS by using the format(1M) command. For instructions on labeling the volume, see Labeling a Volume.

Deleting a Disk Mirror With the Solaris OS Commands

Before you perform the procedure in this section, verify which disk drive corresponds with which logical device name and physical device name. For more information, see Physical Disk Slot Numbers, Physical Device Names, and Logical Device Names.

 

To Delete a Disk Mirror With the Solaris OS Commands

1. Determine the name of the mirrored volume:

 

# raidctl -l

RAID RAID RAID Disk

Volume Status Disk Status

------------------------------------

c0t0d0 OK c0t0d0 OK

c0t1d0 OK

 

In this example, the mirrored volume is c0t0d0.

 

Note - The logical device names might appear differently on your system, depending on the number and type of add-on disk controllers installed.

 

2. To delete the volume, type the following command:

 

# raidctl -d mirrored-volume

 

For example:

 

# raidctl -d c0t0d0

RAID Volume 'c0t0d0' deleted

 

3. To confirm that you have deleted the RAID array, type the following command:

 

# raidctl -l

No RAID volumes found

 

For more information, see the raidctl(1M) man page.

After you delete the volume, you must relabel the drive in the Solaris OS by using the format(1M) command.

Updating the RAID Controller Firmware

The RAID controller firmware is part of the OpenBoot PROM software patch. If you need to update the firmware for the RAID controller, download and install the latest OpenBoot PROM software patch.

RAID Operations With the OpenBoot PROM Commands

If you have existing RAID volumes and have to replace a component, such as the system board, you must perform the procedure in this section so that the Solaris OS can see the volume.

 

Caution - The OpenBoot command, activate-volumes, should be run only by a qualified service representative.

 

In the following procedure, the show-disks command is used to determine the controller path. You can also use the probe-scsi-all command to find the path.

 

To Recover a RAID Volume

1. Set the auto-boot? variable to false.

 

ok setenv auto-boot? false

auto-boot? = false

 

2. Set the fcode-debug? variable to true.

 

ok setenv fcode-debug? true

fcode-debug? = true

 

3. Reset the system.

 

ok reset-all

 

4. Type the show-disks command to determine the path of the controller.

 

ok show-disks

a) /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk

b) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/cdrom

c) /pci@1e,600000/pci@0/pci@1/pci@0/ide@1f/disk

q) NO SELECTION

 

5. Enter the appropriate selection, type Control-Y to insert the path into the command line, then press Enter.

 

Enter Selection, q to quit: a

/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk has been selected.

Type ^Y ( Control-Y ) to insert it in the command line.

e.g. ok nvalias mydev ^Y

for creating devalias mydev for /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/disk

 

 

ok select /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1

 

 

Note - The /disk portion of the path was left off the path because it is the controller you want to select.

 

6. Type the show-volumes command to determine the inactive volume:

 

ok show-volumes

 

7. Activate the volume using the volume number:

 

ok volume-number activate-volume

 

8. Unselect the device:

 

ok unselect-dev

 

9. Reset the OpenBoot PROM variables, and reset the system after you have finished managing the RAID volumes.

 

ok setenv auto-boot? true

auto-boot? = true

ok setenv fcode-debug? false

fcode-debug? = false

ok reset-all

 

If the auto-boot? variable was set to true, you might see the following message:

 

Base SAS World Wide ID is 0!

This must be fixed immediately using set-sas-wwid

 

If you see this message, set the auto-boot? variable to false, and issue the reset-all command.

Labeling a Volume

After you create a RAID volume by using the raidctl(1M) command or by using the OpenBoot PROM commands, you must label the volume correctly before the volume can be used.

 

To Label a Volume

The Solaris OS must be running to perform this procedure. If you have created the volume by using the OpenBoot PROM commands, start the Solaris OS and log in as the superuser.

1. Run the format(1M) command, and choose the newly created volume from the list of drives.

You might see messages about the volume having a corrupt label or the block count being incorrect when booting or running the format command. This command needs a correct label.

2. Chose type from the Format menu.

This action displays a list of available drive types.

3. Chose Auto configure from the list.

This action defines the volume with the correct type.

4. Write the new label to the volume using the label command from the format> prompt.

The system asks you if you are ready to label the disk.

5. Type yes.

After you perform these steps, the drive is ready for use. You can now partition the drive as needed and use the volume within the Solaris OS.

 

Posted by redkite
, |

사용 포트 리스트업

pfiles /proc/* > PORT.txt

프로세스 롱타입 확인

/usr/ucb/ps awwx |grep erl

'02.서버-Unix' 카테고리의 다른 글

[AIX]시스템 정보 확인  (0) 2012.12.19
[솔라리스]디스크 미러링  (0) 2012.12.19
[솔라리스]DMI 서비스  (0) 2012.12.19
[솔라리스]Patch Level 확인  (0) 2012.12.19
[솔라리스]라우팅 테이블 추가  (0) 2012.12.19
Posted by redkite
, |

0057. [솔라리스] DMI 서비스

* Solaris10 에서 snmpXdmid / snmp 제거 방법

1. 데몬 프로세스 확인.
# ps -ef | grep snmp
35: 636 ? S 0:03 /usr/sfw/sbin/snmpd
43: 12815 ? S 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
45: 12839 ? S 0:00 /usr/lib/dmi/snmpXdmid -s sgn


2. 서비스 등록 확인.

# svcs | grep dmi
113:online 8월_03 svc:/application/management/dmi:default

# svcs | grep snmp
120:online 15:01:37 svc:/application/management/snmpdx:default

# svcs | grep sma
112:online 8월_03 svc:/application/management/sma:default


3. svcadm 명령으로 disable 시킨다.
# svcadm disable svc:/application/management/dmi:default
# svcadm disable svc:/application/management/snmpdx:default
# svcadm disable svc:/application/management/sma:default


4. ps 및 svcs 명령으로 정상적으로 중지되었는지 확인한다.

# ps -ef | grep snmp
# svcs | grep dmi
# svcs | grep snmp
# svcs | grep sma

  1. 개요
    DMI(Desktop Management Interface) 시스템이란 PC 시스템의 하드웨어 및 소프트웨어 구성요소

들을 중앙에서 관리하고 추적하기 위한 시스템적 접근 솔루션임. SUN의 DMI 서비스도 이와 같은

개념으로 Sun Solstice Enterprise Tools라고 불림. 그러나 DMI서비스는 중앙에서 원격에 존재하는

서버를 관리하는 개념으로 보안상 문제점이 존재함

2. 서비스 제거 방법
- SNMP 사용시 SNMP는 해제하지 말것
# ps -ef | grep snmp
root 156 1 0 6월 15 ? 0:01 /usr/sfw/sbin/snmpd
root 337 1 0 6월 15 ? 0:00 /usr/lib/dmi/snmpXdmid -s
# svcs -a |grep dmi
disabled 6월_15 svc:/network/security/kadmin:default
online 6월_15 svc:/application/management/dmi:default
# svcadm disable svc:/application/management/dmi:default
# svcadm disable svc:/application/management/snmpdx:default
# svcs -a |grep snmp
disabled 3:30:16 svc:/application/management/snmpdx:default
# svcs -a |grep dmi
disabled 6월_15 svc:/network/security/kadmin:default
disabled 3:34:54 svc:/application/management/dmi:default



-- 해당 시스템 -------
Sun Solaris 8.0_x86
Sun Solaris 8.0
Sun Solaris 7.0_x86
Sun Solaris 7.0
Sun Solaris 2.6_x86
Sun Solaris 2.6

-- 설명---------------
Solaris는 관리 유연성을 제공하도록 업계 표준인 SNMP 및 DMI 기반의 프로토콜을
지원하며 이러한 역활을 수행해주는 Daemon 프로그램이 "snmpXdmid"이다. Sun
Microsystem's Solaris의 2.6, 7, 8 버전에서의 snmpXdmid 서비스 Daemon은 SNMP 요구
사항을 DMI 요구 사항으로 또는 그 반대로 맵핑하기위해서 사용된다. 이때 Solaris는
매퍼(mapper)를 사용하는데 매퍼는 SNMP 요구 사항을 DMI 요구 사항으로, DMI
요구사항을 SNMP요구사항으로 바꿔주는 SNMP 뷰에이전트 기능을 수행한다. 뿐만
아니라 매퍼는 DMI 서비스 제공자와 SNMP 마스터 에이전트간의 요구 사항 및 반응을
조정하여 DMI 서비스 제공자와 상호작용한다.

snmpXdmid가 SNMP 트랩으로 악의 있는 DMI 요구사항을 해석할 때 snmpXdmid는 버퍼
오버플로우 취약점을 포함하고 있다. 뿐만아니라 snmpXdmind는 루트 권한으로
실행되기 때문에 공격자가 이 취약점을 이용해서 공격에 성공하면 슈퍼유저의 권한을
획득할 수 있다. snmpXdmid는 solaris에서 발견되는 많은 취약점을 갖고 있는 RPC
기반의 프로그램이기때문에 RPC관련 스캔도구를 사용하여 snmpXdmid서비스가 제공되고
있는지 원격에서 탐지할 수 있다.

Local상에서 lsof와 rpcinfo명령어를 사용하여 snmpXdmid 서비스가 제공되고
있는지를 확인할 수 있으며 rpc관련 스캔 프로그램(vetescan등)을 사용하여 프로그램
ID번호 및 portmap정보를 획득할 수 있다.

Local에서
# lsof | grep snmpXdmid
........중간생략
snmpXdmid 339 root 1u inet 0x60e7ddd0 0t0 TCP *:32779 (LISTEN)
........나머지 생략

remote에서
#rpcinfo -p 172.16.4.150
........중간생략
100249 1 tcp 32779
........나머지 생략


현재 이 취약점을 이용한 공격도구가 제공되고 있으며, Incident List에서는
이와 관련된 사고가 접수되고 있다. 뿐만 아니라 UnderHacker(wild)들에게 사용되고 있다.
SNMP 및 DMI관련 Management기능을 사용하지 않으면 아래의 해결책에 따라
대응하여야만 한다.

-- 해결책 ------------
현재 SUN사는 이 취약점에 대하여 해결책을 마련하고 있으며, Daemon 서비스로
제공되고 있는 DMI 서비스를 제공하지 않는 것이 안전하다. /etc/rc?.d/K07dmi에서
/etc/rc?.d/s??dmi로 이름을 바꾸고, '/etc/init.d/init.dmi stop'을 실행하여
실행되고 있는 snmpXdimd Daemon을 중지시켜야 한다. 또다른 방법으로는 snmpSdmid의
모든 권한을 제거하는 방법으로도 대응할 수 있다. 다음의 명령어를 실행하여
가능하다.
# chmod 000 /usr/lib/dmi/snmpXdmid

------- 참조 사이트 --------------------------
[1] Solaris snmpXdmid Buffer Overflow Vulnerability 권고문
http://www.securityfocus.com/vdb/?id=2417
[2] SNMP 및 DMI 기반의 구성요소
http://www.sun.co.kr/products/software/sys_net/fault/agent/over.html

-------------------------------------------------------------------
한국정보보호센터(Korea Information Security Agency),
Computer Emergency Response Team Coordination Center , CERTCC-KR
전화: 118 (지방 02-118) Email: cert@certcc.or.kr
====================================================================


아래도 참고하세요.

현재 Solaris 2.6/7/8 에서 구동되고 있는 snmpXdmid 라는 프로그램의
버그를 이용하여 (remote buffer overflow) carko 라는 DDos agent가 설치되고 있습니다.

우선 carko 가 설치된 위치는 /usr/man/mansps/ddos 라는 디렉토리에 설치되어 있으며
ps 프로그램이 변조되어 있어 이 변조된 ps 로는 carko 라는 process가 실행되어 있는지 확인할수 없습니다.

우선 /dev/ptyq 라는 파일이 있는지 확인한 후 이 파일을 삭제 또는
다른 디렉토리로 이동후에 ps 명령어를 실행시켜야 합니다.

# find /dev -type f
/dev/ptyq
# mv /dev/ptyq /tmp
#ps -ef | grep carko
....
# kill -9 carko_pid

또한 inetd 가 /tmp/.x 를 설정파일로 구동되어 있으므로
/usr/sbin/inetd -s /tmp/.x가 구동되어 있는지 확인해야 된다.
(즉 inetd 가 2개 구동되어 있는 셈이다.)

#ps -ef| grep inetd

그런 후 /usr/lib/dmi/snmpXdmid 의 프로세를 종료시킨다.
#ps -ef | grep snmpXdmid
...

다음으로 /etc/rc3.d에서 자동으로 구동되지 않게 한다.
# mv /etc/rc3.d/S77dmi /etc/rc3.d/k77dmi


그외 Solaris 에서 외부에서 root 권한을 얻을 수 있는 문제 가 알려진 데몬들은 다음과 같다.
받드시 다음프로그램들은 구동시키지 말도록하자.
(/etc/inetd.conf 에서 comment 시켜야 됨)
1) /usr/sbin/sadmind
2) rpc.ttdbserverd


또한 RPC에 관련된 프로그램(NFS, NIS.. )를 사용하지 않는다면
rpc 에 관련된 모든 프로그램은 구동시켜지 않도록 해야 된다.
(/usr/sbin/rpcbind 를 구동시키지 않는다)


# rpcinfo -p your_host_ip

Posted by redkite
, |

0045. [솔라리스] Patch Level 확인

Solaris patch 관리툴 Patch Check Advanced (pca)

Solaris 2008/10/09 12:01 posted by CecilDeSK

Solaris상에서 패치를 관리하는 방법은 여러가지가 있습니다. Console에서 smpatch를 사용할수도 있고 CDE나 Sun Java Desktop System상에서 Sun(TM) Update Manager를 사용하여 패치관리를 하실수도 있습니다.

Sun에서는 PatchDiag, PatchCheck, PatchPro, smpatch, Sun Update Connection등 아직 사용하는것도 있고 지금은 사용되지 않는 관리툴도 존재합니다. Solaris 상에서 패치를 관리하는 일은 그다지 쉬운일은 아니며 kernel panic!으로 부팅도 안되는 상황이 발생했던적도 있었을겁니다.

Patch Check Advanced(pca)는 PatchPro 나 smpatch 와 유사하게 사용가능합니다.

약간 생소할수는 있지만 패치 정보 표시화면상에 Recommended/ Security 패치의 상태나 리비전, 업데이트가 필요한지 여부를 간략하게 표시해줍니다. 정보화면을 text나 html 포맷등으로 내보낼수있으며 download/ install 도 옵션 파라메터 상에서 이용할수있습니다. 또한 Sun Service Plan에 가입한 사용자를 위해 askauth나 ID/PW 를 이용한 인증 기능을 제공합니다.

  • 설치/ 사용방법 (Perl 과 wget 1.7 보다 상위버전이 필요합니다)

우선 Patch Check Advanced(pca) Stable version을 다운로드 하여 PATH가 걸린 경로나 임의의 장소에 넣어둡니다.

#wget http://www.par.univie.ac.at/solaris/pca/stable/pca

실행가능하게 권한설정

#chmod +x pca

패치 리스트 보기

[sol10:/export/home/cecil/patch]#./pca -l all

Using /var/tmp/patchdiag.xref from Oct/07/08

Host: sol10 (SunOS 5.10/Generic_137112-07/i386/i86pc)

List: all

Patch

IR

 

CR

RSB

Age

Synopsis

119255

59

=

59

RS-

8

SunOS 5.10_x86: Install and Patch Utilities Patch

113000

07

=

07

R--

999

SunOS 5.10_x86: SUNWgrub patch

117181

01

=

01

---

999

SunOS 5.10_x86: /kernel/drv/pcscsi patch

117435

02

=

02

R--

999

SunOS 5.10_x86: biosdev patch

118344

14

=

14

R--

721

SunOS 5.10_x86: Fault Manager Patch

118368

04

=

04

---

696

SunOS 5.10_x86: csh Patch

118567

01

=

01

---

999

SunOS 5.10_x86: ping Command Patch

118668

17

=

17

-S-

93

JavaSE 5.0_x86: update 16 patch (equivalent to JDK 5.0u16)

118669

17

=

17

-S-

93

JavaSE 5.0_x86: update 16 patch (equivalent to JDK 5.0u16), 64bit

118677

03

=

03

---

643

SunOS 5.10_x86: patch for Solaris make and sccs utilities

118736

01

<

02

---

140

SunOS 5.10_x86: usr/sbin/rpc.nisd_resolv Patch

118778

11

=

11

---

316

SunOS 5.10_x86: Sun GigaSwift Ethernet 1.0 driver patch

118825

01

<

02

---

139

SunOS 5.10_x86: sort patch

118855

36

=

36

RS-

619

SunOS 5.10_x86: kernel patch

.........

위처럼 정보화면이 나오는데 첫째 column의 Patch는 패치번호, IR은 설치된 리비전, CR은 현재 리비전(IR과 CR사이의 등호와 부등호 표시는 '='이면 패치 필요없다, '<' 이면 상위 패치가 있다)을 표시하고 RSB는 각각 Recommended/ Security/ Bad flag 를 표시합니다. Age는 패치가 릴리즈 된 날짜를, Synopsis 는 패치에 대한 간략한 설명을 표시합니다.

118736, 118825은 각각 리비전이 1씩 높아져서 업데이트가 필요한 패치라는걸 알수있고 Recommended나 Security 패치가 아니라는 것도 알수있습니다.

  • 기본적인 옵션

패치를 설치하는 옵션

#pca -i or pca --install

-l 옵션은 패치를 설치하기는 하지만 reboot가 필요한 패치를 설치할때 이용하면 됩니다. reboot 안하고 설치가 가능하게... fake~(갑자기 슬램덩크 강백호가 생각이....)

#pca -I or --pretend

업데이트가 필요한 패치 보기

#pca -l or --list

모든 패치 정보를 보기위해서는

#pca -l all or --list all

패치에 대한 README를 보기

#pca -r or --readme

패치를 다운로드만하기

#pca -d or --download

Configuration file 설정

/etc/pca.conf 나 홈디렉토리에 .pca 파일이나 prompt가 위치한 디렉토리의 pca.conf 등이 Configuration file로 사용될 수 있습니다.

이외에도 다양한 옵션이 존재하는데 좀더 자세한 사항은 http://www.par.univie.ac.at/solaris/pca/usage.html 에서 살펴볼 수 있습니다.

홈페이지 Martin Paul's Patch Check Advanced(pca)

Posted by redkite
, |

1. 라우팅 추가
route add 211.189.47.0 88.10.1.254 1
[destination] [gateway][matric]

2. 라우팅 삭제
route delete 211.189.47.0 88.10.1.100 1
[destination] [gateway][matric]


3. 현재의 라우팅 정보 보는 방법
sun># netstat -nr // 현재의 라우팅 정보 보는 방법
Routing Table:
Destination Gateway Flags Ref Use Interface
211.47.10.0 88.10.2.100 UG 0 0

재부팅해도 routing 이 사라지지 않고 계속 남아있게 하려면 /etc/rc.2d 아래에
임의로 S로시작하는 파일을 만들어 routing add 를 해준다.
예를 들면 아래와 같다.

4. 라우팅 정보 저장
sun># cat /etc/rc2.d/S98route_add

route add net 211.47.10.0 88.10.2.100 1 // 추가해준다.

Posted by redkite
, |

/home 이하가 automountd(오토마운트데몬) 관리하에 있기 때문에 발생하는 것이다.
이럴 경우 ' man automount'를 실행해도 되지만
vi/etc/auto_master'를 실행하고,
다음과 같이 /home을 automountd에서 떼어내도 된다.

# Master map for automounter
#
+auto_master
/net -hosts -nosuid,nobrowse
/test auto_home -nobrowse --> (이부분을 주석처리 주석처리는 앞에 #추가)
/xfn -xfn

그리고 데몬을 재시동한다(즉 /etc/init.d에는 시동
및 종료시 다양한 설정이나 데몬을 시동하거나 정지하
기 위한 스크립트가 기술되어 있다).

# svcadm disable svc:/system/filesystem/autofs:default


여기서 /home 이하에 파일을 작성할 수 있게 된다.
그러나 표준 설정으로 /export/home이 만들어져 있
기 때문에 다음과 같이 지정해 홈디렉토리용 파티션을
/home에 링크시켜 둔다.

# rmdir /home
# ln -s /export/home /home

Posted by redkite
, |

 

http://blog.sdnkorea.com/blog/category
http://www.solanara.net/

svcadm disable svc:/network/nfs/server

svcadm disable svc:/network/nfs/status:default

svcadm disable svc:/network/nfs/mapid:default

svcadm disable svc:/network/nfs/client:default

svcadm disable svc:/network/nfs/nlockmgr:default

svcadm disable svc:/network/nfs/cbd:default


NFS란?

  • NFS(Network File System)은 유닉스에서 파일을 공유하기 위해 만든 시스템이다. 리눅스, BSD에서도 지원하며, 윈도우에서도 Windows Services for UNIX를 설치하면 NFS를 지원해준다. 솔라리스 10에서는 가장 최신 버전인 NFSv4(RFC3530)까지 지원한다.

    NFSv1: 썬에서 내부적으로 개발됨. 공개되지는 않음.
    NFSv2: UDP를 이용해 최초의 NFS공개.
    NFSv3: 4GB이상의 파일 지원. 쓰기 성능 향상.
    NFSv4: 파일 락 지원

    이 문서에서는 두대의 서버를 가정한다. 호스트명이 wl, wl2 가 그것으로 wl은 NFS서버로써, wl2는 NFS클라이언트로써 사용할 것이다.
  • 참고: System Administration Guide: Network Services - Part II Accessing Network File Systems Topics

기본적인 공유방법

  • 서버(wl)

    서버의 /export/home/share 디렉토리를 공유하도록 만든다.
    root@wl ~ # vi /etc/hosts
    192.168.0.11    wl2
    root@wl ~ # vi /etc/dfs/dfstab
    share -F nfs -o rw=wl2 -d "WL2 SHARE" /export/home/share 1)
    root@wl ~ # shareall 2)
    root@wl ~ # share 3)
    -               /export/home/share   rw=wl2   "WL2 SHARE"
    root@wl ~ #
    
    1) -F는 파일 시스템을 지정하는 것으로 nfs로 고정되어있다. -o 에는 옵션을 써준다. rw=wl2의 의미는 wl2서버에서 접속시 rw(읽기/쓰기)가 가능하도록 한다는 뜻이다. -d의 문자는 단순한 설명문이다. 마지막은 공유할 디렉토리를 전체경로로 입려한다. NFS서버를 세팅하는 가장 단순한 방법이다. 다른 옵션에 대한 설명은 [man share_nfs]를 참조한다.
    2) shareall은 /etc/dfs/dfstab 파일을 읽어 실행하는 명령이다. 바꿔말하면 1)의 [share ~]를 커맨드에서 실행시켜도 된다. (파일에 넣어두어야 시스템 재부팅시 자동으로 실행된다)
    3) 공유된 내역을 확인할 수 있다.
  • 클라이언트(wl2)

    서버의 /export/home/share 에 접속해 파일을 가져올 수 있도록 마운트 한다.
    root@wl2 ~ # mkdir /root/share
    root@wl2 ~ # vi /etc/hosts
    192.168.0.3     wl
    root@wl2 ~ # mount -F nfs wl:/export/home/share /root/share 1)
    root@wl2 ~ #
    
    1) wl2에서, wl에서 공유한 /export/home/share 디렉토리를 /root/share 에 마운트한다.
  • 시스템 재시작시 자동으로 마운트하기

    클라이언트에서 마운트 정보를 vfstab파일에 등록하고, nfs client 관련 서비스가 부팅시에도 시작되어있어야 한다. 만약 서버가 다운되어있으면, 클라이언트 부팅이 조금 느려진다.
    root@wl2 ~ # vi /etc/vfstab
    ...
    wl:/export/home/share   -       /root/share     nfs     -       yes     -
    ...
    root@wl2 ~ # svcs | grep nfs
    online          3:46:12 svc:/network/nfs/cbd:default
    online          3:46:12 svc:/network/nfs/mapid:default
    online          3:46:12 svc:/network/nfs/status:default
    online          3:46:12 svc:/network/nfs/nlockmgr:default
    online          3:46:21 svc:/network/nfs/client:default
    root@wl2 ~ #
    
    서버는 해야할 필요 없다. (이미 되어있다)
  • 주의사항

    • wl2에서 wl의 파일 시스템을 NFS를 이용해 공유했을때 권한 문제가 발생할 수 있다. 특히 클라이언트에서 서버에 접근할때, 클라이언트의 root 권한 사용자는 (NFS서버에서 특별한 설정이 없다면) nobody의 UID값을, 일반 계정은 해당 계정의 UID값으로 NFS 서버에 접근한다.
      • 예1) wl에서 /export/home/share 에 nobody 로 파일 생성 권한이 없다면, wl2에서 root로 /root/share 에 파일을 생성할 수 없을 것이다.
      • 예2) wl에서 /export/home/share 에 windy 로 파일 생성 권한이 있다면, wl2에서 windy로 /root/share 에 파일을 생성할 수 있을 것이다.
      예2에서 전제조건이 하나 있다. wl의 windy가 가진 UID값과, wl2의 windy가 가진 UID값이 같아야 한다. NFS에서 파일 접근은 UID값을 사용하기 때문에 wl과 wl2에서 같은 계정명의 UID가 서로 다른 경우, 다른 아이디로 보일 것이다. 간혹 계정명은 같은데 UID값이 달라 권한설정에 어려움을 겪는 경우를 많이 봐서 강조하는 것이다. useradd 명령을 사용할때 -u xxx를 반드시 정해주어 같은 UID를 가지도록 하자.
      계정의 UID, GID가 같아야 함
      NFS서버와 NFS클라이언트에서 사용자를 생성할 때, 같은 이름의 사용자는 UID와 GID가 같아야 혼란을 방지할 수 있다.
    • 부모 디렉토리가 공유되면 그 서브 디렉토리는 공유되지 않는다. NFS스펙상 안된다.
      root@wl ~ # mkdir /nfs
      root@wl ~ # mkdir /nfs/share
      root@wl ~ # share -F nfs -o ro /nfs
      root@wl ~ # share -F nfs -o rw /nfs/share
      share_nfs: /nfs/share: 부모 디렉토리(/nfs)가 이미 공유되었습니다
      root@wl ~ #
      
      단 예외가 있는데, 마운트 지점이 다른 경우는 공유가 된다. ZFS를 사용하는 경우 아래와 같이 생성하면 된다.
      root@wl ~ # mkdir /nfs
      root@wl ~ # mkdir /nfs/share
      root@wl ~ # zfs create rpool/nfssample
      root@wl ~ # zfs set mountpoint=/nfs/share rpool/nfssample
      root@wl ~ # share -F nfs /nfs
      root@wl ~ # share -F nfs /nfs/share
      root@wl ~ # share
      -               /nfs/share   rw   ""
      -               /nfs   rw   ""
      root@wl ~ #
      

automount 사용하기

  • automount 란?

    솔라리스10에는 automountd 라는 데몬이 있다. 요청이 들어오면 자동적으로 NFS파일 시스템을 마운트 해 주고 사용하지 않으면 일정 시간(기본값은 10분)이 지나면 접속을 끊는 것이다. 솔라리스는 리눅스와는 달리 /export/home 이 사용자의 기본 홈 베이스 디렉토리인데, 이는 /home 디렉토리는 automountd에 의해 사용되기 때문이기도 하다. /home 외에 /net 도 automountd 에 의해 사용된다. (/home, /net에 디렉토리에 일반 파일을 생성하려면, automountd를 종료해야 한다. 하지만 추천하지 않는다)
    root@wl2 ~ # ps -ef | grep auto
        root  2202     1   0   10월 1 ?           0:00 /usr/lib/autofs/automountd
        root  2203  2202   0   10월 1 ?           0:30 /usr/lib/autofs/automountd
    root@wl2 ~ # svcs | grep autofs
    online         10월_10 svc:/system/filesystem/autofs:default
    root@wl2 ~ #
    
    automound 는 /etc/auto_master 파일로 설정한다. 솔라리스를 설치하고 별다른 수정사항이 없다면 아래와 같이 되어있을 것이다.
    root@wl2 ~ # cat /etc/auto_master
    +auto_master
    /net            -hosts          -nosuid,nobrowse
    /home           auto_home       -nobrowse
    root@wl2 ~ #
    
    또한 /etc/auto_home 파일도 확인해보자. 이 파일에서 auto_home 이란 이름은 /etc/auto_master 파일에서 /home으로 시작하는 컬럼에 지정된 이름과 같은 것이다.
    root@wl2 ~ # cat /etc/auto_home
    +auto_home
    root@wl2 ~ #
    
  • /home 디렉토리(홈 디렉토리 공유)

    wl2 서버의 windy 사용자는 wl서버의 홈 디렉토리와 디렉토리를 공유하려 한다. 이때는 아래와 같이 하면 된다.
    root@wl ~ # useradd -d /export/home/windy -c "윈디하나" -g staff -m -u 101 -s /bin/bash windy
    root@wl ~ # vi /etc/dfs/dfstab
    share -F nfs -o rw=wl2 -d "windy share" /export/home/windy
    root@wl ~ # shareall
    root@wl ~ #
    
    서버는 통상적인 NFS 공유 설정과 다를 것이 없다.
    root@wl2 ~ # vi /etc/auto_home
    windy   wl:/export/home/windy
    root@wl2 ~ # useradd -d /home/windy -c "윈디하나" -g staff -u 101 -s /bin/bash windy
    root@wl2 ~ # su - windy
    windy@wl2 ~ $ pwd
    /home/windy
    windy@wl2 ~ $
    
    클라이언트는 automountd 를 위해 /etc/auto_home를 수정하고 홈 디렉토리를 automountd 가 관리하는 /home/windy를 가리키도록 한다. 평상시에는 마운트되지 않다가 windy 가 wl2에 로그인 해서 홈 디렉토리로 현재 디렉토리를 옮길 때 자동으로 마운트 될 것이다.
    • NFS서버 다운되면 로그인이 안된다. 홈 디렉토리가 없기 때문이다.
    • 루트는 nobody의 UID를 사용해 NFS서버에 접근하기 때문에 위와같이 해서는 안된다.
    • NFS에 접속할 때 옵션이 필요한 경우 (예를 들면 NFS 3로 접속해야 하는 경우) auto_home 파일에 [windy -proto=tcp,vers=3 wl:/export/home/windy] 처럼 설정하면 된다.
  • /net 디렉토리

    윈도우에서 네트워크 환경을 들어가보면 공유된 서버와 공유된 디렉토리들이 보일 것이다. 솔라리스에서 이와 비슷한 역할을 하는 것이 /net 디렉토리다. (공유된 서버의 목록은 안 보인다) [/net/주소] 디렉토리에 가보면 현재 공유되는 자원을 확인할 수 있다.
    root@wl2 ~ # cd /net
    root@wl2 /net # ls -alF
    총 4
    dr-xr-xr-x   1 root     root           1 11월  6일  14:59 ./
    drwxr-xr-x  25 root     root          26 11월  6일  14:59 ../
    root@wl2 /net # cd /net/wl 1)
    root@wl2 /net/wl # ls -alF
    총 3
    dr-xr-xr-x   2 root     root           2 11월  6일  15:08 ./
    dr-xr-xr-x   2 root     root           2 11월  6일  14:59 ../
    dr-xr-xr-x   1 root     root           1 11월  6일  15:08 export/
    root@wl2 /net/wl # cd ./export/home
    root@wl2 /net/wl/export/home # ls -al
    ...
    dr-xr-xr-x   1 root     root           1 11월  3일  15:49 share
    dr-xr-xr-x   1 root     root           1 11월  3일  15:49 windy
    root@wl2 /net/wl/export/home #
    
    1) [/net/wl] 대신 [/net/192.168.0.3]과 같이 wl의 IP를 써줄 수도 있고 도메인 명을 써줄수도 있다. [/net/wl2]와 같이 자신의 호스트로 접속할 수도 있다.

NFS 고급

share 명령의 옵션

  • share 명령에서, anon 과 root 옵션에 대해 설명한다. 위에서 root 사용자는 [NFS서버에서 특별한 설정이 없다면] nobody의 uid를 사용한다고 했는데, 그 특별한 설정에 대해 설명하려한다.
  • anon 옵션은 [알 수 없는 사용자]에 대한 기본 uid 값을 정해준다. 기본값으로 nobody의 uid를 사용하도록 되어있다. 만약 이 값이 -1로 설정되어있다면 [알 수 없는 사용자]에 대해 접근을 거부한다. 알 수 없는 사용자란, nfs서버에 uid가 등록되어있지 않은 사용자를 말한다.
  • root 옵션은 root 사용자로 접근할 수 있는 호스트들을 설정한다. access-list 에 정의된 호스트의 root 사용자는 root 접근 권한을 가진다. 따라서 chown과 같은 루트 전용 명령도 사용할 수 있다.
  • anon 옵션 예제

    root@wl ~ # share -F nfs -o anon=101 /nfs
    root@wl ~ # share
    -               /nfs   anon=101   ""
    root@wl ~ # chmod 777 /nfs
    
    root@wl2 ~ # mount -F nfs wl:/nfs /nfs
    root@wl2 ~ # touch /nfs/sample
    root@wl2 ~ # ls -al /nfs/sample
    -rw-r--r--   1 windy      101            0 11월 24일  10:23 /nfs/sample
    
    101은 windy 사용자의 uid 이다. /nfs/sample 파일의 소유자가 windy 로 된 것을 확인할 수 있다.
    root@wl2 ~ # umount /nfs
    
    root@wl ~ # unshare /nfs
    
  • root 옵션 예제

    root@wl ~ # share -F nfs -o root=wl2 /nfs
    
    root@wl2 ~ # mount -F nfs wl:/nfs /nfs
    root@wl2 ~ # touch /nfs/sample
    root@wl2 ~ # ls -al /nfs/sample
    -rw-r--r--   1 root     root           0 11월 24일  10:27 sample
    root@wl2 ~ # chown windy /nfs/sample
    root@wl2 ~ # ls -al /nfs/sample
    -rw-r--r--   1 windy    root           0 11월 24일  10:27 sample
    
    소유자가 root 로 생성되었고, chown명령을 이용해 소유자를 바꿀 수 있다.
    root@wl2 ~ # umount /nfs
    
    root@wl ~ # unshare /nfs
    

NFS 로깅

NFS서버에서 무슨일이 일어나고 있는지 로깅할 수 있다. /etc/default/nfslogd 파일과 /etc/nfs/nfslog.conf 파일로 설정할 수 있다. 아래는 이 두개의 파일을 그대로 두고 로그를 사용하는 방법에 대해 설명한다.

root@wl ~ # vi /etc/dfs/dfstab
share -F nfs -o rw=wl2,log=global -d "WL2 SHARE" /export/home/share
root@wl ~ # shareall
root@wl ~ # share
-               /export/home/share   rw=wl2,log=global   "WL2 SHARE"
root@wl ~ # svcadm restart network/nfs/server:default 1)
root@wl2 ~ # mount -F nfs -o vers=3 wl:/export/home/share /root/share 2)
root@wl ~ # cat /var/nfs/nfslog 3)
메시지 생략
Mon Nov  3 17:13:05 2008 0 wl2 0 /export/home/share/source/top-3.7/m_sunos5.o b _ remove r 60001 nfs3-tcp 0 *
메시지 생략

1)/etc/nfs/nfslogtab 파일이 있어야 nfslogd 데몬이 실행된다. 없다면 shareall부터 다시하자.
2)현재의 솔라리스 10 버전(u6)는 NFSv4 인 경우 로그가 쌓이지 않는다. (nfslogd MAN페이지에 나와있다) 따라서 NFSv3를 사용한다.
3)FTP로그 쌓이듯 로그가 저장된다. 그런데 처음에는 아마 안 보일 것이다. 일정한 양이 쌓여야 파일에 쓰기 때문이고, 파일이 전송된것만 보이기 때문이다. 디렉토리를 만드는 것은 안 보인다. 이를 해결하려면 nfslogd 의 설정을 바꿔야 한다. (버퍼 파일이 없거나, 버퍼 값이 너무 작으면 NFS 성능이 매우 많이 떨어진다. 테스트할 목적으로만 사용하자)

root@wl ~ # vi /etc/nfs/nfslog.conf
global  defaultdir=/var/nfs \
        log=nfslog fhtable=fhtable buffer=nfslog_workbuffer logformat=extended
root@wl ~ # vi /etc/default/nfslogd
MIN_PROCESSING_SIZE=1024
root@wl ~ # svcadm restart network/nfs/server:default

NFS 마운트 옵션

  • 클라이언트에서 mount 시 -o 뒤에 들어가는 NFS용 옵션이 있다. 모든 목록은 [man mount_nfs]에 나와있으며 여기서는 자주 사용되는 몇가지 옵션에 대해 설명하고자 한다.
  • actimeo
    NFS 성능 튜닝에서 가장 많이 설정하는 것이 actimeo 값이다. 이는 nfs 로 마운트된 곳의 파일 어트리뷰트를 캐시하는 시간을 일괄적으로 지정한다. 일괄적이라는 것은 acdirmax, acdirmin, acregmax, acregmin 값을 각각 지정하는 번거로움없이 actimeo 를 적어주면 앞의 4가지 값이 모두 동일하게 변경된다. 단위는 초이다. 4가지 속성의 기본값은 [acdirmax=60,acdirmin=30,acregmax=60,acregmin=3] 이다.
    예를 들어 actimeo=30 으로 하면, 4가지 속성 모두 30(초)으로 세팅된다. 즉 [acdirmax=30,acdirmin=30,acregmax=30,acregmin=30] 과 같다.
  • forcedirectio
    directio를 강제로 사용고자 할때 옵션을 주면 된다. 버퍼링 없이 클라이언트/서버간에 데이터가 전송된다. actimeo=0 옵션과 같이 DBMS의 데이터 파일처럼 큰 파일을 핸들링 할때 주로 사용된다.
  • rsize, wsize 최대 읽기버퍼(rsize), 최대 쓰기버퍼(wsize)의 크기 지정. 단위는 바이트. 기본값은 NFSv3, NFSv4에서 1048576
  • bg, fg 마운트 실패시 background로 재시도, foreground로 재시도. 기본값은 fg
  • noac, nointr 데이터및 파일 속성 캐시 안함(noac), [hard]옵션으로 마운트된 파일 시스템에서 행이 걸렸을 경우 프로세스를 죽이기 위해 키보드 인터럽트를 허용하지 않음(nointr). 기본값은 캐시함, 허용함.
  • soft, hard NFS서버에서 응답이 없는 경우, 서버 응답하거나 타임아웃될때까지 재시도하거나(hard), 에러를 발생하고 마운트 프로세스 종료(soft). NFSv4에서는 soft를 지원하지 않는다. 기본값은 hard.
  • vers 사용할 NFS 프로토콜을 정의함. vers=3 인경우 NFSv3. 기본값은 4
  • 마운트 옵션 예
    root@wl2 ~ # mount -F nfs -o ro=@192.168.0:@xxx.xxx.xxx.xxx,rw=wl:wl2:.solanara.net,actimeo=0,forcedirectio wl:/export/home/share /root/share
    
    root@wl2 ~ # mount -F nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,proto=tcp,vers=3,noac,forcedirectio wl:/export/home/share /root/share
    

NFS Replication

  • NFS도 리플리케이션이 지원된다. 클라이언트에서 지원되는 페일오버 정도로 생각하면 된다. (클러스터링 정도는 아니다) 아래의 컨셉을 따라하면 된다.
    • 서버: 읽기 전용으로 파일 시스템을 공유한다
    • 클라이언트: # mount -o ro server1:/export/home/share,server2:/export/home/share /root/share
  • 아래의 예는 1대의 NFS서버에 디렉토리를 달리해 NFS Replication을 구현한 예제이다. (서버가 같으니 실무에서는 달리 구현해야 한다)
    root@wl ~ # vi /etc/dfs/dfstab
    share -F nfs -o ro -d "windy share2" /export/home/windy2
    share -F nfs -o ro -d "windy share" /export/home/windy
    root@wl ~ # shareall
    
    root@wl2 ~ # mount -o ro wl:/export/home/windy2,wl:/export/home/windy /root/share
    root@wl2 ~ # df -k /root/share
    파일시스템           K바이트    사용    가용   용량    설치지점
    wl:/export/home/windy2,wl:/export/home/windy
                         62907203 17956504 44321627    29%    /root/share
    root@wl2 ~ # nfsstat -m
    /root/share from wl:/export/home/windy2,wl:/export/home/windy
     Flags:         vers=4,proto=tcp,sec=sys,hard,intr,llock,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
     Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60
     Failover:      noresponse=0,failover=0,remap=0,currserver=wl
    root@wl2 ~ #
    

nfsstat 명령

NFS 서버 및 클라이언트의 상태를 보여주는 명령이다. 각 항목의 자세한 의미는nfsstat(1M)을 참고하자.

  • 서버

    root@wl ~ # nfsstat -s
    
    Server rpc:
    Connection oriented:
    calls      badcalls   nullrecv   badlen     xdrcall    dupchecks  dupreqs
    0          0          0          0          0          0          0
    Connectionless:
    calls      badcalls   nullrecv   badlen     xdrcall    dupchecks  dupreqs
    0          0          0          0          0          0          0
    
    Server nfs:
    calls     badcalls
    0         0
    Version 2: (0 calls)
    null     getattr  setattr  root     lookup   readlink read     wrcache
    0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
    write    create   remove   rename   link     symlink  mkdir    rmdir
    0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
    readdir  statfs
    0 0%     0 0%
    Version 3: (0 calls)
    null        getattr     setattr     lookup      access      readlink
    0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
    read        write       create      mkdir       symlink     mknod
    0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
    remove      rmdir       rename      link        readdir     readdirplus
    0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
    fsstat      fsinfo      pathconf    commit
    0 0%        0 0%        0 0%        0 0%
    Version 4: (0 calls)
    null                compound
    0 0%                0 0%
    Version 4: (0 operations)
    reserved            access              close               commit
    0 0%                0 0%                0 0%                0 0%
    create              delegpurge          delegreturn         getattr
    0 0%                0 0%                0 0%                0 0%
    getfh               link                lock                lockt
    0 0%                0 0%                0 0%                0 0%
    locku               lookup              lookupp             nverify
    0 0%                0 0%                0 0%                0 0%
    open                openattr            open_confirm        open_downgrade
    0 0%                0 0%                0 0%                0 0%
    putfh               putpubfh            putrootfh           read
    0 0%                0 0%                0 0%                0 0%
    readdir             readlink            remove              rename
    0 0%                0 0%                0 0%                0 0%
    renew               restorefh           savefh              secinfo
    0 0%                0 0%                0 0%                0 0%
    setattr             setclientid         setclientid_confirm verify
    0 0%                0 0%                0 0%                0 0%
    write               release_lockowner   illegal
    0 0%                0 0%                0 0%
    
    Server nfs_acl:
    Version 2: (0 calls)
    null        getacl      setacl      getattr     access      getxattrdir
    0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
    Version 3: (0 calls)
    null        getacl      setacl      getxattrdir
    0 0%        0 0%        0 0%        0 0%
    
  • 클라이언트

    root@wl2 ~ # nfsstat -c
    
    Client rpc:
    Connection oriented:
    calls      badcalls   badxids    timeouts   newcreds   badverfs   timers
    1229652    3          2          0          0          0          0
    cantconn   nomem      interrupts
    0          0          2
    Connectionless:
    calls      badcalls   retrans    badxids    timeouts   newcreds   badverfs
    0          0          0          0          0          0          0
    timers     nomem      cantsend
    0          0          0
    
    Client nfs:
    calls     badcalls  clgets    cltoomany
    1219703   3         1218231   53
    Version 2: (0 calls)
    null     getattr  setattr  root     lookup   readlink read     wrcache
    0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
    write    create   remove   rename   link     symlink  mkdir    rmdir
    0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%     0 0%
    readdir  statfs
    0 0%     0 0%
    Version 3: (1218930 calls)
    null        getattr     setattr     lookup      access      readlink
    0 0%        7567 0%     239 0%      24540 2%    3433 0%     0 0%
    read        write       create      mkdir       symlink     mknod
    743 0%      1150738 94% 47 0%       21 0%       0 0%        0 0%
    remove      rmdir       rename      link        readdir     readdirplus
    25352 2%    1162 0%     2 0%        0 0%        0 0%        3113 0%
    fsstat      fsinfo      pathconf    commit
    6 0%        5 0%        0 0%        1962 0%
    Version 4: (0 calls)
    null                compound
    0 0%                0 0%
    Version 4: (0 operations)
    reserved            access              close               commit
    0 0%                0 0%                0 0%                0 0%
    create              delegpurge          delegreturn         getattr
    0 0%                0 0%                0 0%                0 0%
    getfh               link                lock                lockt
    0 0%                0 0%                0 0%                0 0%
    locku               lookup              lookupp             nverify
    0 0%                0 0%                0 0%                0 0%
    open                openattr            open_confirm        open_downgrade
    0 0%                0 0%                0 0%                0 0%
    putfh               putpubfh            putrootfh           read
    0 0%                0 0%                0 0%                0 0%
    readdir             readlink            remove              rename
    0 0%                0 0%                0 0%                0 0%
    renew               restorefh           savefh              secinfo
    0 0%                0 0%                0 0%                0 0%
    setattr             setclientid         setclientid_confirm verify
    0 0%                0 0%                0 0%                0 0%
    write
    0 0%
    
    Client nfs_acl:
    Version 2: (0 calls)
    null        getacl      setacl      getattr     access      getxattrdir
    0 0%        0 0%        0 0%        0 0%        0 0%        0 0%
    Version 3: (709 calls)
    null        getacl      setacl      getxattrdir
    0 0%        708 99%     0 0%        1 0%
    
  • 마운트 지점 지정

    root@wl ~ # nfsstat -m /home/windy
    /home/windy from wl2:/export/home/windy
     Flags:         vers=3,proto=tcp,sec=none,hard,intr,link,symlink,acl,rsize=32768,wsize=32768,retrans=5,timeo=600
     Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60
    
  • 옵션을 주지않으면 모두 표시되기 때문에, 특정한 프로토콜만 본다거나(-v 옵션 사용), 마운트 위치를 지정(-m 옵션 사용)해 보는 것이 더 편할 것이다.
  • RPC 설명

    calls           RPC 콜 회수
    badcalls        RPC 계층에서 거절된 콜 회수(badlen 과 xdrcall 의 합)
    nullrecv        유효하지 않은 RPC콜 회수
    badlen          최소한의 RPC콜 길이보다 짧은 RPC콜 회수
    xdrcall         XDR 디코드 할 수 없는 RPC 콜 회수
    dupchecks       이중 요청 캐시에서 발견된 RPC 콜 개수
    dupreqs         이중 요청 회수
    
  • NFS 설명

    calls           RPC 콜이 만들어진 회수
    badcalls        RPC 계층에서 거절된 콜 회수
    badxids         The number of times a reply  from  a  server
                         was received which did not correspond to any
                         outstanding call.
    timeouts        서버로부터 응답이 없어 타임아웃된 회수
    newcreds        인증정보가 갱신된 회수
    badverfs        The number of times the call failed due to a
                         bad verifier in the response.
    timers          The number of times the calculated  time-out
                         value  was  greater  than  or  equal  to the
                         minimum specified time-out value for a call.
    cantconn        The number of times the call failed due to a
                         failure to make a connection to the server.
    nomem           메모리 할당 실패로 인한 호출 실패 회수
    interrupts      처리가 완료되기전 시그널에 의해 중단된 콜 회수
    retrans         클라이어늩에서 서버로부터 응답을 기다리는 도중 타임아웃되어 재전송한 회수. (connection-less인 경우)
    cantsend        클라이언트에서 RPC 요청을 보낼 수 없는 회수. (connection-less인 경우)
    

솔라리스의 NFS 기본 소개

솔라리스 2009/08/27 13:51 Posted by Sun
솔라리스의 NFS 기본 소개
Vishal Padwal, 2008년 8월

네트워크 파일 시스템 (NFS) 은 클라이언트-서버 어플리케이션으로 유저들이 원격 시스템이 있는 파일들을 마치 로컬 시스템이 있는 것들 처럼 보고 수정하고 저장할 수 있습니다.

참고: 이 팁에서의 정보들은 비록 가끔 NFSv2 와 NFSv3 에 대해 다루기도 하지만 일반적으로 솔라리스9 혹은 10 그리고 NFS 버전 4(NFSv4) 와 관련되어 있습니다.

NFS 환경

NFS 환경은 두가지 컴포넌트들로 구성되어 있습니다:

  • NFS 서버, 다른 시스템들과 공유될 파일 리소스들을 가지고 있음
  • NFS 클라이언트, 네트워크를 통하여 공유된 파일 리소스들을 마운트 함으로써 로컬 시스템에 있는 것 처럼 사용함

NFS 서버 파일

  • /etc/dfs/dfstab 은 부팅시에 공유될 자원들의 목록을 가지고 있음.
  • /etc/nfs/nfslogd.conf NFS 서버 로깅을 위해 사용되는 로그들의 설정 정보들을 정의함.
  • /etc/dfs/sharetab NFS 서버에 의해 현재 공유되는 로컬 리소스들의 목록.
  • /etc/rmtab NFS 클라이언트에 의해 마운트 되는 파일 시스템들의 목록. 절대 수정하지 말것.
  • /etc/nfs/nfslog.conf NFS 서버 로깅을 위해 사용되는 로그들의 설정 정보들에 대한 정보 목록.

dfstab 파일의 포맷

 
# cat /etc/dfs/dfstab
# Place share(1M) commands here for automatic execution
# on entering init state 3.
#
# Issue the command 'svcadm enable network/nfs/server' to
# run the NFS daemon processes and the share commands, after adding
# the very first entry to this file.
#
# share [-F fstype] [-o options] [-d "<text>"] <pathname> [resource]
# .e.g,
# share -F nfs -o rw=engineering -d "home dirs" /export/home2

예를 들어, 읽기 전용 모드로 공유된 /export/home/<dir_name> 홈디렉토리를 가지려고 한다면:

 
share -o ro /export/home/<dir_name>

솔라리스10 에서의 NFS 서버 데몬들

데몬들에 대한 설명:

  • mountd 는 원격 시스템에서의 파일 시스템 마운트 요청을 처리하고 접근 제어 권한을 제공함. NFSv4 에서는 사용되지 않음.
  • nfsmapid 는 NFS 유저 및 그룹 ID 매핑 데몬이고 NFSv4 에서 사용 됨.
  • nfsd 은 NFSv4 에서 사용되고 클라이언트 파일 시스템 요청을 처리함.
  • statdlockd 데몬과 같이 동작하여 크래시 복구 및 락 메니저를 위한 기능들을 제공함.
  • lockd 은 NFS 파일들의 락 작업을 지원함.
  • nfslogd 은 NFSv2 및 v3 에 대한 작업 로깅 기능을 제공함.

솔라리스10 및 NFSv4 에서는 NFS 지원을 위해서 오직 두개의 데몬만이 필요 합니다: nfsmapidnfsd. mountdlockd 데몬은 합쳐 졌고, nfsmapidnfsd 는 NFSv4 내에서 포트 2049 를 통해서 지원되고 이를 통해서 파이어월을 사용하는 환경에서의 NFS 지원을 향상 시켰습니다.

만약 솔라리스10에서 NFSv2 혹은 v3 를 사용하기를 원한다면 모든 데몬들은 지원 됩니다.

NFS 서버 서비스 시작 및 중지 시키기

svc:/network/nfs/server 서비스는 시스템이 런레벨 3에 진입했을때 NFS 서버 데몬을 시작시킵니다.

NFS 서버 데몬을 수동으로 시작시키려고 한다면, 아래의 커맨드를 이용합니다:

 
# svcadm enable svc:/network/nfs/server

NFS 서버 데몬을 수동으로 정지시키려고 한다면, 아래의 커맨드를 이용합니다:

 
# svcadm disable svc:/network/nfs/server

NFS 의존성 확인하기

svcs 커맨드를 이용해서 의존성을 확인합니다:

 
# svcs | grep nfs
# svcs -l nfs/server

NFS 서버 커맨드들

  • shareall/etc/dfs/dfstab 의 구문들을 읽어내서 실행함..
  • shares 는 NFS 서버상의 로컬 디렉토리가 마운트 될 수 있도록 함.
  • dfshares 는 매개변수 없이 실행되면 현재 공유된 리소스들을 보여 줌.
  • dfmount 는 현재 마운트된 NFS 서버상의 디렉토리들의 목록을 보여 줌.
  • unshare 는 파일 리소스들이 더이상 마운트되지 않도록 함.

NFS 서버 설정하기

구문:

 
# share [-F <FSType>] [-o <option>] [<pathname>]

여기서 각각의 옵션은:

  • -F <FSType> 파일 시스템의 종류 지정.
  • -o <option> 공유될 리소스들에 대한 접근 제어 옵션들 지정, 예를 들어 읽기-전용 접근 등.
  • <pathname> 공유하고자 하는 리소스의 절대 경로 이름 지정.

예를 들어 여러분이 /export/home/<dir_name> 디렉토리를 공유하고자 한다면, /etc/dfs/dfstab 파일에 다음과 같은 항목을 생성합니다:

 
#share -F nfs -o ro /export/home/<dir_name>

이 예제에서, -F 는 NFS 파일 시스템을, , -o ro 는 공유된 리소스에 대한 접근이 읽기 전용임을 지정하고, /export/home/<dir_name> 는 해당 리소스의 절대 경로를 나타 냅니다.

유사하게 -o rw 옵션을 이용하고, <pathname> 을 지정함으로써 읽기/쓰기 권한을 모든 클라이언트들에 줄 수 있으며, 또한 -o root=<dir_name> 를 통해서 <dir_name> 디렉토리의 루트 권한을 활성화 시킬 수 있습니다.

파일 리소스 마운트 해제 하기

구문:

 
# unshare [-F <FSType>] [<pathname>]

예를 들어:

 
#unshare -F nfs /export/home/<dir_name>

리모트 파일 시스템 마운트하기

구문:

 
mount [-F <FSType>] [-o <options>] <server>:<pathname> [<mount_point>]

예를 들어:

 
# mount -F nfs -o ro  gladiator:/export/home/<dir_name> /mymountpoint

여기서 각각의 옵션은:

  • Gladiator 는 원격 서버의 이름.
  • /export/home/<dir_name> 은 원격 파일 리소스.
  • /mymountpoint 는 마운트 포인트 이고 /export/home/<dir_name> 은 공유된 리소스임.

또 다른 예제로는:

 
# mount -o ro Gladiator,Sun,Moon :/Central_data /mymountpoint

두번째 예제에서, 만약 Gladiator 시스템에 접근이 불가능하다면, 요청이 Sun 이라고 하는 두번째 시스템으로 자연스럽게 넘어갈 것입니다.

클라이언트에서 원격 파일 시스템 언마운트 하기

구문:

 
umount [<mount_point>]

예를 들어:

 
# umount /mymountpoint

부트 시에 원격 리소스 마운트 하기

원격 파일 시스템을 부트 시에 마운트 하기 위해서, /etc/vfstab 에 항목을 만듭니다.

예를 들어 다음의 항목을 /etc/dfstab 파일에 추가합니다:

 
Gladiator:/export/home/<dir_name>  - /mymountpoint nfs - yes bg

여기서 각각의 옵션은:

  • 마운트 할 디바이스는Gladiator:/export/home/<dir_name>
  • fsck 를 수행할 디바이스는 -
  • 마운트 포인트는 /mymountpoint
  • FS 종류는 nfs
  • fsck pass-
  • 부팅시에 마운트에 대한 여부는yes
  • 마운트 옵션은bg (백그라운드)
Posted by redkite
, |

0019. [솔라리스] SNMP 데몬 중지 및 비활성화

svcadm disable svc:application/management/sma:default

svcadm disable svc:application/management/dmi:default

svcadm disable svc:/network/sendmail-client:default

 

 

솔라리스(Solaris) 10 net-snmp 설치 방법

 

* SPARC 과 x86 설치방법은 모두 동일하며 지원하는 파일만 다르므로 sunfreeware 사이트 우측에서 설치할 솔라리스 버전이 sparc 인지 x86인지 구분하여 파일을 다운받는다.

* 아래의 설치 방법은 x86기준으로 설명.

 

1. www.sunfreeware.com 사이트에 접속해서 netsnmp-5.4.2.1 을 다운받는다.

(바로가기link - http://www.sunfreeware.com/programlistintel9.html#netsnmp)

2. netsnmp-5.4.2.1-sol9-x86-local.gz 파일을 다운받는다.

3. 다운받은 폴더로 이동

4. # gunzip netsnmp-5.4.2.1-sol9-x86-local.gz

5. # pkgadd -d netsnmp-5.4.2.1-sol9-x86-local

6. 설치도중 묻는 질문에 all 을 입력하고 엔터

7. 설치 끝 ( netsnmp-5.4.2.1 다운받는곳 설명 보면 netsnmp 를 설치하기 위해 openssl, libgcc, gcc 를 설치해야 한다고 한다.)

8. 솔라리스 설치시 기본으로 실행되는 snmp 데몬이 떠있는지 확인한다.

# ps -ef | grep snmp

* 아마도 /usr/sfw/sbin/snmpd

/usr/lib/snmp/snmpdx -y -c /etc/snmp/conf

/usr/lib/dmi/snmpXdmid -s sgn

이렇게 새개가 떠있을 것이다.

9. 실행중인 데몬을 중지시키고, 서비스를 중지시킨다.

# svcadm disable svc:application/management/dmi:default

# svcadm disable svc:application/management/snmpdx:default

# svcadm disable svc:application/management/sma:default

10. # ps -ef | grep snmp 실행후 서비스 중지 확인

 

11. EXAMPLE.conf 파일을 /usr/local/share/snmp 폴더에 복사한다.

# cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf

12. snmpd.conf 파일을 수정한다.

*** 수정할 부분 *******

# sec.name source community

com2sec local localhost public

com2sec mynetwork 192.168.2.0/24 public

 

13. 시스템 재 부팅 후 자동실행할 경우 자동실행 스크립트를 작성한다.

# cd /etc/rc3.d

# vi S78net-snmp

#!/sbin/sh


# /etc/rc3.d/S78net-snmp
#
# pkill has moved over the years so we need to find it
#
LD_LIBRARY_PATH=/usr/lib:/lib:/usr/share/lib:/usr/local/lib:/usr/local/ssl/lib
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH LD_LIBRARY_PATH

X=`which pkill`

case "$1" in
'start')
/usr/local/sbin/snmpd
;;

'stop')
$X -TERM -x -u 0 snmpd
;;

*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0

 

14. 새로 설치한 net-snmpd 를 구동한다.

#/usr/local/sbin/snmpd

15. # ps -ef | grep snmp 실행 후 snmpd 가 실행된 것을 확인

 

16. 설치끝.!

[출처] 솔라리스(Solaris) 10 net-snmp 설치 방법|작성자 록수

 

SNMP 데몬 중지 및 비활성화

Sun Management Center 에이전트는 기본적으로 UDP(User Datagram Protocol) 포트 161을 사용하여 Sun Management Center 서버와 통신합니다. Sun Management Center 에이전트는 기본적으로 포트 161을 사용하는 SNMP 에이전트인 snmpdx와 Sun SNMP 유틸리티인 mibissa를 완전히 대체할 수 있는 보다 향상된 에이전트입니다.

SNMP 에이전트 snmpdx는 Solstice Enterprise Agent 기술의 주요 구성 요소입니다. snmpdx 및 mibissa는 데몬 프로세스로 실행되며 161 포트에서 SNMP 요청을 수신합니다.

주 –

(Solaris 10의 경우) 포트 161을 사용하는 경우, SNMP 데몬 SMA를 수동으로 중지하고 비활성화하라는 메시지가 표시됩니다.

 

Sun Management Center를 설정하는 동안 포트 161이 사용 중이면 Sun Management Center 에이전트 및 서버에 대해 다른 포트를 지정하거나 포트 161을 계속해서 사용할 수 있는 옵션이 제공됩니다. 포트 161을 사용하도록 선택하는 경우, SNMP 에이전트 데몬을 중지하고 비활성화하라는 옵션이 제공됩니다.

주의 –

161 포트를 사용하며 수동으로 SNMP 데몬을 중지 및 비활성화하는 경우 161 포트를 사용하는 프로세스를 모두 중지해야 Sun Management Center가 시작됩니다.

 

다음 절차는 Sun Management Center 에이전트가 설치된 모든 시스템에 적용됩니다.

snmpdx를 수동으로 중지 및 비활성화

  1. 루트로 로그인합니다.
  2. 다음을 입력하여 snmpdx 데몬을 비활성화합니다.

 

# svcadm disable svc:/application/management/snmpdx

  1. 주 –
  2. 대문자 "S"로 시작하는 이름의 스크립트는 시스템이 재부팅될 때 자동으로 시작됩니다. 소문자 "s"로 시작하는 이름의 스크립트는 자동으로 시작되지 않습니다.

일반 오류

시스템에 포트 161을 사용하는 다른 레거시 SNMP 에이전트 또는 프로세스가 있을 수 있습니다. snmpdx를 중지하고 비활성화해도 Sun Management Center가 시작되지 않으면 agent.log 파일(/var/opt/SUNWsymon/log/agent.log)에서 포트 충돌이 있는지 확인하십시오.

SMA를 수동으로 중지 및 비활성화

  1. 루트로 로그인합니다.
  2. 다음을 입력하여 SMA 데몬을 중지 및 비활성화합니다.

 

# /etc/init.d/init.sma stop

Posted by redkite
, |

prstat나 top으로 메모리 사용량을 볼 수 잇다고 하는데
cpu사용량, process image size와 resident set size정도 볼 수 있던데..
메모리를 어디서 본다는 건지...
아시는 분 있으시면 갈켜주세요..
아, 그리고 process image size와 resident set size가 뭐죠?

 

[답변] 여러가지 경우가 있어서 나누어서 답변을 드리겠습니다.
솔라리스에서 프로세스에 관한 정보를 볼수 있는 여러가지 툴을 제공하고 있습니다.
간단히 정리해 보면
(1) ps
(2) prstat
(3) /usr/dt/bin/dtprocess & (CDE 환경에 있는 것입니다.)

위에 설명한 어떠한 툴을 사용하더라도 비슷한 결과를 보여 줌니다. 현재 저는 CDE환경에서 자주 쓰는 dtprocess를 많이 쓰고 있습니다. 예를 들어 현재 떠있는 프로세스 중 메모리를 가장 많이 쓰고 있는 프로세스를 찾고 싶다면.
# /usr/dt/bin/dtprocess &
툴이 뜨면 툴중에 "RAM"이라고 쓰여진 부분을 클릭하면 RAM 사용량 별로 sort가 됩니다.

그리고 CPU 사용량이 많은 프로세스를 찾고 싶다면 dtprocess를 띄워서 "CPU%" 라는 부분을 클릭하면 CPU 사용량 별로 sort를 해 줍니다.

참고하시라고 썬에서 제공되는 기술문서 중 일부를 공개합니다. 잘 보시면 많은 것을 알 수가 있을 것 같습니다.

[ SUN 기술자료 ]
23. 시스템 부하 측정

1. 용량 확인
1.1 Sun O/S 일 경우
# df
1.2 Solaris일 경우
# df -k
(참고)만약 root filesystem이 90% 이상일 경우 홈페이지에있는 find 명령어 사용법을 참조하여
비정상적으로 생성된 file을 삭제하라. 그리고 root filesystem에 user의 directory가 있는지
살펴 보아라. 특히 backup 시 device 명을 잘못 주어서 file로 저장되어서 시스템이 full 되는
경우가 많음
(참고) Find 명령어 사용법
1. /usr에 50,000 characters보다 큰 화일 찾아라.
# find /usr -type f -size +50000c -print
2. core file을 삭제하라.
# find / -name core -type f -exec rm {} \;
3. /usr/src에서 이름이 mem*.c인것을 찾아라.
# find /usr/src -type f -name "mem*.c" -print
4. owner가 root이고 set-user-ID를 가지는 모든 화일을 찾아라.
# find / -perm -04000 -user root -type f -exec ls -l {} \;
5. 최근 이틀내에 쓰여진 화일을 찾아라.
# find /usr -ctime -2 -print
6. 최근 이틀내에 쓰여지고 크기가 10,000byte이상인 화일이나 디렉토리를 찾아라.
# find /usr -ctime -2 -size +10000c -exec ls -l {} \;



2. CPU 용량 check
2.1 MP Control and Monitoring
* Processor control and information
* psrinfo - 사용가능한 CPU를 보여준다.
# psrinfo
0 on-line since 09/05/97 10:49:27
2 on-line since 09/05/97 10:49:31
* psradm - Enable or disable CPUs
# psradm -f 2 -> 2번 CPU를 off-line
# psrinfo
0 on-line since 09/05/97 11:16:04
2 off-line since 09/05/97 11:18:34
# psradm -n -a -> 모든 process를 on-line
2.2 CPU Rules for the SOlaris 2.x Operating Environment
- vmstat 30 or mpstat 30
conditionConclusion
0 == rCPU idle
0 < r / ncpus < 3.0No problem
3.0 <= r / ncpus <= 5CPU busy
5.0 <= r /ncpusCPU very busy
smtx < 200No problem
200 <= smtx < 400Mutex stall
400 <= smtxMutex stall


- psrinfo | grep -c on (CPU 의 개수)
5. Swap space check
# vmstat 30
ConditionConclusion
100,000K <= swap Swap waste
10,000K <= swap < 100,000KNo problem
4,000K <= swap < 10,000KSwap low
1,000K <= swap < 4,000KSwap very low
swap < 1,000KNo swap

Action to Take
* Swap Low - 실행되는 프로그램 수를 줄이고, swap space를 늘려라.
* No Swap - 프로그램이 멈출 것이다. 즉시 swap space를 늘려라.
(참고) Swap space 를 늘리려면
1. Sun O/S 4.x 일경우
# mkfile 40m /user/swap  (40mb size)
# swapon /user/swap
# pstat -T    (swap size 확인)
# vi /etc/fstab
/usr/swap   swap   swap   rw 0  0
- swap file 삭제
# rm /user/swap
# vi /etc/fstab - add한 entry 를 삭제  
 
2. Solaris 2.x 일 경우
# /usr/sbin/mkfile 40m /user/swapfile 
# swap -a /user/swapfile (O/S에 swap file을 추가함) 
# swap -l 
# vi /etc/vfstab 
/user/swapfile - - swap - no - ( 이라인을 추가)
# swap -s
total : 5828kbytes allocated + 2456k reserved = 8284k used, 103792k
available
( allocated : 현재 사용, reserved : kernel이 잡아놓음 , available : 사용할수 있는양)
# swap -d /user/swapfile (swap add한 file을 삭제)
          . 

6. Memory 용량 check
# vmstat 30
ConditionConclusion
sr == 0RAM waste
0 < sr < 200No problem
200 <= sr < 300Low RAM
300 <= srVery low RAM


* Low RAM - 메모리를 증설해야한다.
7. Disk 부하 check
# iostat -x 30
* svc_t (avque + avwait) : disk 응답시간
* 10 - 50 acceptable
* 100 - 1500 not acceptable
* %b : 디스크를 얼마나 많이 쓰는가?
* 5% 이하는 무시
* 60% 이상이면 조정할 필요가있다.
8. Network 부하 Check
# netstat -i 30
ConditionConclusion
(0<output packets<10)&&(100*output colls/(output
packets)<0.5%)&&(other nets OK)Inactive network
(0<output packets<10)&&(100*output.colls/(output
packets)<1.5%)&&(other nets busy)Unbalanced
(10<=output packets)&&(0.5%<=100*output colls/output packets
<2.0%)No problem
(10 <= output packets)&&(2.0%<=100*output colls/output
packets<5.0%)Busy network
(10<=output packets)&&(5.0%<=100*output colls/output packets)Very
Busy Net
network type is not ie,le,ne or qe;it is bf or nfNot Ethernet


* Busy Network - 네트웍에 너무나 많은 충돌이 생겨서 사용자들이 응답을 기다리는 늘어나 고 throughput이
감소한다. 만약 다른 네트웍이 있다면 부하를 주는 것을 부하가없는 네트웍 으로 옮겨라. 또는 ATM 이나 100-MB
Ethernet, FDDI같은 빠른 네트웍으로 upgrade하라.
9. System error messages check
# vi /var/adm/messages
# cd /var/adm
# grep panic *
# grep error *
# grep warning *
10. system 정보 출력
# /usr/platform/'uname -i'/sbin/prtdiag (this show usefull hardware
information and failures of system)
# /etc/prtvtoc (show the detail information of disk slice ex) prtvtoc
/dev/dsk/c0t0d0s2)
# /usr/sbin/eeprom (user can set some of variables of NVRAM via this
command ex) eeprom boot-device=disk3)
# /usr/sbin/prtconf -vp ( Shows device configuration )
# devinfo -vp (Shows device configuration for Solaris 1.x)
# /usr/sbin/sysdef ( Shows software configuration )
# /usr/bin/dmesg | more ( collect system diagnostic messages to form error
log
# /usr/proc/bin/ptree (Process trees that contain the process)
# /usr/proc/bin/pwdx pid ( Current working directory for a process)
# /usr/proc/bin/pldd pid ( Dynamic libraries linked into a process)
# /usr/proc/bin/pmap pid ( Address space map)

11. Performance gathering script
date >> /sunsolv/hangdata/vmstat.out
vmstat 30 10 >> /sunsolv/hangdata/vmstat.out
date >> /sunsolv/hangdata/iostat.out
iostat -xtc 30 10 >> /sunsolv/hangdata/iostat.out
date >> /sunsolv/hangdata/ps.out
/usr/ucb/ps -aux >> /sunsolv/hangdata/ps.out
date >> /sunsolv/hangdata/kmstat.out
echo kmastat | crash >> /sunsolv/hangdata/kmstat.out
date >> /sunsolv/hangdata/kernelmap.out
echo "map kernelmap" | crash >> /sunsolv/hangdata/kernelmap.out
위 명령어를 매 15분 마다 실행 하도록 crontab에 등록해놓는다.

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함