금요일, 2월 13, 2009

linux 기반 flame / smoke 에서 Standard Filesystem

이전에 잠깐 언급했었던 Standard Filesystem (이하 Standard FS 로 표기) 를 다루도록 하겠다.



Internel SATA HDD 를 XFS 로 마운트 해서 Standard FS 로 설정해서

Stone Storage 대신 Stone 처럼 사용하는 방법에 대해서 설명하겠다.

미리 밝히자면, Standard FS 를 사용하기 위해선 별도의 라이센스가 별도로 필요로 하며,

SATA HDD 가 많이 좋아지긴 했지만 이걸로 작업을 하기엔 다소 무리다.

* 참고적으로 요즘 SATA HDD는 전송속도가 100 MB/s 정도 나오고
실제로 sw_io_perf_tool 로 체크해본 결과 100 MB/s 정도의 속도가 나오긴하지만
SD 작업이라고 할지라도 작업이 좀 많아지거나 복잡해지면 좀 힘들지 않을까 싶다.*

Standard FS 로 작업을 하기 위해선 하드웨어 타입의 Raid Storage 가 필요로 한다.

* 하드웨어 타입의 Raid Storage 를 설정하는 방법은 어떻게 구성하고
어떻게 묶느냐에 따라서 설정해야되는 방법이 달라지고 좀 더 복잡해진다. *

또한, 사전에 이해 해야되는 이론적 구조설명은 다 패스하겠다.
* Stone+wire Filesystem 구조부터 시작해서 설명해야 될 내용이 너무 너무 많아진다..
블로그에 포스팅 할 수준을 넘어서 메뉴얼 수준이 되어버린다.
무엇보다도.............................................. 귀찮다 !! *


2009 를 기준으로 설명하겠다.

Standard FS 셋팅 방법 중 가장 간단한 구조이다.

* 이걸 이해 못한다면 답 안나오는거다. 그냥 Stone FS 쓰길 권장한다. *



우선 system HDD 와 Standard FS 를 잡을 HDD 를 붙였을때 linux 상에서 확인해보면


[root@discreet ~]# fdisk -l grep dev
Disk /dev/sda: 150.0 GB, 150039945216 bytes
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 274 2096482+ 82 Linux swap
/dev/sda3 275 18241 144319927+ 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
/dev/sdb1 1 60801 488384001 42 SFS

위와 같이 보여질것이다.

그럼, 이제부터..
/dev/sdb 를 XFS 로 잡아준후 마운트해서 Standard FS 로 설정해보도록 하겠다.

/dev/sdb 의 파티션을 XFS 로 잡아준다.

* 참고적으로 부연설명하자면 linux 에서 만들어준 XFS 와 IRIX 상에서 만들어지는 XFS 는
약간 다르다. 파티션 7 SGI xfs 의 시작점이 IRIX 상에서 만들면 1 부터 시작하지만
linux 상에서는 시작점이 5 부터 시작한다. 또한 파티션 9 SGI volhdr 의 Sectors 가
IRIX 상에서 만들면 4096 이지만 linux 상에서는 80325 로 만들어진다.
xfs 뿐만이 아니라 파티션 8 raw 의 경우도 역시 시작점이 linux 의 경우는 5 부터 시작한다.
Stone FS 역시 IRIX 상에서 만든거와 linux 상에서 만든게 크기가 다르게 인식한다. *


[root@discreet ~]# fdisk /dev/sdb
The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 42 SFS
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): x
Expert command (m for help): g
Building a new SGI disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content will be unrecoverably lost.

