목차
인터페이스(private, public) 설정... 5
OS : Ubuntu 14.04 LTS
Kernel : Linux version 3.14.0
smbd : Version 4.1.6-Ubuntu
$ sudo vim /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:d7:73:19", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="p1p2"
|
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:d7:73:19", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth2" |
$ sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="biosdevname=0" |
$sudo update-grub
$ sudo reboot
udev rule을 변경하지 않으면, interface를 인식하지 못한다.
$ sudo vim /etc/network/interface
auto lo iface lo inet loopback
auto eth0 # private network iface eth0 inet static address 11.0.0.11 netmask 255.255.255.0
auto p1p1 iface p1p1 inet static address 192.168.3.11 netmask 255.255.252.0 gateway 192.168.0.1 dns-nameserver 8.8.8.8
auto eth2 # public network iface eth2 inet manual |
<!--[if !supportLists]-->1. <!--[endif]-->CephFS 마운트
$ sudo mount -t ceph 192.168.2.18:6789:/ /mnt/storage/ -o name=admin,secretfile=/etc/ceph/ceph.client.admin.keyfile
<!--[if !supportLists]-->2. <!--[endif]-->Fstab 등록
$ sudo vim /etc/fstab
192.168.2.18:6789:/ /mnt/storage ceph name=admin,secretfile=/etc/ceph/ceph.client.admin.keyfile,noatime 0 2 |
<!--[if !supportLists]-->1. <!--[endif]-->블럭 생성
$ sudo rbd create block1 --size 1024
Rbd를 지원하는 stgt를 사용한다면 블록 생성만 해도 된다
<!--[if !supportLists]-->2. <!--[endif]-->블럭 매핑
$ sudo rbd map block1
<!--[if !supportLists]-->3. <!--[endif]-->블럭 매핑 유지
$ sudo vim /etc/ceph/rbdmap
rbd/block1 id=admin,keyring=/etc/ceph/ceph.client.admin.keyring |
$ sudo apt-get install ctdb libctdb-dev
$ sudo apt-get install samba samba-common samba-dev
서버
$ sudo apt-get install nfs-common nfs-kernel-server rpcbind quota
클라이언트
$ sudo apt-get install nfs-common
서버
$ sudo apt-get install tgt
클라이언트
$ sudo apt-get install open-iscsi
$ sudo apt-get install vsftpd
ctdb
Ctdb 설정
sudo vim /etc/default/ctdb
CTDB_RECOVERY_LOCK=/mnt/storage/ctdb/.ctdb.lock CTDB_NODES=/etc/ctdb/nodes CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses CTDB_MANAGES_SAMBA=yes CTDB_MANAGES_NFS=yes CTDB_MANAGES_ISCSI=yes CTDB_MANAGES_VSFTPD=yes CTDB_DEBUGLEVEL=NOTICE
CTDB_SOCKET=/var/lib/run/ctdb/ctdbd.socket CTDB_INIT_STYLE=debian CTDB_DBDIR=/var/ctdb CTDB_DBDIR_PERSISTENT=/var/ctdb/persistent |
sudo mkdir /var/lib/run/ctdb/ -p
sudo ln -s /usr/sbin/service /sbin/service
sudo mkdir /mnt/storage/ctdb
Ctdb 네트워크 설정
<!--[if !supportLists]-->1. <!--[endif]-->Private 주소
sudo vim /etc/ctdb/nodes
11.0.0.11 11.0.0.12 11.0.0.13 |
<!--[if !supportLists]-->2. <!--[endif]-->Public 주소
sudo vim /etc/ctdb/public_addresses
12.0.0.11/24 eth2 12.0.0.12/24 eth2 12.0.0.13/24 eth2 |
samba 이벤트 스크립트 수정
sudo vim /etc/ctdb/events.d/50.samba 수정
debian) CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-samba} CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-""}
|
debian) CTDB_SERVICE_SMB=${CTDB_SERVICE_SMB:-smbd} CTDB_SERVICE_NMB=${CTDB_SERVICE_NMB:-nmbd} |
nfs 이벤트 스크립트 수정
$ sudo vim /etc/ctdb/functions (730 라인정도의 startstop_nfs()에 삽입)
......... unknown) case $1 in start) service nfs-kernel-server start ;; stop) service nfs-kernel-server stop ;; restart) set_proc "fs/nfsd/threads" 0 service nfs-kernel-server stop > /dev/null 2>$1 pkill -9 nfsd nfs_dump_some_threads service nfs-kernel-server start ;; esac ;; *) exit 1 ;; esac ........ |
functions이 아닌 이벤트 스크립트로 수정해도 되는지 확인 하자. Restart는 불안한 것 같음(테스트 1번밖에 안해봄)
iSCSI 이벤트 스크립트 수정
$ sudo vim /etc/ctdb/events.d/70.iscsi
……….. # start the iscsi daemon tgtd >/dev/null 2>/dev/null tgt-admin –e #재 시작할 때 타겟 정보가 항상 사라져서 삽입 ……….. |
upstart 설정
<!--[if !supportLists]-->l <!--[endif]-->만약 disable이 실패하면 sudo update-rc.d {service name} defaults을 먼저 해준다.
sudo update-rc.d ctdb enable
sudo update-rc.d {smbd | nmbd | nfsd rpcbind | tgt} disable
sudo sh -c "echo 'manual' > /etc/init/{ smbd | nmbd | nfs-kernel-server rpcbind | tgt}.override"
ctdb가 실행되기 전에 위의 서비스들이 미리 실행되고 있으면 ctdb 상태가 불안정 할 수 있다.
onnode 스크립트 변경 (sudo 추가)
$ sudo vim /usr/bin/onnode
for n in $nodes ; do set -o pipefail 2>/dev/null if $parallel ; then { exec 3>&1 ; { $SSH $ssh_opts $EXTRA_SSH_OPTS $n "sudo $command" | stdout_filter >&3 ; } 2>&1 | stderr_filter ; } & pids="${pids} $!" else if $verbose ; then echo >&2 ; echo ">> NODE: $n <<" >&2 fi
{ exec 3>&1 ; { $SSH $ssh_opts $EXTRA_SSH_OPTS $n "sudo $command" | stdout_filter >&3 ; } 2>&1 | stderr_filter ; } [ $? = 0 ] || retcode=$? fi done |
Root 사용자 생성하지 않고 하려면 위와 같이 변경.
samba
smb 설정
$ sudo vim /etc/samba/smb.conf (global 섹션 삽입, anycloud 섹션 생성)
[global] clustering = yes idmap backend = tdb2 cluster addresses = 12.0.0.11 12.0.0.12 12.0.0.13 ctdbd socket = /var/lib/run/ctdb/ctdbd.socket private dir = /mnt/storage/ctdb security = user groupdb:backend = tdb smb passwd file = /etc/samba/smbpasswd
[anycloud] path = /mnt/storage browseable=yes public=no writeable=yes |
nfs-kernerl-server
export 설정
$ sudo vim /etc/export
/mnt/storage *(rw,fsid=1235,subtree_check,no_root_squash) |
nfs-kernel-server 설정
$ sudo vim /etc/default/nfs-kernel-server
|
Nfs port 설정
$ sudo vim /etc/default/nfs-kernel-server
RPCMOUNTDOPTS="-p 597" |
$ sudo vim /etc/services
status 595/tcp status 595/udp rquotad 598/tcp rqoutad 598/udp |
$ sudo vim /etc/modprobe.d/options.conf
options lockd nlm_udpport=599 nlm_tcpport=599 |
$ sudo vim /etc/modules
lockd |
$ sudo reboot
$ rpcinfo –p
storage@s1:~$ rpcinfo -p program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 595 status 100024 1 tcp 595 status 100011 1 udp 895 rquotad 100011 2 udp 895 rquotad 100011 1 tcp 598 rquotad 100011 2 tcp 598 rquotad 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 100227 3 tcp 2049 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 100227 3 udp 2049 100021 1 udp 599 nlockmgr 100021 3 udp 599 nlockmgr 100021 4 udp 599 nlockmgr 100021 1 tcp 599 nlockmgr 100021 3 tcp 599 nlockmgr 100021 4 tcp 599 nlockmgr 100005 1 udp 597 mountd 100005 1 tcp 597 mountd 100005 2 udp 597 mountd 100005 2 tcp 597 mountd 100005 3 udp 597 mountd 100005 3 tcp 597 mountd |
iSCSI
타겟 설정
$ sudo vim /etc/tgt/targets.conf
include /etc/tgt/conf.d/*.conf default-driver iscsi <target iqn.2014.6.anycloud:iscsi.target.storage1.block1> backing-store /dev/rbd/rbd/block1 </target> |
타겟 설정(with rbd)
$ sudo vim /etc/tgt/targets.conf
include /etc/tgt/conf.d/*.conf <target iqn.2014-06.anycloud:rbd> driver iscsi bs-type rbd backing-store rbd/block1 #pool_name/image_name </target> |
타겟 커맨드 설정(수동)
$ sudo tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2014.6.anycloud:iscsi.target.storage1.block1
$ sudo tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/rbd/rbd/block1
$ sudo tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
$ adduser ftp1
$ sudo usermod -d /mnt/storage ftp1 (각 게이트웨이 노드에 ftp 유저 생성 후 사용)
Active directory 연동은 추후 update
ceph
마운트 포인트 확인
$ mount
……………
192.168.2.18:6789:/ on /mnt/storage type ceph (name=admin,key=client.admin)
initctl 확인
initctl list | grep ceph
ceph-mds-all start/running ceph-osd-all start/running ceph-mds-all-starter stop/waiting ceph-osd-all-starter stop/waiting ceph-all start/running ceph-mon-all start/running ceph-mon-all-starter stop/waiting ceph-mon (ceph/s1) start/running, process 1188 ceph-create-keys stop/waiting ceph-osd stop/waiting ceph-mds (ceph/s1) start/running, process 27502 |
ceph 상태 확인
$ ceph health
HEALTH_OK
로그 위치
/var/log/ceph/
ping 확인
$ sudo ctdb ping –n all
response from 0 time=0.000826 sec (1 clients) response from 1 time=0.000318 sec (2 clients) response from 2 time= 0.000092sec (2 clients) |
ctdb 상태 확인
$ sudo ctdb status
Number of nodes:3 pnn:0 11.0.0.11 OK (THIS NODE) pnn:1 11.0.0.12 OK pnn:1 11.0.0.13 OK Generation:619257139 Size:3 hash:0 lmaster:0 hash:1 lmaster:1 hash:2 lmaster:2 Recovery mode:NORMAL (0) Recovery master:1 |
ctdb 서비스 처리 노드 확인
$ sudo ctdb ip
Public IPs on node 0 12.0.0.11 0 12.0.0.12 1 12.0.0.13 2 |
12.0.0.12가 꺼졌을 때 )
Public IPs on node 0 12.0.0.11 0 12.0.0.12 0 12.0.0.13 2 |
12.0.0.11 (서비스가 가능한 다른 노드)에서 12.0.0.12 대신 서비스 중이란 것을 확인 할 수 있다
Log 위치
/var/log/ctdb/
설정 체크
$ testparm
Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) WARNING: The "idmap backend" option is deprecated Processing section "[printers]" Processing section "[print$]" Processing section "[anycloud]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions
[global] server string = %h server (Samba, Ubuntu) server role = standalone server map to guest = Bad User obey pam restrictions = Yes private dir = /mnt/storage/ctdb pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 ctdbd socket = /var/lib/run/ctdb/ctdbd.socket cluster addresses = 12.0.0.11, 12.0.0.12, 12.0.0.13 clustering = Yes dns proxy = No usershare allow guests = Yes panic action = /usr/share/samba/panic-action %d groupdb:backend = tdb idmap config * : backend = tdb2
[printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes print ok = Yes browseable = No
[print$] comment = Printer Drivers path = /var/lib/samba/printers
[anycloud] path = /mnt/storage read only = No |
ctdb를 위해 Smb 설정에 추가한 부분이 존재하는지 확인
rpcinfo 체크(리모트 nfs 서버)
$ rpcinfo -s anycloud-ds-1
program version(s) netid(s) service owner 100000 2,3,4 local,udp,tcp,udp6,tcp6 portmapper superuser 100024 1 tcp6,udp6,tcp,udp status 105 100011 2,1 tcp,udp rquotad superuser 100003 4,3,2 udp6,tcp6,udp,tcp nfs superuser 100227 3,2 udp6,tcp6,udp,tcp - superuser 100021 4,3,1 tcp6,udp6,tcp,udp nlockmgr superuser 100005 3,2,1 tcp6,udp6,tcp,udp mountd superuser |
$ rpcinfo –p anycloud-ds-2
program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 595 status 100024 1 tcp 595 status 100011 1 udp 895 rquotad 100011 2 udp 895 rquotad 100011 1 tcp 598 rquotad 100011 2 tcp 598 rquotad 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 100227 3 tcp 2049 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 100227 3 udp 2049 100021 1 udp 599 nlockmgr 100021 3 udp 599 nlockmgr 100021 4 udp 599 nlockmgr 100021 1 tcp 599 nlockmgr 100021 3 tcp 599 nlockmgr 100021 4 tcp 599 nlockmgr 100005 1 udp 597 mountd 100005 1 tcp 597 mountd 100005 2 udp 597 mountd 100005 2 tcp 597 mountd 100005 3 udp 597 mountd 100005 3 tcp 597 mountd |
리모트 nfs 서버의 서비스 체크
$ showmount -e anycloud-ds-1
Export list for anycloud-ds-1: /mnt/storage * |
rcpbind 체크
$ ps -ef |grep rpcbind
root 569 1 0 09:33 ? 00:00:00 rpcbind storage 29825 1404 0 17:02 pts/0 00:00:00 grep --color=auto rpcbind |
rbd 지원 확인
$ sudo tgtadm --lld iscsi --mode system --op show
System: State: ready debug: off LLDs: iscsi: ready Backing stores: rbd (bsoflags sync:direct) sheepdog bsg sg null ssc rdwr (bsoflags sync:direct) Device types: disk cd/dvd osd controller changer tape passthrough iSNS: iSNS=Off iSNSServerIP= iSNSServerPort=3205 iSNSAccessControl=Off |
target 체크
$ sudo tgt-admin –s (or tgtadm --lld iscsi --mode target --op show)
Target 1: iqn.2014.6.anycloud:iscsi.target.storage1.block1 System information: Driver: iscsi State: ready I_T nexus information: LUN information: LUN: 0 Type: controller SCSI ID: IET 00010000 SCSI SN: beaf10 Size: 0 MB, Block size: 1 Online: Yes Removable media: No Prevent removal: No Readonly: No SWP: No Thin-provisioning: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 1074 MB, Block size: 512 Online: Yes Removable media: No Prevent removal: No Readonly: No SWP: No Thin-provisioning: No Backing store type: rdwr Backing store path: /dev/rbd/rbd/block1 Backing store flags: Account information: ACL information: ALL |
bind 체크
$ sudo netstat -atnp | grep 3260
tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 10881/tgtd tcp6 0 0 :::3260 :::* LISTEN 10881/tgtd |
Remote iSCSI 타겟 찾기
$ sudo iscsiadm --mode discovery --type sendtargets --portal 12.0.0.11
12.0.0.11:3260,1 iqn.2014.6.anycloud:iscsi.target.storage1.block1 |
구분 |
체크 사항 |
비고 | |||||||||
파일시스템 |
|
| |||||||||
블록시스템 |
|
| |||||||||
네트워크 |
|
| |||||||||
CTDB |
|
| |||||||||
Samba |
|
| |||||||||
Nfs |
|
| |||||||||
iSCSI |
|
|
samba ctdb 사이트 - https://ctdb.samba.org/
samba ctdb 위키 - https://wiki.samba.org/index.php/CTDB_Setup
readhat ctdb 설정(한글) – https://access.redhat.com/site/documentation/ko-KR/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/s1-CTDB-Configuration-CA.html
ctdb 설명 ppt -
http://niranjanmr.wordpress.com/2011/12/05/ctdb/
http://www.samba.org/~obnox/presentations/sambaXP-2011/sambaxp-2011-tutorial-ctdb-handout.pdf
우분투 파일 서버 - http://developinghappiness.com/?p=82
우분투 nfs howto - https://help.ubuntu.com/community/SettingUpNFSHowTo
Nfs how to - http://chschneider.eu/linux/server/nfs.shtml
Nfs 포트 변경 :
Configuring NFS under Linux for Firewall control - http://www.lowth.com/LinWiz/nfs_help.html
http://rockball.tistory.com/entry/NFS-Port-%EA%B3%A0%EC%A0%95%EB%B0%A9%ED%99%94%EB%B2%BD-%EC%82%AC%EC%9A%A9
Lockd 변경 -http://ubuntuforums.org/showthread.php?t=1263114&page=2&p=7959294#post7959294
http://cdral.net/948
ceph rbd+stgt 설명 사이트 - http://ceph.com/dev-notes/adding-support-for-rbd-to-stgt/
Stgt 소스코드 주소 - https://github.com/fujita/tgt
Stgt+rbd 설정 - http://stuartl.longlandclan.yi.org/blog/2014/02/25/ceph-and-stgt/
Stgt 퀵 가이드 - https://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide
Tgt 페키지 - http://stgt.sourceforge.net/
'학습자료 > tools' 카테고리의 다른 글
[tools] 크로스브라우저 테스트 (0) | 2015.02.03 |
---|---|
linux cron 사용법 (0) | 2014.02.11 |
xming 사용(putty gui) (0) | 2014.02.03 |
xshell 파일전송 (0) | 2013.12.23 |
이클립스 단축키 (0) | 2013.09.25 |