File storage expansion based on group mode

# Stop the existing tracker storage service

/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf stop

/usr/bin/fdfs_storaged /etc/fdfs/storage.conf stop

# Modify the tracker.conf configuration file

vim /etc/fdfs/tracker.conf

store_path=2 ##Change the original 0 to 2

# Rules for uploading file selection paths

# 0: Polling (default)

# 2: Load balancing, choose the folder with the largest available space

# Modify the storage.conf configuration file

vim /etc/fdfs/storage.conf

store_path_count=2 #Change the original 1 to 2

store_path1=/data/fastdfs/storage2 #Add store_path1

#Modify mod_fastdfs.conf configuration file

vi /etc/fdfs/mod_fastdfs.conf

store_path_count=2 #Change the original 1 to 2

store_path1=/data/storage2 #Add store_path1

# Start the tracker storage service

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

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

# check status

/usr/bin/fdfs_monitor /etc/fdfs/client.conf

# Modify the nginx configuration file

vim /usr/local/nginx/conf/nginx.conf

Add the new store_path path in the nginx configuration file

location ~/group[0-9]/M00/ {

            ngx_fastdfs_module;

            root /opt/fastdfs/storage;

        }

        location ~/group[0-9]/M01/ {

            ngx_fastdfs_module;

            root /opt/fastdfs/storage2;

        }

# test upload

/usr/bin/fdfs_test /etc/fdfs/client.conf upload test.txt

Guess you like

Origin blog.csdn.net/love_THL/article/details/127424577