FASTDFS configuration, deployment and API usage interpretation (4) FASTDFS configuration detailed client configuration (RPM)

Source: Internet
Author: User

One way is to load the configuration file by invoking the initialization method of the Clientglobal class, and the other is to set the configuration parameters one by two by invoking the API. The latter approach is convenient for loading properties using zookeeper.


1. Load the configuration file:

1 " conf/dfs-client.conf " ;   2             Try {  3                 

2. Actively set configuration parameters:

1     //time limit for connection timeout, in milliseconds2Clientglobal.setg_connect_timeout ( -); 3       4     //Network Time-out time, in milliseconds5Clientglobal.setg_network_timeout (30000); 6       7Clientglobal.setg_anti_steal_token (false); 8       9     //Character SetTenClientglobal.setg_charset ("UTF-8");  One        AClientglobal.setg_secret_key (NULL);  -        -     //port number of the HTTP access Service theClientglobal.setg_tracker_http_port (7271);  -        -     //Tracker Server List -inetsocketaddress[] Tracker_servers =NewInetsocketaddress[sztrackerservers.length];  +tracker_servers[0] ="200.200.200.200:8080";  -tracker_servers[1] ="200.200.201.200:8080";  +tracker_servers[2] ="200.200.202.200:8080";  AClientglobal.setg_tracker_group (NewTrackergroup (trackerservers));

3. Parameter meaning

Connect_timeout, connection time-out

Network_timeout, Network timeout time

Anti_steal_token, anti-theft chain token

CharSet, Character set

Secret_key, key

Tracker_http_port,tracker Server provides the port for the HTTP service

Address List for Tracker_group,tracker Server Group

FASTDFS configuration, deployment and API usage interpretation (4) FASTDFS configuration detailed client configuration (RPM)

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.