FastDFS Distributed File System installation and configuration-Single Server version

Source: Internet
Author: User
Tags crc32 file url

FastDFS Distributed File System installation and configuration-a single Server version installation environment and its configuration directory a Server integrates a Tracker Server + two Storage Server1 environment IP: 192.168.127.62Tracker Server base_path: /home/fastdfs/tracker port: 22122 http port: 90903 storage Server base_path:/home/fastdfs/fdfs_storage port: 23000 http port: 8887 group: group24storage Server base_path: /home/fastdfs/fdfs_storage1 port: 23001 http port: 8889 group: group301 # software installation package storage: 02/usr/local/src03/etc/fdfs/* # tracker, storage · Configuration Set file 04 05 # basic directory list: 06/home/fastdfs/tracker # create a tracker directory to save the running log 07/home/fastdfs/fdfs_storage # create a Storage directory to save the running log and its data 08/home/fastdfs/fdfs_storage1 # create the Storage1 directory stores the running log and its data. 09 10 command summary: mkdir-p/home/fastdfs/tracker; mkdir-p/home/fastdfs/fdfs_storage; mkdir-p/home/fastdfs/fdfs_storage1; 11 12 is a convenient directory, set variable 13 # vi. bashrc14alias worksrc = 'CD/usr/local/src' 15 configuration effective 16 # source. bashrc install FastDFS first install libevent, Fast DFS is internally bound with libevent as the http server 01 # uninstall the built-in libevent. the built-in version is too low. If fastdfs is installed, an error occurs 02 rpm-qa | grep libevent; yum remove libevent * 03 04 worksrc; 05 wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz;06tar-zxvf libevent-2.0.19-stable.tar.gz; 07cd libevent-2.0.19-stable; 08 make clean; 09. /configure -- prefix =/usr/local/libevent10make & make install; 11 12 # create a soft link to the/lib library for libevent. The 64-bit system corresponds to/l. Ib6413ln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/lib/libevent-2.0.so.514ln-s/usr/local/libevent/lib/libevent-2.0.so.5/usr/lib64/libevent-2.0.so.515 16 command Summary: worksrc; wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz;tar-The zxvf libevent-2.0.19-stable.tar.gz; cd libevent-2.0.19-stable; make clean ;. /configure -- prefix =/usr/local/libevent; make & make instal L; cd .. /install FastDFS Step 1 wget http://fastdfs.googlecode.com/files/FastDFS_v3.08.tar.gz2tar-zxvf FastDFS_v3.08.tar.gz3cd FastDFS4vim make. sh5 # change # WITH_HTTPD = 1 to WITH_HTTPD = 1 to support http6./make. sh C_INCLUDE_PATH =/usr/local/libevent/include LIBRARY_PATH =/usr/local/libevent/lib7./make. sh installFastDFS configuration and start Tracker Server. port 9090 is used, which is separated from common http ports 80 and 8080. 1 # modify tracker. conf configure 2vim/etc/fdfs/tracker. conf3base_pat H =/home/yuqing/fastdfs-> base_path =/home/fastdfs/tracker # log directory 4http. server_port = 8080-> http. server_port = 9090 # http port 5 # include http. conf-> # include http. conf # enable the built-in http service 6reserved_storage_space = 4 GB-> reserved_storage_space = 1GB7 8 # Start Tracker Server9/usr/local/bin/fdfs_trackerd/etc/fdfs/tracker. conf1 # errors during startup 2 #. /fdfs_trackerd: error while loading shared libraries: libevent-2.0.so.5: cannot Open shared object file: No such file or directory3 # solution 4ln-s/usr/lib/libevent-2.0.so.5/usr/lib64/libevent-2.0.so.5 # Check whether tracker is started successfully, you can view the following file: 1vim/home/fastdfs/tracker/logs/trackerd. log2 # [19:01:30] INFO-FastDFS v3.08, base_path =/home/fastdfs/tracker, run_by_group =, run_by_user =, connect_timeout = 30 s, network_timeout = 60 s, port = 22122, bind_addr =, max_connections = 256, work_threads = 4, st Ore_lookup = 0, store_group =, store_server = 0, store_path = 0, reserved_storage_space = 1024 MB, download_server = 0, allow_ip_count =-1, bytes = 10 s, check_active_interval = 120 s, thread_stack_size = 64 KB, bytes = 1, bytes = 86400 s, bytes = 300 s, use_trunk_file = 0, slot_min_size = 256, slot_max_size = 16 MB, trunk_file_size = 64 MB, trunk_cr Eate_file_advance = 0, trunk_create_file_time_base =, trunk_create_file_interval = 86400, trunk_create_file_space_threshold = 20 GB1 # start successfully, add start 2 # vim/etc/rc. d/rc. local3/usr/local/bin/fdfs_trackerd/etc/fdfs/tracker. configure and start the Storage Server using conf, and use port 8887 01 # modify the storage. conf: Configure 02vim/etc/fdfs/storage. conf03group_name = group1-> group_name = group204port = 23000 # the storage server port storage service port 05base_path =/home /Yuqing/fastdfs->/home/fastdfs/fdfs_storage # log directory and data 06store_path0 =/home/yuqing/fastdfs-> store_path0 =/home/fastdfs/fdfs_storage07tracker_server = 192.168.209.121: 22122-> tracker_server = 192.168.127.6: 2212208http. server_port = 8888-> http. server_port = 8887 # http port 09 # include http. conf-> # include http. conf # enable built-in http service 10 11 # Start storage Server12/usr/local/bin/fdfs_storaged/etc/fdfs/storage. conf13 14 # Next we will see a lot of mkdir data path. This is the system creating the data DIRECTORY 15 data path:/home/fastdfs/fdfs_storage/data, mkdir sub dir... 16 mkdir data path: 00... 17 mkdir data path: 01... 18 mkdir data path: 02... 19 mkdir data path: 03... 20 ....................... 21 data path:/home/fastdfs/fdfs_storage/data, mkdir sub dir done.1 # start successfully, add start 2 # vim/etc/rc. d/rc. local3/usr/local/bin/fdfs_storaged/etc/fdfs/storage. configure and start the storage service (Storage1 Ser) Server), use port 8889 01 to re-copy the storage. conf is storage1.conf02cp storage. conf storage1.conf03 # modify storage1.conf to 04vim/etc/fdfs/storage1.conf05group _ name = group2-> group_name = group306port = 23000-> port = 23001 # the storage server port storage service port 07base_path =/ home/yuqing/fastdfs->/home/fastdfs/fdfs_storage1 # log directory and data 08store_path0 =/home/yuqing/fastdfs-> store_path0 =/home/fastdfs/fdfs_storage1_tracker_server = 192.16 8.209.121: 22122-> tracker_server = 192.168.127.6: 2212210http. server_port = 8888-> http. server_port = 8889 # http port 11 # include http. conf-> # include http. conf # enable built-in http service 12 13 # Start storage Server14/usr/local/bin/fdfs_storaged/etc/fdfs/storage1.conf15 16 # Many mkdir data paths will appear next, the system is creating the data DIRECTORY 17 data path:/home/fastdfs/fdfs_storage1/data, mkdir sub dir... 18 mkdir data path: 00... 19 mkdir data path: 01... 20 mkdir d Ata path: 02... 21 mkdir data path: 03... 22 ....................... 23 data path:/home/fastdfs/fdfs_storage1/data, mkdir sub dir done.1 # start successfully, add start 2 # vim/etc/rc. d/rc. local3/usr/local/bin/fdfs_storaged/etc/fdfs/storage. conf test and use FastDFSFastDFS to configure client1vim/etc/fdfs/client. conf2base_path =/home/yuqing/fastdfs-> base_path =/home/fastdfs/tracker3tracker_server = 192.168.209.121: 22122-> tracker_server = 192. 168.127.6: 221224http. tracker_server_port = 8080-> http. tracker_server_port = 90905 # include http. conf-> # include http. conf1cd/usr/local/bin2vim aa.txt added: Display aa.txt text data: wq3./fdfs_test/etc/fdfs/client. after conf upload aa.txt is successfully executed, the following prompt is displayed: 01 #. /fdfs_test/etc/fdfs/client. conf upload aa.txt 02 [02:08:26] INFO-base_path =/home/fastdfs/tracker, connect_timeout = 30, network_timeout = 60, tracker_serve R_count = 1, anti_steal_token = 0, anti_steal_secret_key length = 003tracker_query_storage_store_list_without_group: 04 server 1. group_name = group2, ip_addr = 192.168.127.6, port = 232.165group_name = group2, ip_addr = 192.168.127.6, port = Container = group2, remote_filename = M00/00/00/wKh_BlA3wxql4hTXAAAAB8v-VvY710.txt08source ip address: Export timestamp = 2012-08-25 02: 08: 2610 file size = 711 file crc32 = 342244325412 file url: http: // 192.168.127.6: 9090/group2/M00/00/00/wKh_BlA3wxql4hTXAAAAB8v-VvY710.txt13storage_upload_slave_by_filename14group_name = group2, remote_filename = M00/00/00/wKh_BlA3wxql4hTXAAAAB8v-VvY710_big.txt15source ip address: 192.168.127.616file timestamp = 2012-08-25 02: 08: 2617 file size = 718 file crc32 = 342244325419 file url: http: // 192.168.127.6: 9090/grou P2/M00/00/00/wKh_BlA3wxql4hTXAAAAB8v-VvY710_big.txt1 may occur during the execution of the firewall seal: 2 # ERROR-file: tracker_proto.c, line: 420, connect to 192.168.127.6: 22122 fail, errno: 113, error info: No route to host3 solution: 4 # iptables-L; iptables-F5service iptables stop test download file in the browser, enter the url address, the tracker server is automatically redirected to the storage server of the stored file. The file is successfully downloaded. So far, FastDFS has been successfully set up. Write your own client for access: 1. Example of General commands for displaying aa.txt text data: 1 # restart tracker, storaged2/usr/local/bin/restart. sh/usr/local/bin/fdfs_trackerd/etc/fdfs/tracker. conf3/usr/local/bin/restart. sh/usr/local/bin/fdfs_storaged/etc/fdfs/storage. conf1 # restart tracker, storaged2/usr/local/bin/stop. sh/usr/local/bin/fdfs_trackerd/etc/fdfs/tracker. conf3/usr/local/bin/stop. sh/usr/local/bin/fdfs_storaged/etc/fdfs/storage. confview source1 # monitor storage2/usr/local/bin/fdfs_monitor/etc/fdfs/storage. conf3 # If there are multiple groups, you only need to monitor one of the groups to view the status ports of all groups:

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.