'2019/03/05'에 해당되는 글 3건

  1. 2019.03.05 LVM 관리
  2. 2019.03.05 애증의.. LVM? centos 기본값 설치에서 변형했더니...
  3. 2019.03.05 nginx load balance
프로그램 사용/LVM2019. 3. 5. 13:07

LVM은 Logical Volume Manager의 약자이다.

꽤 오래전부터 기본으로 사용은 했는데 싫어서 매번 삭제하고 임의로 ext3나 ext4로 써왔는데

서버 밀면서 처음 써보다 보니 헤매고 있다.. -_ㅠ


아무튼 정리하자면

PV(Physical Volume)

VG(Volume Group)

LV(Logical Volume)


앞의 세개가 접두이고, 그 이후에 명령어들이 존재한다.

pvchange   pvck       pvcreate   pvdisplay  pvmove     pvremove   pvresize   pvs        pvscan 

lvchange     lvcreate     lvextend     lvmconf      lvmdiskscan  lvmetad      lvmsadc      lvreduce     lvrename     lvs

lvconvert    lvdisplay    lvm          lvmconfig    lvmdump      lvmpolld     lvmsar       lvremove     lvresize     lvscan 

vgcfgbackup    vgck           vgdisplay      vgimport       vgmknodes      vgrename       vgsplit

vgcfgrestore   vgconvert      vgexport       vgimportclone  vgreduce       vgs
vgchange       vgcreate       vgextend       vgmerge        vgremove       vgscan


PV는 /dev/sd? 에 매핑되는 녀석으로 물리적 하드에 대한 관리를 하게되고 VG는 PV를 기반으로 생성하게 된다. 

기존의 Volume Group에 추가하려면 vgextend

새로운 Volume Group으로 Physical Volume을 추가하려면 vgcreate로 하면 된다.

Use vgcreate(8) to create a new VG on the PV, or vgextend(8) to add the PV to existing VG. 


그리고 PV를 VG로 묶을때 설정에 따라 RAID 처럼 묶을수도 있고 JBOD으로 묶을수도 있다.


생성 순서로 보면

# pvcreate /dev/sd??

# vgcreate vgname /dev/sd??

# lvcreate -L 용량 vgname -n lvname


Centos7 기준

/dev/mapper/centos-[lvname]

/dev/centos/lvname

/dev/dm-0

/dev/dm-1


식으로 되어있는데

/dev/dm-? 이 실제 장치이고

그 외에는 전부 심볼릭링크로 /dev/dm-? 으로 연결되어 있다.


