Upload
kim-yong-duk
View
312
Download
1
Embed Size (px)
Citation preview
-Developed by Kim [email protected]
MrFSMrFS
Contents• Intro• Characteristics• Architecture• Tools • Client api• Install• Screenshots• ToBe• About developer
Intro• Distributed filesystem written by linux c/c++.• Architecture oriented fault-tolerance/simplicity/unlimited (file
number, size, store servers).• Consists of Center (meta), Stores (data).• B+ tree namespace by reguar file.• Centralized block meta of store servers.• Tcp/ip stack as Job queues.• Accurate synchronization between meta and data. (file/block
count, size,..)• Rich file operation api (partial write/read, append, truncate,..).• File partial read/write by appls (ms office, notepad, alzip,..) on
windows explorer (by samba, fuse).
Characteristic
Design oriented fault-tolerance/simplicity/meta integrity/unlimited (file number, size, store servers)
Easy install/setup/administration
Local tcp/ip stack as Job QueEfficient bitmap module based on free lists managmentMeta file integrity oriented design (on system crash,..)
B+ tree namespace based on file
Alloc block file io thread per block disks
(return os error-no on error)
File read/write by appls (ms office, notepad, alzip,..) on windows
explorer
Multiplex filesystem statistics(file number, size per block disks)
Centralized block meta(no block reports, fast
reboot)
Efficient block alloc(based on block files,
io)
Rich client api(seek, partial write, truncate,..)
<Fig1. mrfs characteristics>
Architecture• B+ tree Namespace based on regular file• Consists of Center, Stores, cliapi, fuse• Centralized block meta of stores server• Near unlimited (store servers, file number/size)• File partial read/write by window explorer (by samba, fuse)
mrfs Center
File namespace /foo/bar
BlkNo 1 : Store1
store server
Linux file system
..
store server
Linux file system
..
Regist,heartbeat,block size
mrfs cliapi(file name, operation gubun)
(file handle, blk location)
(block data)
(block handle, operation gubun)
mrfs admin tool
mrfs fuse
window explorer
samba
<Fig2. mrfs architecute>
Tools• Administration/client tool
Function Command RemarkMake a directory mrfs mk path mkdirDelete a file mrfs rm path rmList a file mrfs ls(r) path ls -RRename a file mrfs mv opath npath mvUpload a file mrfs up local remote or directoryDownload a file mrfs down remote local or directoryCreate a user mrfs adduser uid passQuery filesystem mrfs sys dfQuery store servers mrfs storeQuery filesystem mrfs sz summaryQuery locked a file mrfs qlk Pending by fwrite, freadUnlock locked a file mrfs ulk inode
<Table1. mrfs functions>
Client apiFunction Prototype Remark
Open (create) file int mr_open (const char *fname, int flag, INT64 offs = -1)
open
Close file int mr_close (int fd) closeWrite file long mr_write (int fd, const void *buf, size_t count) writeRead file long mr_read (int fd, void *buf, size_t count) readMake directory int mr_mkdir (const char *path) mkdirRename file int mr_mvfile (const char *ofile, const char *nfile) renameDelete file int mr_rmfile (const char *file) removeReposition a stream int mr_seek (int fd, INT64 offs, int whence =
SEEK_SET)seek
Obtains current file position INT64 mr_ftell (int fd) ftellShrink or extend the size of file int mr_truncate (const char *path, INT64 offs)
int mr_ftruncate (int fd, INT64 offs)(f)truncate
Get file status nt mr_stat (const char *file, struct stat64 *buf) Stat (tobe)View file int mr_catfile (const char *file, int out = 0) catUpload file int upload_files (const char *local, const char
*remote)Download file int download_files (const char *local, const char
*remote)Change file last access and modification times
int mr_utime (const char *path, time_t atime, time_t mtime)
utime
Open a directory DIR *mr_opendir (const char *name) Opendir (tobe)Read directory entry struct dirent *mr_readdir (DIR *dirp) Readdir (tobe)Close a directory int mr_closedir (DIR *dirp) Closedir (tobe)Initialize mrfs client application int mr_init () Be called before api
call
<Table2. Lists client api>
Install – get file, copy• Get mrfs binary $wget https://www.dropbox.com/s/6iuw0gvgdqvx650/mrfs.v10.bin.tar.gz?dl=0 -O, --output-
document=mrfs.v10.bin.tar.gz
• Add hosts in /etc/hosts for center, stores (as root) $vi /etc/hosts 192.168.145.15 center #example 192.168.145.16 store1
• Create group/user in center, stores servers (as root) $groupadd mrfs $useradd –g mrfs –s /bin/bash –d /home/mrfs mrfs $passwd mrfs
• Uncompress mrfs binary in center, stores $mkdir –p /mrfs #make install directory in center, stores server (as root) $cd /; tar xvfz mrfs.v10.bin.tar.gz $chown –R mrfs:mrfs /mrfs
• Set environment varibles of mrfs in center, stores $vi ~/.bashrc export MRFS_HOME=/mrfs export CENTER_HOST=center export CENTER_PORT=2001 export STORE_PORT=2005 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MRFS_HOME/lib export PATH=$PATH:$MRFS_HOME/bin:.
Install – start mrfs• Set block file size (in center) $vi /mrfs/bin/centerd.sh #edit value of block file size (bytes) export BLOCKFILE_SIZE=67108864
• Add store servers (in center) $vi /mrfs/cfg/stores /rack1/center /rack1/store1
• Add block file directory (in stores) $vi /mrfs/cfg/bdirs /mrfs/bfile/b1 /mrfs/bfile/b2
• Start center daemon (in center) $cd /mrfs/bin $cp ./mrfsc /etc/init.d $service mrfsc start #start center daemon $chkconfig mrfsc on #register service
• Start store daemon (in stores) $cd /mrfs/bin $cp ./mrfss /etc/init.d $service mrfss start #start store daemon $chkconfig mrfss on #register service
Install - fuse• Make directory (in server to be mount) $mkdir –p /fump #make directory fuse mount point $chown –R mrfs:mrfs /fump #change owner this directory
• Fuse install/mount $wget https://www.dropbox.com/s/vrqcdkqnh8pu1e1/fuse-2.9.4.tar.gz?dl=0 -O, --output-
document=fuse-2.9.4.tar.gz #get fuse library $tar xvfz fuse-2.9.4.tar.gz #uncompress fuse library $cd fuse-2.9.4 $./configure #configure $make #compile $make install #as root, install fuse library $vi /etc/fuse.conf #as root, set config user_allow_other max_read=65536 max_write=65536 $cd /mrfs/bin $cp ./mrfuse /etc/init.d $service mrfuse start #mrfs fuse service start $chkconfig mrfuse on #register service
Install - samba• Samba install/start $yum install samba # install samba $smbpasswd –a mrfs #create samba account $vi /etc/samba/smb.conf #configuration fuse mount point [fump] path = /fump public = yes writable = yes printable = no write list = mrfs $service smb start #samba start $chkconfig smb on #register as service
Screenshot 1
<Fig3. screenshot - mrfs sys, store, sz >
Screenshot 2
<Fig4. screenshot - mrfs lsr >
Screenshot 3
<Fig5. screenshot - compress file by windows appl on windows explore >
ToBe• N-replication, balancer• Checksum, compress• Trash hold• Link – hard, soft • Multithread-safe application interface (include java)• Software-Defined Storage• Map-reduce
About developer• Software developer, with c/c++, java on Unix/Linux/Windows• Interests in kernel, network, bigdata, filesystem, dbms.• E-mail: [email protected]• Phone: +82-10-5173-2024