With previous efforts, a basic set of TFS environments has been built, including a nameserver and a dataserver as well as a standalone nginx-tfs, while in real-world Distributed file systems, only one dataserver is obviously not working, Therefore, this article describes the Operations and configuration procedures for adding data server under the TFS environment.
Environment Introduction:
TFS nameserver Server ip:192.168.1.225
Tfs dataserver Server ip:192.168.1.227
New TFS dataserver server IP:192.168.1.228
Nginx TFS Server IP:192.168.1.12
One: install TFS Software on the 228 server , modify the configuration file
1234567891011 |
227服务器: # cd /usr/local/ # tar -zcvpf tfs.tgz tfs/ # scp tfs.tgz 192.168.1.228:/usr/local/ 228服务器: # cd /usr/local/ # tar -zxvpf tfs.tgz # cd tfs # rm -rf dataserver_* # df -h |grep data |
1234567891011121314151617181920212223242526272829303132 |
# grep -v ‘^#‘ /usr/local/tfs/conf/ds.conf |grep -v ‘^$‘
[public]
log_size=1073741824
log_num = 16
log_level=info
task_max_queue_size = 10240
port = 9998
work_dir=/usr/local/tfs
dev_name= eth0
thread_count = 4
ip_addr = 192.168.1.228
[dataserver]
ip_addr = 192.168.1.225
ip_addr_list = 192.168.1.225|192.168.1.226
port = 8108
heart_interval = 2
check_interval = 2
replicate_threadcount = 2
block_max_size = 7549747
dump_visit_stat_interval = 60
backup_type = 1
backup_path = /data/tfs
mount_name = /tfs/data
mount_maxsize = 20971520
base_filesystem_type = 1
superblock_reserve = 0
avg_file_size = 40960
mainblock_size = 7549747
extblock_size = 419430
block_ratio = 0.5
hash_slot_ratio = 0.5
ds_thread_count = 4
|
Second: Initialize the disk, start the dataserver service
123 |
# cd /usr/local/tfs/scripts/ # sh stfs format 1-3 # df -h |grep data |
12345 |
# sh tfs start_ds 1-3 dataserver 1 is up SUCCESSFULLY pid: 29264 dataserver 2 is up SUCCESSFULLY pid: 29290 dataserver 3 is up SUCCESSFULLY pid: 29309 # netstat -ntpl |grep data |
Three: See if Add is successful, modify nameserver replicate to 2
12345678910111213 |
Name server服务器 # grep ‘replication‘ /usr/local/tfs/conf/ns.conf max_replication = 2 min_replication = 2 # /usr/local/tfs/scripts/tfs stop_ns nameserver exit SUCCESSFULLY # /usr/local/tfs/scripts/tfs start_ns nameserver is up SUCCESSFULLY pid: 12037 # /usr/local/tfs/bin/ssm -s 192.168.1.225:8108 show > machine -a |
#/usr/local/tfs/bin/ssm-s 192.168.1.225:8108-i Show Server
# tail-f/usr/local/tfs/logs/nameserver.log
Four: Upload, read the test, you can see the shadow file stored on 228
12 |
# /usr/local/tfs/bin/tfstool -s 192.168.1.225:8108 TFS> put /etc/passwd |
This article from "Chop Month" blog, declined reprint!
TFS Add DataServer