[링크 : https://jangpd007.tistory.com/235]

[링크 : https://sgbit.tistory.com/13]

[링크 : https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c01847647]

[링크 : https://closed0402.tistory.com/103]

[링크 : https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-c01847647]


+

selinux가 또 태클을 거는데..

mount: /home/test does not contain SELinux labels.

       You just mounted an file system that supports labels which does not

       contain labels, onto an SELinux box. It is likely that confined

       applications will generate AVC messages and not be allowed access to

       this file system.  For more details see restorecon(8) and mount(8).


이것만 해서는 안되고.. 서버 리부팅 까지 해주니 마운트가 되네.. 머냐...

# restorecon -Rv /raid1

# fixfiles relabel 

[링크 : https://linuxbuff.wordpress.com/tag/redhat/]

'프로그램 사용 > LVM' 카테고리의 다른 글

lvm as ssd cache  (0) 2022.02.14
애증의.. LVM? centos 기본값 설치에서 변형했더니...  (0) 2019.03.05
lvm raid  (0) 2019.01.15
LVM - Logical Volumegroup Management  (0) 2009.01.22
Posted by 구차니
프로그램 사용/LVM2019. 3. 5. 11:33

어라.. RAID-6 볼륨이 원래 4.36TB 인데

lvm 으로 해서 4.74TB가 잡혀서 어디서 왔나 했더니..

SSD랑 HDD랑 같은 pool로 잡혀서 그런식으로 걸쳐 있는 듯?


pool 부터 다시 잡아야 하나.. 아니면 런타임에 pool을 변경이 가능하려나?


ssm 이라는 녀석 설치!

# yum install system-storage-manager 

[링크 : https://www.linuxsysadmin.biz/lvm-gui-centos-7/]


# ssm list

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

Device        Free       Used      Total  Pool    Mount point

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

/dev/sda                       465.25 GB          PARTITIONED

/dev/sda1                        1.00 GB          /boot

/dev/sda2  4.00 MB  464.24 GB  464.25 GB  centos

/dev/sdb                         4.36 TB

/dev/sdb1  0.00 KB    4.36 TB    4.36 TB  centos

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

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

Pool    Type  Devices     Free     Used    Total

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

centos  lvm   2        4.00 MB  4.82 TB  4.82 TB

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

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

Volume             Pool    Volume size  FS     FS size       Free  Type    Mount point

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

/dev/centos/root   centos     50.00 GB  ext4  50.00 GB   43.00 GB  linear  /

/dev/centos/swap   centos     31.44 GB                             linear

/dev/centos/samba  centos      4.74 TB  ext4   4.74 TB    4.46 TB  linear  /home/samba

/dev/sda1                      1.00 GB  ext4   1.00 GB  787.87 MB  part    /boot

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


개념부터 봐야겠다..

[링크 : https://kit2013.tistory.com/199]



+

 # df -h

Filesystem                Size  Used Avail Use% Mounted on

/dev/mapper/centos-root    50G  4.3G   43G  10% /

devtmpfs                   32G     0   32G   0% /dev

tmpfs                      32G     0   32G   0% /dev/shm

tmpfs                      32G   11M   32G   1% /run

tmpfs                      32G     0   32G   0% /sys/fs/cgroup

/dev/sda1                 976M  150M  760M  17% /boot

/dev/mapper/centos-samba  4.8T   89M  4.5T   1% /home/samba

tmpfs                     6.3G     0  6.3G   0% /run/user/0

tmpfs                     6.3G  4.0K  6.3G   1% /run/user/42

tmpfs                     6.3G   44K  6.3G   1% /run/user/1000 

# lvdisplay

  --- Logical volume ---

  LV Path                /dev/centos/samba

  LV Name                samba

  VG Name                centos

  LV UUID                9Aa0oO-Ndwh-5IfX-O5vW-KZ8Z-tAFF-RBcKLq

  LV Write Access        read/write

  LV Creation host, time localhost, 2019-03-05 10:32:46 +0900

  LV Status              available

  # open                 1

  LV Size                <4.74 TiB

  Current LE             1242061

  Segments               2

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     256

  Block device           253:2


  --- Logical volume ---

  LV Path                /dev/centos/swap

  LV Name                swap

  VG Name                centos

  LV UUID                uYmqZR-s3FZ-w56s-97cm-eaYn-Vj6Y-SEvcWS

  LV Write Access        read/write

  LV Creation host, time localhost, 2019-03-05 10:32:50 +0900

  LV Status              available

  # open                 2

  LV Size                <31.44 GiB

  Current LE             8048

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     256

  Block device           253:1


  --- Logical volume ---

  LV Path                /dev/centos/root

  LV Name                root

  VG Name                centos

  LV UUID                8PH4I2-Amfo-YuDh-J9h5-Hwhq-jSjZ-MrEUNK

  LV Write Access        read/write

  LV Creation host, time localhost, 2019-03-05 10:32:50 +0900

  LV Status              available

  # open                 1

  LV Size                50.00 GiB

  Current LE             12800

  Segments               1

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     256

  Block device           253:0


# pvdisplay

  --- Physical volume ---

  PV Name               /dev/sda2

  VG Name               centos

  PV Size               <464.25 GiB / not usable 3.00 MiB

  Allocatable           yes

  PE Size               4.00 MiB

  Total PE              118847

  Free PE               1

  Allocated PE          118846

  PV UUID               bxRHju-AXnI-7xwe-MEo5-LNWq-A0tw-VngA83


  --- Physical volume ---

  PV Name               /dev/sdb1

  VG Name               centos

  PV Size               4.36 TiB / not usable 2.00 MiB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              1144063

  Free PE               0

  Allocated PE          1144063

  PV UUID               Z2jJnF-h4Uu-T0gF-yKyb-jSat-wPMr-7j2RtC


'프로그램 사용 > LVM' 카테고리의 다른 글

lvm as ssd cache  (0) 2022.02.14
LVM 관리  (0) 2019.03.05
lvm raid  (0) 2019.01.15
LVM - Logical Volumegroup Management  (0) 2009.01.22
Posted by 구차니
프로그램 사용/nginx2019. 3. 5. 10:46

설정이 되어있는걸 보는데...

reverse proxy 용도가 아니라 load balance 용도로 설정을 해둔거였나...


[링크 : https://www.lesstif.com/pages/viewpage.action?pageId=35357063]

[링크 : http://nginx.org/en/docs/http/ngx_http_upstream_module.html]

Posted by 구차니