Expert command (m for help): r
Command (m for help): p
Disk /dev/sdb (SGI disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
9: /dev/sdb1 0 4 80325 0 SGI volhdr
11: /dev/sdb2 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Command (m for help): n
Partition number (1-16): 7
First cylinder (5-60800, default 5):Using default value 5 Last cylinder (5-60800, default 60800):Using default value 60800
Command (m for help): p
Disk /dev/sdb (SGI disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
7: /dev/sdb1 5 60800 976687740 83 Linux native
9: /dev/sdb2 0 4 80325 0 SGI volhdr
11: /dev/sdb3 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Command (m for help): t
Partition number (1-16): 7
Hex code (type L to list codes): a
Changed system type of partition 7 to a (SGI xfs)
Command (m for help): p
Disk /dev/sdb (SGI disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
7: /dev/sdb1 5 60800 976687740 a SGI xfs
9: /dev/sdb2 0 4 80325 0 SGI volhdr
11: /dev/sdb3 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.Syncing disks.

만들어진 파티션을 확인해보면

[root@discreet ~]# fdisk -l
Disk /dev/sda: 150.0 GB, 150039945216 bytes
255 heads, 63 sectors/track, 18241 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 274 2096482+ 82 Linux swap
/dev/sda3 275 18241 144319927+ 83 Linux
Disk /dev/sdb (SGI disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
7: /dev/sdb1 5 60800 976687740 a SGI xfs
9: /dev/sdb2 0 4 80325 0 SGI volhdr
11: /dev/sdb3 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Disk /dev/sdb2 (SGI disk label): 255 heads, 63 sectors, 5 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
7: /dev/sdb2p1 5 60800 976687740 a SGI xfs
9: /dev/sdb2p2 0 4 80325 0 SGI volhdr
11: /dev/sdb2p3 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----
Disk /dev/sdb3 (SGI disk label): 255 heads, 63 sectors, 60801 cylinders
Units = cylinders of 16065 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
7: /dev/sdb3p1 5 60800 976687740 a SGI xfs
9: /dev/sdb3p2 0 4 80325 0 SGI volhdr
11: /dev/sdb3p3 0 60800 976768065 6 SGI volume
----- Bootinfo -----
Bootfile: /unix
----- Directory Entries -----

위와 같이 나올것다.

이제 파일시스템을 만들어준다.

[root@discreet ~]# mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1 isize=256 agcount=16, agsize=7630372 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=122085952, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=32768, version=1
= sectsz=512 sunit=0 blks, lazy-count=0
realtime =none extsz=4096 blocks=0, rtextents=0

마운트 시킬 경로를 만들어준다.

[root@discreet ~]# mkdir /media/stoneMedia

fstab 파일을 열어서 수정해준다.

[root@discreet ~]# nedit /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/hda /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
/dev/sdb1 /media/stoneMedia xfs defaults 1 3

이제 마운트 하자.

[root@discreet ~]# mount -va
mount: LABEL=/boot1 already mounted on /boot
mount: none already mounted on /dev/pts
mount: none already mounted on /dev/shm
mount: none already mounted on /proc
mount: none already mounted on /sys
/dev/sdb1 on /media/stoneMedia type xfs (rw)

마운트 시킨걸 확인해보면

[root@discreet ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext3 136G 9.3G 120G 8% /
/dev/sda1 ext3 99M 14M 81M 15% /boot
none tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sdb1 xfs 466G 272K 466G 1% /media/stoneMedia

권한설정을 해준후

[root@discreet ~]# chmod 777 /media/stoneMedia

exports 파일을 열어서 수정해준다.

[root@discreet ~]# nedit /etc/exports


# To improve performance in archiving using NFS, use the parameter ,async, instead of ,sync,
# DO NOT use async parameter on the /usr/discreet path to avoid potential corruption.
# Please, refer to the man page on exports, for more details on the async parameter.
/usr/discreet *(rw,sync,no_root_squash)
/media/stoneMedia *(rw,sync,no_root_squash)

수정해준걸 적용시키면

[root@discreet ~]# exportfs -vfa
exporting *:/media/stoneMedia
exporting *:/usr/discreet

이제 /usr/discreet/sw/cfg 에서 Standard FS 를 설정해주자.

stone+wire.cfg 파일을 열어서 수정해주자.

#
# S+W configuration file
#
# Each S+W partition can be independently configured.
#
[Partition7]
# Name of the partition.
#
# Default for partition 0: Name=stonefs
# Default for partitions 1..7: Name=stonefs#
#
#Name=
# If specified, the path denotes that media should be stored in the file path
# specified, as opposed to the Stone. Typical standard fs path will be # /mnt//fs/part/ where is the device name, fs is
# the framestore identifier and part is the partition identifier.
#
# Default: Path=
#
Path=/media/stoneMedia
# A partition can be flagged as shared to allow another station running
# Stone+Wire to read the media directly from the device, instead of going
# through the Stone+Wire server. This is particularly useful for a SAN/NAS
# environment. The *device* mount point must be identical on ALL stations
# that access this partition.
#
# Bandwidth managed partitions should NOT be Shared. This is to enforce that
# their media will always be accessed via the bandwidth aware S+W Server.
# Otherwise, remote hosts will steal your bandwidth by directly accessing
# the files via NFS.
#
# A shared partition does not mean that two separate systems can use the path
# defined above as their media cache. Each system must own and *manage*
# its own media cache, self contained within its own path within the device
# mount point.
#
# Default: Shared=False
#
Shared=True
# Video Media Pre-Allocation Strategy
#
# By default, video media files are allocated on the fly as they are rendered or
# written. No file pre-allocation is performed when clips are created.
#
# On shared filesystems, or when background IO operations occur, media file
# interleaving can occur. This causes clip fragmentation and reduces IO
# performance.
#
# To circumvent this, a media file pre-allocation strategy can be deployed to
# ensure that the media files exist before being written, at the expense of a
# performance hit at clip allocation.## The available strategies are listed below:
#
# FALLOCATE - The files will be pre-allocated and zero-ed out on the
# allocation. On most file system this operation is as expensive
# as writing the files.
#
# RESERVE - The space on disk necessary for the file will be reserved
# but not written. The apparent size of the frame will remain 0.
# This operation is typically much faster than FALLOCATE but supported
# only on selected filesystems such as XFS.
#
# NONE - No pre-allocation is done. Space will be allocated when the
# frame is written.
#
# Note: Pre-allocation when using compressed media (such as JPEG) will
# not be performed since it is impossible to know the size of a
# compressed file in advance. The strategy will be ignored in
# these cases.## Default: Preallocation=NONE
#
#Preallocation=NONE

[DefaultFileFormats]
# The following file formats denote the file types to use when creating video
# of a given or bit depth. The file formats must support the corresponding bit
# depths. If not, S+W will not be able to create images.
#
# These settings can also be applied to each partition by copying the line
# to a partition section above. Partition format settings always override
# default format settings.
#
# Supported 8 bit formats: DPX,TIF,JPG,CIN,SGI,RAW
#
# Default: 8BitIntVideo=DPX
#
#8BitIntVideo=DPX
# Supported 10 bit formats: CIN, DPX, RAW
#
# Default: 10BitIntVideo=DPX##10BitIntVideo=DPX
# Supported 12 bit unpacked formats: DPX, RAW
#
# Default: 12BitIntVideo=DPX
#
#12BitIntVideo=DPX
# Supported 12 bit packed formats: RAW
#
# Default: 12BitPackedIntVideo=RAW
#
#12BitPackedIntVideo=RAW
# Supported float formats: EXR, RAW
#
# Default: floatVideo=RAW
#
#floatVideo=RAW
# The default compression factor [0-100] for all jpeg files written.
# 0 is the highest compression. 100 is the lowest.
#
# Default: JpegCompressionFactor=50
#
JpegCompressionFactor=50

[MetadataDirectory]
# Metadata Root Directory
#
# The ROOT directory under which all metadata associated with the
# media ( stone or standardfs ) is located.
#
# Warning: This setting does not affect IFF/FS metadata ( project/clip ).
#
# Default: RootPath=/usr/discreet/
#
RootPath=/usr/discreet/
# A centralized directory path must be unique across all systems to ensure
# metadata integrity. To this end, the framestore ID will be appended to the
# root path (see above) if the path is flagged as centralized (see below).
# This setting is normally used in conjunction with the clip library and
# project central path defined in /user/discreet/cfg/centralPath.cfg.
#
# For example an host having a RootPath of /mnt/nas/data and a framestore id of
# 54 will have a effective Metadata Root Directory of /mnt/nas/data/54/.
#
# Default: Centralized=False
#
Centralized=True

[StandardFSMediaOptions]
# This option controls whether or not requests to soft-copy (Link) standard FS
# media files should create symbolic links across filesystems if hard-links
# cannot be created. A hard-link can only be created within the SAME
# filesystem.
#
# Default: SymlinkAcrossFilesystems=True
#
SymlinkAcrossFilesystems=True

sw_bwmgr.cfg 파일을 열어서 수정해준다.



#
# Default S+W Bandwidth Manager configuration file
#
[Server]
# TCP port used for incoming requests.
#
# Default: Port=7428
#
#Port=
#
# Message queue address
#
Address=/dev/swbwmgr
[Logger]

# Sets the logging level to one of 'user', 'error', 'warn', 'notice', 'debug'.
#
# Default: Level=notice##Level=notice
#
# Sets the maximum size of a log file before it rotates.
#
# Default: MaxLogFileSizeInMB=2
#
#MaxLogFileSizeInMB=2
#
# Sets the maximum number of log files to keep. A log file is created each
# time the server is run.
#
# Default: MaxNumLogFiles=20
#
#MaxNumLogFiles=20
#
# Directory path to the log file of the daemon. The file will be named
# sw_bwmgr.log.
#
# Default: Path=/usr/discreet/sw/log
#
#Path=/usr/discreet/sw/log
#
#
# List of devices for which to manage bandwidth
#
# For each device, there is one section named [Device].
# (X varies from 0 to N-1 where N is the total number of configured devices.)
#
# Example:
#
#[Device0]
#
# Device paths are specified here. Some devices can have several paths.
#
# Example:
#
#Path0= /mnt/XYZ
#Path1= /usr/local/ABC
#...
#
# Maximum theoretical reading bandwidth of the device, in MBps (mandatory).
# This limits the amount of active reservations. Beyond this threshold,
# additional reservation activation requests will be refused and will
# fall back onto the Default reservation.
# The bandwidth manager automatically measures and updates the actual available
# bandwidth of each device and reduces reserved bandwidth for all applications
# when the device does not meet the bandwidth requirements.
#
#TotalAvailableReadBandwidth= 200
#
# Maximum theoretical writing bandwidth, in MBps
# (defaults to TotalAvailableReadBandwidth)
#
#TotalAvailableWriteBandwidth= 150
#
#
# Default reservation for the reading and writing bandwidth.
# Used as a fall back when maximum total reservations is reached or when no
# specific reservation is made for a requesting application. Syntax is:
#
#DefaultReservation= []
#
# If not specified, defaults to TotalAvailableReadBandwidth / 10.
#
# If not specified, defaults to:
# * TotalAvailableWriteBandwidth / TotalAvailableReadBandwidth
#
#
# List of reservations for the current device. Each entry represents
# the required reservation for an application or a group of applications.
# Applications that are not in the list will receive the DefaultReservation.
#
# The syntax is:
#
#Reservation= []
#
# varies from 1 to the number of reservations configured.
#
# can be one of the following:
#
# - "inferno", "flame", "flint", "smoke"
# - "imcopy", "stonifiseTool", "publishTool",
# - "IFFFSTool" for other IFFFS command-line tools,
# - "S+W Server",# - "IFFFS Wiretap Server"
# Note: Use the "smoke" token for Backdraft Conform.
#
# must use quotes if it contains spaces.
# must not be the same as an defined below.
#
# must be a group name configured in the [Groups] section below.
#
# Multiple processes can share the same reservation (to optimize the
# distribution of bandwidth) by using the same or by being members
# of the same .
#
# and represent the minimum bandwidth required by an
# application (in MBps). If more bandwidth is available on the device,
# the bandwidth manager will give the application as much bandwidth as possible.
# If not specified, defaults to:
# * TotalAvailableWriteBandwidth / TotalAvailableReadBandwidth
#
# Bandwidth is reserved only when the application is running.
#
# Examples:
#
#Reservation1= IFFFS 150 100
#Reservation2= WireServers 20
#
#
# Application groups. Apps in the same group share a single reservation.
#
#[Groups]
#
#= ...
#
# Example:
#
#IFFFS= inferno flint flame smoke
#WireServers= "S+W Server" "IFFFS Wiretap Server"
#
[Additions follow]

[Device0]
Path0=/media/stoneMedia
TotalAvailableReadBandwidth=600
TotalAvailableWriteBandwidth=450
DefaultReservation=10
Reservation1=IFFFS 500
[Groups]
IFFFS=inferno flame flint smoke

sw_framestore_map 파일을 열어서 수정해준다.


#
# Discreet Logic
#
# sw_framestore_map sample file
#
# Notes: * Comments begin with (#) pound signs.
# * Version token is mandatory
# * Current valid protocol tokens are TCP, HIPPI
#
# Please refer to the sw_framestore_map man page for complete
# details.
#
VERSION = 2.0
[FRAMESTORES]FRAMESTORE=discreet HADDR=192.168.0.55 FS=YES ID=55

[INTERFACES]

sw_storage.cfg 파일을 열어서 수정해준다.


[Framestore]
# Framestore Unique Identifier
#
# Identify the framestore on the Wire network. This number must be different
# for any workstation on the same Wire network. Valid number are 1 thru 1023.
#
# This value is overwritten each time a StoneFS partition is sucessfully
# mounted and must be manually defined for StandardFS only configuration.
#
# This value has precedence over the ID defined in the sw_framestore_map
# configuration file.
#
ID=55



Metadata 경로를 RootPath=/usr/discreet/
로 지정해주었으니


[root@discreet ~]# mkdir -p /usr/discreet/55/sw
[root@discreet ~]# chmod 777 /usr/discreet/55
[root@discreet ~]# chmod 777 /usr/discreet/55/sw


만들어준다.

이제 stone+wire 를 재적용 시켜준다.


[root@discreet ~]# /etc/init.d/stone+wire restart


재적용이 완료되었다면 Standard FS 가 제대로 마운트 되었는지 확인해보자.


[root@discreet sw]# sw_df
Partition Free Total %use iFree iTotal %use
7 476224 476225 0 N/A N/A N/A

Standard FS 를 vic 체크해보면

[root@discreet ~]# vic -v stonefs7
Output log to: '/usr/discreet/log/vic.log'.
Opening volume stonefs7 for integrity check ...
Locking volume ...
Initiating integrity check ...
Verifying video stonefs frames ...
Extracting audio waveforms ...
Extracted 0 audio waveform from 0 audio frames (0 failed 0 had none).
Verifying audio waveforms ...
Verified 0 active audio waveform
Verified 0 deleted audio waveform
Verifying audio stonefs frames ...
Processing unreferenced (leaked) media on volume stonefs7...:
{
}
Integrity check successful in 0.0339441 sec
Unlocking volume stonefs7 ...
Closing volume stonefs7...
Closing and flushing logs.
Uninitialising thread manager.


모든 작업이 끝났으니 이제 사용하면 된다.


* 위의 내용은 Local 에 Stone FS 가 있다는 가정에서 설정했으므로
flame 시작명령어는 flame -V stonefs7 이다. *

만일 Local 에 Stone FS 를 사용하지 않고 오로지 Standard FS 로

사용하고자 하는경우에는

sw_framestore_map 를

#
# Discreet Logic
#
# sw_framestore_map sample file
#
# Notes: * Comments begin with (#) pound signs.
# * Version token is mandatory
# * Current valid protocol tokens are TCP, HIPPI
#
# Please refer to the sw_framestore_map man page for complete
# details.
#
VERSION = 2.0

[FRAMESTORES]
#FRAMESTORE=discreet HADDR=192.168.0.55 ID=55

[INTERFACES]

라고 수정해준다.

Standard FS 를 stonefs7 이 아닌 Local 의 Stone FS 처럼 stonefs0 으로 잡힌다.

평소처럼 flame 실행명령어는 flame 쳐주면 된다.


요즘 나오는 하드웨어 타입의 Riad Storage 의 경우 굳이 비싼 4GB FC 타입이 아닌

SAS 2 채널정도만 되더라도 XR 타입의 stone 에 약간 못미치는 성능을 내준다.

하드웨어 타입이므로 핫 스페어 지정해주면 자동복구도 된다.

라벨: , , , ,


댓글: 댓글 쓰기

에 가입 댓글 [Atom]





<< 홈

This page is powered by Blogger. Isn't yours?

에 가입 덧글 [Atom]