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-one server is integrated with one TrackerServer and two StorageServer1 environment IPs: 192.168.127.62TrackerServerbase _ path:/home/fastdfs/tracker... 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 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 first installs libevent to install FastDFS. FastDFS is internally bound with libevent as the http server 01 # Uninstall the system's built-in libevent. if the version is too low, an error occurs when fastdfs is installed. 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, 64-bit system correspondence/lib6413ln-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 -Zxvf libevent-2.0.19-stable.tar.gz; cd libevent-2.0.19-stable; make clean;./configure -- prefix =/usr/local/libevent; make & make install; cd ../Step 1 wget to install FastDFS 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_path =/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 If 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, store_lookup = 0, store_group =, store_server = 0, store_path = 0, bytes = 1024 MB, download_server = 0, allow_ip_count =-1, sync_log_buff_interval = 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_create_file_advance = 0, trunk_create_file_time_base =, trunk_create_file_interval = 86400, timeout = 20 GB1 # started successfully, 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, which 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. conf configures and starts the storage service (Storage1 Server), and uses 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/destination = 192.168.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 data 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_server_count = 1, anti_steal_token = 0, duration length = duration: 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/group2/M00/00/00/wKh_BlA3wxql4hTXAAAAB8v-VvY710_big.txt1 During execution, firewall sealing may occur: 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. the url entered in the package will automatically redirect the tracker server to the storage server of the storage 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:
Related Article

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.