"One of the Fastdfs Distributed file Systems": Build, deploy, configure

Source: Internet
Author: User
Tags server port git clone

Recently, to improve storage performance (mainly write performance) for small files (around 100KB), the idea of using FASTDFS requires a simple test of its performance.


1. Install Fastdfs

Cd/opt && mkdir fastdfs && cd fastdfs
git clone https://github.com/happyfish100/fastdfs.git
git clone https://github.com/happyfish100/libfastcommon.git
cd/opt/fastdfs/libfastcommon
./make.sh & &/make.sh Install
cd/opt/fastdfs/fastdfs
./make.sh &&/make.sh Install
After successful installation, Fastdfs installed in the/usr/bin. Configuration file in/etc/fdfs


2. Modify the configuration file

The configuration file is placed under/etc/fdfs:

Client configuration file:/etc/fdfs/client.conf.sample

Storage configuration file:/etc/fdfs/storage.com.sample

Tracker configuration file:/etc/fdfs/tracker.com.sample

Cd/etc/fdfs
mv client.conf.sample client.conf
mv storage.conf.sample storage.conf
MV Tracker.conf.sample tracker.conf
Client:node1

Tracker Server:node2/node3

Group1:storage Server1 (node4)/storage server2 (NODE5)/storage Server3 (NODE6)

Group2:storage server4 (Node7)/storage server5 (node6)/storage Server6 (Node8)

Modify client.conf:

Base_path=/mnt/xfsd/fastdfs/client
tracker_server=node2:22122
tracker_server=node3:22122
#其他都采用默认
Where Base_path is the directory of data and log writes to the client, this directory must be specified and created well in advance.

Modify storage.conf:

Base_path=/mnt/xfsd/fastdfs/storage
max_connections=2048
accept_threads=4
work_threads=8
tracker_server=node2:22122
tracker_server=node3:22122
log_level=info
#其他都采用默认
Max_connections: The maximum number of concurrent requests, the default 256, if the set is relatively small, then if the concurrent request reached more than 300, it will cause a failure, if set too large (20480) will cause storage server startup failed, do not know why. The specific parameter configuration can be seen in the comments of the configuration file.

Modify Tracker.conf:

Base_path=/mnt/xfsd/fastdfs/tracker
max_connections=2048
accept_threads=4
work_threads=8
Log _level=info
Use_trunk_file = True
It is worth mentioning that use_trunk_file for small file merging, the default merged into 64MB block.

3. Start Service

Service startup, restart, status query, etc.

/usr/bin/fdfs_trackerd/etc/fdfs/tracker.conf
/usr/bin/fdfs_storaged/etc/fdfs/storage.conf

service Fdfs_ storaged Status
service fdfs_storaged start
service fdfs_storaged stop
service fdfs_storaged restart

Service Fdfs_trackerd Status
service fdfs_trackerd start
service fdfs_trackerd restart
service Fdfs_ Trackerd stop

4. Inspection services

/usr/bin/fdfs_monitor/etc/fdfs/storage.conf
The following information is exported:

[2016-03-08 17:40:36] Debug-base_path=/mnt/xfsd/fastdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=2, anti_ Steal_token=0, Anti_steal_secret_key length=0, Use_connection_pool=0, g_connection_pool_max_idle_time=3600s, Use_

Storage_id=0, Storage server ID count:0 server_count=2, server_index=1 Tracker server is xxxxxx:22122 group Count:2 Group 1:group name = group1 disk Total spaces = 6654860 MB disk free spaces = 6430591 MB trunk free spaces = 127 MB Storage Server count = 3 Active Server count = 3 Storage Server port = 23000 Storage HTTP port = 8888 Store Path count = 1 subdir Count per path = 256 current Write Server index = 0 current trunk File id = 3481 Storage 1:id = xxx.119 ip_addr = X  xx.119 ACTIVE http domain = Version = 5.08 join time = 2016-03-07 21:46:38 up time = 2016-03-07 21:46:38 Total Storage = 6654860 MB free storage = 6431077 MB Upload priority = Ten Store_path_count = 1 Subdir_count_per_path = 256 Storage_port= 23000 Storage_http_port = 8888\ Storage 2: ...

Storage 3: ... Group 2:group name = group2 Disk Total spaces = 6654860 MB disk free spaces = 6429913 MB trunk free spaces = 152 MB storage Server count = 3 Active Server count = 3 Storage Server port = 23000 Storage HTTP port = 8888 Store Path count = 1 subdir Count per path = 256 current Write Server index = 2 current trunk file id = 3501 Storage 1:id = xxx.122 ip_addr = X  xx.122 ACTIVE http domain = Version = 5.08 join time = 2016-03-07 21:50:57 up time = 2016-03-07 21:50:57 Total Storage = 6654860 MB free storage = 6429917 MB Upload priority = Ten Store_path_count = 1 Subdir_count_per_path = 256 Storage_port = 23000 Storage_http_port = 8888 Current_write_path = 0 Source Storage id = If_trunk_server =

    1 Storage 2: ... Storage 3: ...

5. Data Manipulation

To perform a test on the client side:

Upload upload operation:

/usr/bin/fdfs_test/etc/fdfs/client.conf UPLOAD/DATA/FILES/BAK/SMALLFILE0

Download Download Action:



6. Redeployment Method

Because the test requires that replica 2 be turned into replica 3, only the Base_path folder under Client,storage,tracker Tracer server and Storage server side will be removed. Then recreate the folder, restart the individual server services, no need to uninstall, recompile installation, and so on.


Author: Yi's solo show

Email:leaguenew@qq.com

Annotated origin: http://blog.csdn.net/lavorange/article/details/50814086



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.