Skip to content

ceph 명령어 및 API를 통한 GlueFS, NFS, iSCSI 구성 연구 #74

@Dajeong-Park

Description

@Dajeong-Park

GlueFS 관련 ceph 명령어 활용

  • 파일 시스템 생성
 #ceph fs volume create [fs_name] <host_name>
 #ceph fs volume create fs --placement="2 scvm1 scvm2 scvm3"

풀이 생성되고 지정 호스트에 MDS(메타데이터 서버) 데몬이 배포됨

  • 파일 시스템 제거

사전에 제거 관련 옵션이 true로 설정되어있어야 삭제가 가능
#ceph config set mon mon_allow_pool_delete true

  1. 파일 시스템, 데이터/메타 데이터 풀, mds 서비스 각각 제거하는 방법
#ceph fs set [fs_name] down true
#ceph fs rm [fs_name] --yes-i-really-mean-it
#ceph osd pool delete cephfs.[fs_name].data cephfs.[fs_name].data --yes-i-really-really-mean-it
#ceph orch rm mds.[fs_name]
  1. 파일 시스템 및 데이터/메타 데이터 풀, mds 서비스 한번에 제거하는 방법
#ceph fs volume rm [fs_name] --yes-i-really-mean-it
  • 파일 시스템 상태 확인
#ceph fs status (state, used, avail, type, pool 정보 출력)
#ceph fs ls (fs name, pool name 출력)
#ceph fs get [fs_name] (name, flags, created, max_file_size 등 다양한 정보 출력)
  • 파일 시스템 max_file_size 설정
#ceph fs set [fs_name] max_file_size [size in bytes](must at least 65536)
#ceph fs get nfs 변경된 정보 확인
  • cephFS 마운팅
#mount -t ceph [moniter_ip]:[mount_target] [mount_point]-o name=[user_name]
ex) mount -t ceph 100.100.4.14:/ /mnt -o name=admin
#mount -t ceph [user_name]@.[fs_name]=[mount_target] [mount_point]
ex) mount -t ceph admin@.nfs=/ /mnt
  • cephFS 마운트 해제
#umount [mount_point]
target is busy 인 경우 #fuser -ck /mnt
  • cephFS 자동 마운트 설정 /etc/fstab

secretfile 옵션으로 키링 파일 경로를 지정할 경우 secret is not valid base64 오류로 직접 secret을 입력해야함

ex) mon1:6790,mon2:/subdir /mnt ceph name=admin,secret=<admin_keyring>,noatime,_netdev 0 2
  • 파일 시스템 디렉토리 quotas 설정
사전 작업 : ceph fs가 마운팅된 상태여야 함 
ex) mount -t ceph :/ /mnt -o name=admin 마운트하고, fs path가 /gluefs 인 경우

max_size
#setfattr -n ceph.quota.max_bytes -v 100000000 /mnt/gluefs (100000000Byte=100MB)
#getfattr -n ceph.quota.max_bytes mnt/gluefs (설정 확인)

max_file
#setfattr -n ceph.quota.max_files -v 10000 /mnt/gluefs (10000=10000개)
#getfattr -n ceph.quota.max_files mnt/gluefs (설정 확인)
  • 파일 시스템용 스냅샷 생성/확인/삭제
ex) mount -t ceph 100.100.4.14:/ /mnt -o name=admin 마운트하고, fs path가 /gluefs 인 경우
#cd /mnt/gluefs
#mkdir .snap/new-snaps (생성)

#ls -l .snap/ (확인)

#cd /mnt/gluefs
#rmdir .snap/new-snaps (삭제)

cephFS를 마운트하려면 ceph-client가 설치되어있어야 mount -ceph 명령을 사용할 수 있음

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions