728x90
반응형
출처 : https://www.ucert.co.kr/tech/sslinstall/iis7_single.html
1. 인증서 가져오기

1) [시작] > [프로그램] > [관리도구] > [IIS(인터넷 정보 서비스)관리자]를 선택합니다.

2) 서버 인증서를 더블 클릭 > 마우스 오른쪽 > 가져오기를 선택합니다.



3) 인증서 파일을 찾은 후 암호를 입력합니다.




4) 다음과 같이 인증서가 추가된 내용을 확인합니다.


2. 인증서 설치

1) SSL인증서를 설치 할 웹사이트 목록의 마우슨 오른쪽을 클릭 하시여 바인딩 편집을 선택 합니다.




2) 추가를 클릭하여 SSL 서비스를 클릭합니다.

- 종류: https > 포트번호 입력 (Default는 443입니다) > SSL 인증서 항목을 확장하신 후 등록하신 인증서를 선택 합니다.



3) 추가된 인증서를 확인하신 후 닫기를 클릭 합니다.

3. 포트 활성화 확인

Netstat -na 명령어를 사용하여 443포트가 Listening되어있는지 확인합니다.

만약 활성화 상태이지만 외부에서 접속이 안 되신다면 방화벽설정을 확인 부탁 드리겠습니다.

Microsoft Windows XP [Version 6.0.6001]
Copyright 1985-2005 Microsoft Corp.


C:\User\Administartor> netstat -na (443포트 Listening 확인 명령어 입력) 

활성 연결 

  • 프로토콜
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • TCP
  • 로컬주소
  • 0.0.0.0:80
  • 0.0.0.0:135
  • 0.0.0.0:443
  • 0.0.0.0:445
  • 0.0.0.0:49152
  • 0.0.0.0:49153
  • 0.0.0.0:49154
  • 0.0.0.0:49155
  • 0.0.0.0:49156
  • 192.168.0.15:139
  • [::]:80
  • [::]:135
  • [::]:443
  • [::]:445
  • [::]:49152
  • [::]:49153
  • [::]:49154
  • 외부주소
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • 0.0.0.0:0
  • [::]:0
  • [::]:0
  • [::]:0
  • [::]:0
  • [::]:0
  • [::]:0
  • 상태
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING
  • LISTENING



IIS, IIS SSL, IIS SSL 설정 변경, IIS 인증서, IIS 인증서 교체, SSL

728x90
반응형
728x90
반응형

문 서 명 : Windows Log 압축하는 배치명령

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  Summary

작 성 일 : 2017 05 04

작 성 자 : 우리들의 삶

테 스 트 환 경 : Windows 2012 R2

출 처 : 


본 문서는 forfiles 명령과 zip.exe 파일을 이용하여 윈도우에 생기는 로그들을 자동으로 압축하고, 기간 단위로 삭제하는 명령을 만들어 본다.

먼저 압축하기 위해서는 선행과제로 zip.exe 가 설치되어 있어야 한다. 

zip.exe는 실제 설치파을은 아니고, 압축(zip) 파일을 만들 수 있게 하는 프로그램인데, CLI 환경에서 개별동작 한다.


다음은 상황별 예시문이다.


1. C:\log 폴더에서 파일명이 Archive 로 시작하고, .evtx로 끝나는 수정일이 0일된 파일들을 모두 압축하라

forfiles /P C:\log /M Archive*.evtx /D -0 /C "cmd /c C:\zip.exe -rm @file.zip @file"
/P : 경로, 지정하지 않을 시 cmd가 위치한 현재 디렉터리가 기준이 된다.
/M : 파일명 조건 
/D : 수정일 기준 기간 예를들어 30일 지난 파일을 추리고 싶을 땐 -30 을 입력
/C : forfiles 수행 후 실행될 명령으로 " "(따움표)를 붙여야 처리된다.
 @file    - 파일 이름을 반환합니다.
 @fname   - 확장명 없이 파일 이름을 반환합니다.
 @ext     - 파일의 확장명만 반환합니다.
 @path    - 파일의 전체 경로를 반환합니다.
 @relpath - 파일의 상대 경로를 반환합니다.
 @isdir   - 파일 형식이 디렉터리인 경우 "TRUE"를 반환하고 파일인 경우 "FALSE"를 반환합니다.
 @fsize   - 파일의 크기(바이트)를 반환합니다.
 @fdate   - 파일을 마지막으로 수정한 날짜를반환합니다.
 @ftime   - 파일을 마지막으로 수정한 시간을 반환합니다.

zip.exe -rm : 파일을 압축할때 원본(압축이 되지 않는 파일)을 없애고, 압축파일만 남긴다.



forfiles /P D:\test /D -4 /C "cmd /c rmdir /s /q @file"
D:\test 에 있는 4일 지난 폴더를 삭제한다


forfiles /P D:\test /M Archive*.evtx /D -4 /C "cmd /c del /q @file"
D:\test 폴더 내 파일명이 Archive로 시작하고, .evtx 로 끝나는 4일 지난 파일을 삭제한다.


TIP : 리눅스 압축하기 

find /home/user/rep/tests/data/archive/* -maxdepth 0 -type d -exec zip -r "{}" "{}" \;




윈도우 자동압축, 윈도우 로그 압축, 윈도우 로그, 윈도우 로그 압축방법, 윈도우 압축 배치, 윈도우 압축 배치파일, 윈도우 로그 자동 압축 배치

728x90
반응형
728x90
반응형

문 서 명 : FTP 553 Could not create file 에러 메시지 조치 방법

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  □ Summary

작 성 일 : 2016 12 21

작 성 자 : 우리들의 삶

테 스 트 환 경 : RHEL 6.7, SELINUX

출 처 : 본인


본 문서는 Linux 환경에서 FTP 이용 시 업로드 디렉토리의 파일 쓰기 권한이 있는데도, 
파일 쓰기가 안될 경우 조치하는 방법에 대해 서술한다.


1. 증상(Client -> Server, FTP 이용 중)

ftp> put linux.sh

local: linux.sh remote: linux.sh

200 PORT command successful. Consider using PASV.

553 Could not create file.

 

 

 

 2. 조치 방법
먼저 업로드 디렉터리에서 FTP 접근한 계정의 쓰기 권한이 있는지 확인한다.
대부분 FTP 접근 계정의 권한 문제로 디렉터리의 권한을 주거나, 계정을 변경하면 될 문제지만, 이 경우가 아닐 경우

selinux 설정을 확인한다.

[root@test]# cat /etc/sysconfig/selinux

 

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=enforcing

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

 
이 경우 enforcing 의 구문을 disabled 로 변경하고 재부팅을 해야 적용이 되지만,
대부분의 경우 재부팅이 힘들 것이다. 이럴 경우 다음과 같이 ftpd 데몬에 대해 엑세스 권한을 준다.

 

[root@test]# setsebool -P allow_ftpd_full_access on



FTP 553 Could not create file 에러. 553 Could not create file, vsftpd, vsftpd error, ftp 쓰기 에러

728x90
반응형
728x90
반응형

가끔 리눅스를 한글로 설치하시면, 한글이 깨지는 경우가 생깁니다..


그럴 때, 다음과 같이 설정하시면, 한글 깨짐 현상을 수정하실 수 있습니다!!



1. 현재 설정된 인코딩 설정 확인

[root@localhost etc]$ echo $LANG
ko_KR.UTF-8

2. 인코딩 설정 해제
[root@localhost sysconfig]# unset LANG
[root@localhost sysconfig]# LANG=C

3. 사용 가능한 인코딩 설정 확인
[root@localhost etc]$ locale -a | grep ko
ko_KR
ko_KR.euckr
ko_KR.utf8
korean
korean.euc
ru_RU.koi8r
ru_UA.koi8u
tg_TJ.koi8t
uk_UA.koi8u

4. /etc/sysconfig/i18n 파일 수정

[root@localhost sysconfig]# vi i18n 
#LANG="ko_KR.UTF-8"
LANG="ko_KR.euckr"

728x90
반응형
728x90
반응형

문 서 명 : VM 환경의 Linux OS 디스크 사이즈 늘리기

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  □ Summary

작 성 일 : 2016 10 25

작 성 자 : 우리들의 삶

테 스 트 환 경 : ESXi 5.5, RHEL 6.7, LVM 2.0

출 처 : 본인

본 문서는 VM 환경의 Linux system에 대해 디스크 사이즈를 확장하는 방법을 명시한다.
만약 LVM에 대한 개념정리가 필요하신 분은 다음 글을 사전에 읽어보기를 권장한다.




VM 환경의 Linux System에 대해 디스크 사이즈를 늘리고자 한다면 다음과 같은 수순을 거치게 된다.


1. VM설정에서 디스크 사이즈 확장
2. OS에서 fdisk 명령을 통해 disk label 정의
3. 재부팅
4. 새로만든 공간을 PV로 정의(pvcreate)
5. VG에 PV를 넣어줌(vgextend)
6. LV에 용량을 늘려줌(lvexted)
7. 최종으로 할당된 LV공간을 볼륨이 재인식하는 과정(resize2fs )


1. VM 설정에서 디스크 사이즈 확장


2. OS에서 fdisk 명령을 통해 disk label 정의

[root@testsvrdwa01 ~]# fdisk -l

Disk /dev/sda: 193.3 GB, 193273528320 bytes  <늘어난 용량 체크
255 heads, 63 sectors/track, 23497 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b22b4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        3264    25701376   8e  Linux LVM
/dev/sda3            3264       10051    54520257+  8e  Linux LVM

[root@testsvrdwa01 ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sda: 193.3 GB, 193273528320 bytes
255 heads, 63 sectors/track, 23497 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b22b4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        3264    25701376   8e  Linux LVM
/dev/sda3            3264       10051    54520257+  8e  Linux LVM


Command (m for help): n  
Command action
   e   extended
   p   primary partition (1-4)
p  <- 만약 차후 더 확장할 계획이 있다면 e 키를 눌러 extended 로 하여야 한다.
Selected partition 4 <- 현재 시스템은 1~3번까지 쓰고 있으므로 4번
First cylinder (10052-23497, default 10052): 10052
Last cylinder, +cylinders or +size{K,M,G} (10052-23497, default 23497):
Using default value 23497

Command (m for help): p

Disk /dev/sda: 193.3 GB, 193273528320 bytes
255 heads, 63 sectors/track, 23497 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b22b4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        3264    25701376   8e  Linux LVM
/dev/sda3            3264       10051    54520257+  8e  Linux LVM
/dev/sda4           10052       23497   108004995   83  Linux  <- 4번 볼륨이 추가됨

Command (m for help): t  <- change a partition's system id
Partition number (1-4): 4 <- 4번 볼륨 선택
Hex code (type L to list codes): 8e <- Linux LVM용으로 만들기 위해 partition system id를 8e 로 정의한다.
Changed system type of partition 4 to 8e (Linux LVM)

Command (m for help): w  <- 설정한 내용을 저장
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: 장치나 자원이 동작 중.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.




3. 재부팅

[root@testsvrdwa01 ~]# init 6




4. 새로만든 공간을 PV로 정의(pvcreate)

[root@testsvrdwa01 ~]# pvcreate /dev/sda4  <- 방금 정의한 볼륨을 PV로 만들어 준다.
  Physical volume "/dev/sda4" successfully created

[root@testsvrdwa01 ~]# pvs  <- 확인
  PV         VG     Fmt  Attr PSize   PFree 
  /dev/sda2  vg_test lvm2 a--   24.51g      0
  /dev/sda3  vg_test lvm2 a--   51.99g      0
  /dev/sda4         lvm2 ---  103.00g 103.00g  <- PV로 만들어졌고, 아무런 VG에 속하지 않는것이 보인다.




5. VG에 PV를 넣어줌(vgextend)
[root@testsvrdwa01 ~]# vgs  <- 설정 전 확인
  VG     #PV #LV #SN Attr   VSize  VFree
  vg_test   2   3   0 wz--n- 76.50g    0

[root@testsvrdwa01 ~]# vgextend vg_test /dev/sda4   <- vgextend vg_name pv_path
  Volume group "vg_test" successfully extended

[root@testsvrdwa01 ~]# vgs  <- 늘어난 공간 확인
  VG     #PV #LV #SN Attr   VSize   VFree 
  vg_test   3   3   0 wz--n- 179.50g 103.00g



6. LV에 용량을 늘려줌(lvexted)

[root@testsvrdwa01 ~]# lvextend /dev/vg_test/lv_home -l +100%FREE   <- lv_home을 vg 남은 공간 전체로 확장한다.
  Size of logical volume vg_test/lv_home changed from 40.00 GiB (10240 extents) to 143.00 GiB (36608 extents).
  Logical volume lv_home successfully resized

[root@testsvrdwa01 ~]# lvs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_home vg_test -wi-ao---- 143.00g                                                   
  lv_root vg_test -wi-ao----  20.51g                                                   
  lv_swap vg_test -wi-ao----  15.99g                                       




7. 최종으로 할당된 LV공간을 볼륨이 재인식하는 과정(resize2fs )

[root@testsvrdwa01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_test-lv_root
                       21G  4.5G   15G  24% /
tmpfs                 5.9G     0  5.9G   0% /dev/shm
/dev/mapper/vg_test-lv_home
                       40G   30G  7.7G  80% /home
/dev/sda1             477M   42M  410M  10% /boot
           
[root@testsvrdwa01 ~]# resize2fs /dev/vg_test/lv_home
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/vg_test/lv_home is mounted on /home; on-line resizing required
old desc_blocks = 3, new_desc_blocks = 9
Performing an on-line resize of /dev/vg_test/lv_home to 37486592 (4k) blocks.
The filesystem on /dev/vg_test/lv_home is now 37486592 blocks long.

[root@testsvrdwa01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_test-lv_root
                       21G  4.5G   15G  24% /
tmpfs                 5.9G     0  5.9G   0% /dev/shm
/dev/mapper/vg_test-lv_home
                      141G   30G  104G  23% /home
/dev/sda1             477M   42M  410M  10% /boot
[root@testsvrdwa01 ~]#



리눅스 디스크 사이즈 확장, 리눅스 용량 확장, 리눅스 용량 증설, Redhat Disk expended, resize2fs, vgextend, lvextend

728x90
반응형
728x90
반응형

안녕하세요 우리들의 삶입니다.


해당 옵션들은 Solaris 10 이상에서만 적용되며, 

하위 버전은 패스워드 사용 최대기간, 최소 기간, 패스워드 최소 길이 정도 밖에 적용 안될겁니다..



vi edit를 통해 /dev/default/passwd 편집 합니다.


#패스워드 최대 사용 기간

# 주 단위 설정

MAXWEEKS=8


#패스워드 최소 사용 기간

# 주 단위 설정

MINWEEKS=1


# 패스워드 최소 길이

PASSLENGTH=8




# 아래는 Solaris 10버전부터 가능한 옵션


# 사용자의 패스워드와 아이디가 같은 경우를 검증

NAMECHECK=YES 


# 이전 패스워드 기억 갯수(최대 26개 기록가능)

HISTORY=10


# 이전 암호와 최소 3개가 틀려야 한다. 

MINDIFF=3


# 문자 2글자 이상

MINALPHA=2


# 숫자 또는 기호 4자 이상

MINNONALPHA=4


# 대문자 사용(0 미사용, 1 사용)

MINUPPER=1


# 소문자 사용(0 미사용, 1 사용)

MINLOWER=1


# 비슷하 암호 반복 사용 불가(0 미사용, 1 사용)

MAXREPEATS=0


# 특수문자 사용(0 미사용, 1 사용)

MINSPECIAL=1


# 숫자 포함(0 미사용, 1 사용)

MINDIGIT=1


# 공백 허용

WHITESPACE=YES

728x90
반응형
728x90
반응형

문 서 명 : Redhat Linux LVM 관리

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  □ Summary

작 성 일 : 2016 04 19

작 성 자 : 우리들의 삶

테 스 트 환 경 : Redhat Entprise Linux 6.7

출 처 : 본인


본 문서는 Redhat계열 Linux6 버전에서 LVM관리에 대한 내용을 기술한다.

  1. 개요 




물리디스크(PP)를 PV(Phisycal Volume)로 변환하고, PV 단수, 혹은 복수를 VG(Volume Group)로 만들게 되면
일정한 크기의 PE가 만들어진다.(디스크 섹터와 비슷한 개념)

그리고 VG의 일부 공간 혹은 전체를 LV(Logical Volume)으로 할당하게 되면, 할당 받은 공간만큼 LE(디스크 섹터와 비슷한 개념)가 만들어 진다.

  1. 디스크 확인
[root@hsy-test ~]# fdisk -l

Disk /dev/sda: 17.2 GB, 17179869184 bytes
64 heads, 32 sectors/track, 16384 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e305e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           2         501      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2             502       16384    16264192   8e  Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/vg_hsytest-lv_root: 14.9 GB, 14935916544 bytes
255 heads, 63 sectors/track, 1815 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_hsytest-lv_swap: 1715 MB, 1715470336 bytes
255 heads, 63 sectors/track, 208 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdb: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


  1. PV 만들기
[root@hsy-test ~]# pvcreate /dev/sdb   <-- PV(Phisycal Volume) 생성 명령어

[root@hsy-test ~]# pvs  <-- PV 리스트 확인, # pvdisplay  명령을 통해서도 확인 가능
  PV         VG         Fmt  Attr PSize  PFree
  /dev/sda2  vg_hsytest lvm2 a--  15.51g    0
  /dev/sdb              lvm2 ---   1.00g 1.00g  <-- 물리디스크 /dev/sdb 가  LVM2버전으로 PV 전환되었음을 알 수 있다.



  1. VG 만들기

[root@hsy-test ~]# vgcreate vg_raw /dev/sdb  <-- VG(Volume Group) 생성 명령어, 만약 여러개의 PV를 묶어 Pool 처럼 만들고자 할 때에는 띄어쓰기하여 디스크 장치를 명시해준다.
  Volume group "vg_raw" successfully created

[root@hsy-test ~]# vgs  <-- VG 리스트 확인 # vgdisplay 명령을 통해서도 확인 가능
  VG         #PV #LV #SN Attr   VSize    VFree   
  vg_hsytest   1   2   0 wz--n-   15.51g       0
  vg_raw       1   0   0 wz--n- 1020.00m 1020.00m


  1. LV 만들기

[root@hsy-test ~]# lvcreate -n dev1G1 -L 100M vg_raw
  Logical volume "dev1G1" created.
TIP : 
-n : LV Name을 지정
-L : LV Size를 지정
vg_raw : LV가 속할 VG를 명시

[root@hsy-test ~]# lvs  <- LV 리스트 확인, # lvscan 혹은 # lvdisplay 명령으로도 확인 가능
  LV      VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_root vg_hsytest -wi-ao----  13.91g                                                   
  lv_swap vg_hsytest -wi-ao----   1.60g                                                   
  dev1G1  vg_raw     -wi-a----- 100.00m

[root@hsy-test ~]# ls -al /dev/vg_raw/dev1G1  <-- 해당 위치를 mkfs 명령을 통해 포맷하여 mount 하면 된다.
lrwxrwxrwx. 1 root root 7 2016-04-18 11:03 /dev/vg_raw/dev1G1 -> ../dm-2

tip : /dev/VG_name/LV_name



  1. LV 여러개를 만들어야 될 때
#!/bin/sh
index=1

while [ ${index} -le 42 ];do
 lvcreate -n dev10G${index} -L 10G vg_raw
 index=$((index + 1))
done

tip : 
index변수 : 총 몇개의 LV를 생성할 것인지를 정의하는 변수로 초기 값은 1을 가진다.
while 조건문 : -le 의 뜻은 '크거나 같다' 의 의미이며, 위 명령은 '$index 가 42가 될 때까지 조건이 참' 이란 뜻이다.
lvcreat : 'dev10G${index}' 는 LV 이름을 의미한다 즉 이 경우 LV는 'dev10G1 ~ dev10G42' 까지 생성된다.
             '-L 10G'  는 LV의 크기를 의미

             'vg_raw' 는 LV가 속한 VG(volume group)를 명시


728x90
반응형
728x90
반응형

문 서 명 : Redhat Linux RAW Device 관리

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  □ Summary

작 성 일 : 2016 04 19

작 성 자 : 우리들의 삶

테 스 트 환 경 : Redhat Entprise Linux 6.7

출 처 : 본인


LVM을 통해 디스크를 LV(Logical Volume)형태로 생성한 경우 아래와 같이 RAW Device로 변환하여,
볼륨을 사용할 수 있다.

본 문서에는 두 가지 방법을 소개하는데, RAW Device가 소수일 때와 다수일 때 작업하는 방법에 대해 소개한다.

목록 
  1. RAW Device가 단수일 때
  2. RAW Device가 복수일 때
  3. RAW Device <-> LV mapping 정보 확인



  1. RAW Device가 단수일 때

[root@hsy-test ~]# raw /dev/raw/raw1 /dev/vg_raw/dev1G1  <-- raw 명령어를 통해 LV를 RAW Device로 변환한다.
/dev/raw/raw1:  bound to major 253, minor 2
tip : 
RAW Device는 반드시 /dev/raw/rawN 형식으로 작성되어야 한다.
# raw /dev/raw/rawN /dev/VG_Name/LV_Name  <- 이러한 구문으로 명령을 작성해야 한다.


[root@hsy-test ~]# raw -qa  <- 설정된 raw device 정보를 확인
/dev/raw/raw1:  bound to major 253, minor 2


[root@hsy-test ~]# cat /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.

ACTION=="add", ENV{MAJOR}=="253", ENV{MINOR}=="2", RUN+="/bin/raw /dev/raw/raw1 %M %m"  <-- 구문 추가
# LV의 MAJOR 번호와 MINOR 번호를 raw1로 정의함으로 써 재부팅 후에도 같은 LV가 같은 RAW Device로 생성된다.

ACTION=="add",KERNEL=="raw*" OWNER="5009872",GROUP="5009872",MODE="660"  <-- 구문 추가
# 생성된 RAW Device의 Owner, Group, permission 을 정의 한다.
[root@hsy-test ~]#


[root@hsy-test ~]# start_udev  <- udev 서비스를 시작
Starting udev: [  OK  ]
[root@hsy-test ~]#

[root@hsy-test ~]# raw -qa | cut -d ":" -f 1 | xargs -i{} ls -l {}  <-- # raw -qa 명령은 RAW Device를 확인하는 명령이다.
crw-rw---- 1 5009872 5009872 162, 1 Apr 18 11:21 /dev/raw/raw1
[root@hsy-test ~]#


  1. RAW Device 가 복수 일 때

마찬가지로 볼륨을 LV까지 만든 다음 아래와 같이 /etc/udev/rules.d/60-raw-rules 파일을 수정 한다.

[root@hsy-test ~]# cat /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.

ACTION!="add|change". GOTO="raw_end"   <- 아래 구문들의 'ACTION' "raw_end" 을 정의한다.
# Create raw character device mapping:
ENV{DM_VG_NAME}=="vg_test1", ENV{DM_LV_NAME}=="lv_test1", RUN+="/bin/raw /dev/raw/raw2 %N"
ENV{DM_VG_NAME}=="vg_test2", ENV{DM_LV_NAME}=="lv_test2", RUN+="/bin/raw /dev/raw/raw3 %N"
# VG_NAME, LV_NAME을 /dev/raw/rawN 으로 정의한다.

KERNEL=="raw*" OWNER="5009872",GROUP="5009872",MODE="660"
# 모든 RAW Device의 Owner, Group, permission 을 변경한다.

LABEL="raw_end"  <- 'ACTION' "raw_end" 을 마친다.


[root@hsy-test ~]# start_udev  <- udev 서비스를 시작
Starting udev: [  OK  ]
[root@hsy-test ~]#




  1. RAW Device <-> LV mapping 정보 확인

# raw -qa  <- RAW Device의 major number, minor number 확인
/dev/raw/raw1: bound to major 253, minor 8
/dev/raw/raw2: bound to major 253, minor 9

# lvs -o +lv_kernel_major,lv_kernel_minor   <- LV의 mager number, minor number 확인
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert KMaj KMin
lv_test1 vg_test -wi-a----- 2.00g 253 8
lv_test2 vg_test -wi-a----- 2.00g 253 9




728x90
반응형
728x90
반응형

문 서 명 : Redhat Linux LVM으로 LV생성 스크립트

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  Summary

작 성 일 : 2016 04 18

작 성 자 : 우리들의 삶

테 스 트 환 경 : Redhat ENT 6.7

출 처 : 



LV를 동시에 여러개를 만들 상황이 생기는데 이때 아래 명령을 응용해서 작업한다면 보다 쉽게 할 수 있을 것이다.

#!/bin/sh
index=1

while [ ${index} -le 42 ];do
 lvcreate -n dev10G${index} -L 10G vg_raw
 index=$((index + 1))
done

tip : 
index변수 : 총 몇개의 LV를 생성할 것인지를 정의하는 변수로 초기 값은 1을 가진다.
while 조건문 : -le 의 뜻은 '크거나 같다' 의 의미이며, 위 명령은 '$index 가 42가 될 때까지 조건이 참' 이란 뜻이다.
lvcreat : 'dev10G${index}' 는 LV 이름을 의미한다 즉 이 경우 LV는 'dev10G1 ~ dev10G42' 까지 생성된다.
             '-L 10G'  는 LV의 크기를 의미

             'vg_raw' 는 LV가 속한 VG(volume group)를 명시


728x90
반응형
728x90
반응형

문 서 명 : Linux CPU Core Disable manual

문 서 버 전 : Ver_1.0

문 서 구 분 :  Manual  □ Summary

작 성 일 : 2016 05 18

작 성 자 : 우리들의 삶

테 스 트 환 경 : RHEL 6.7

출 처 :  본인


해당 문서는 RHEL 6.7으로 Test 하였으며, RHEL 4, 5, 6 version에서 적용되는 것으로 보이며, S/W License issue 로 core 갯 수를 조정하고자 할 때 가이드 하면 될 것이다.

본 문서는 "임시로 core 갯수 조정" 하는 방법과 "영구적으로 core 갯수 조정" 하는 방법을 포함한다.



1. 임시로 core 갯수 조정(재부팅 없이 조정할 수 있으나, 재부팅 후 원래대로 돌아옴)

# CPU 확인
[root@hostname ~]# cat /sys/devices/system/cpu/online
0-23
[root@hostname ~]# cat /sys/devices/system/cpu/offline
24-31



[root@hostname ~]# cd /sys/devices/system/cpu/
[root@hostname cpu]# ls -al
합계 0
drwxr-xr-x 28 root root    0 2016-04-11 09:19 .
drwxr-xr-x 14 root root    0 2016-04-11 09:19 ..
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu0
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu1
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu10
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu11
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu12
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu13
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu14
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu15
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu16
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu17
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu18
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu19
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu2
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu20
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu21
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu22
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu23
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu3
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu4
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu5
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu6
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu7
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu8
drwxr-xr-x  8 root root    0 2016-04-11 09:20 cpu9
drwxr-xr-x  3 root root    0 2016-05-18 10:59 cpufreq
drwxr-xr-x  2 root root    0 2016-05-18 10:59 cpuidle
-r--r--r--  1 root root 4096 2016-04-12 00:00 kernel_max
-r--r--r--  1 root root 4096 2016-05-18 10:59 offline
-r--r--r--  1 root root 4096 2016-04-11 09:19 online
-r--r--r--  1 root root 4096 2016-04-12 00:00 possible
-r--r--r--  1 root root 4096 2016-04-12 00:00 present
-rw-r--r--  1 root root 4096 2016-04-11 09:20 sched_mc_power_savings
-rw-r--r--  1 root root 4096 2016-04-11 09:20 sched_smt_power_savings
[root@hostname cpu]#



[root@hostname cpu]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                24
On-line CPU(s) list:   0-23
Thread(s) per core:    2
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 44
Stepping:              2
CPU MHz:               1600.000
BogoMIPS:              6664.09
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23
[root@bnpsvrdev01 cpu]#



[root@hostname cpu]# grep "processor" /proc/cpuinfo
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7
processor       : 8
processor       : 9
processor       : 10
processor       : 11
processor       : 12
processor       : 13
processor       : 14
processor       : 15
processor       : 16
processor       : 17
processor       : 18
processor       : 19
processor       : 20
processor       : 21
processor       : 22
processor       : 23



임시로 CPU Core 갯 수 조정
[root@hostname cpu]# echo 0 > /sys/devices/system/cpu/cpu23/online
[root@hostname cpu]# echo 0 > /sys/devices/system/cpu/cpu22/online

혹은

[root@hostname ~]# chcpu -d 23
CPU 23 disabled
[root@hostname ~]# chcpu -d 22
CPU 22 disabled

* 두 명령어 모두 /sys/devices/system/cpu/cpu23/online 이라는 ASSCI TEXT 파일의 내용을  1 에서 0 으로 변경함으로
   CPU Core 상태를 Offline 으로 변경한다.


영구적으로 CPU Core 갯 수 조정

[root@hostname ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_bnp-LogVol00
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux 6 (2.6.32-573.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-573.el6.x86_64 ro root=/dev/mapper/vg_bnp-LogVol00 rd_NO_LUKS LANG=ko_KR.UTF-8 rd_NO_MD rd_LVM_LV=vg_bnp/LogVol00 crashkernel=128M  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_bnp/LogVol02 rd_NO_DM rhgb quiet maxcpus=8
        initrd /initramfs-2.6.32-573.el6.x86_64.img
[root@bnpsvrdev01 ~]#


* /etc/grub.conf 설정파일에서 kernel 부분에 maxcpus=N 구문을 삽입하여 부팅 시 변경하게끔 조정한다.
  이 방법은 최초 1회 재부팅이 필요하다.




728x90
반응형

+ Recent posts