Docker deploys FastDFS distributed storage

1. Preparation

docker pull qinziteng/fastdfs:5.05
Pwd="/data/software/fastdfs"
mkdir ${Pwd}/{
    
    storage,tracker} -p

2. Create a TEST container and COPY the fastdfs directory locally to facilitate subsequent maintenance and management!

docker run -id --name fastdfs qinziteng/fastdfs:5.05
docker cp fastdfs:/home/fastdfs/conf /etc/fdfs
docker rm -f fastdfs

3. Run the container.
Note: TRACKER_SERVERPlease replace the variable with the current server IP:22122! ! !

docker run -id --name fastdfs \
    -v ${Pwd}/storage:/home/fastdfs/storage \
    -v ${Pwd}/tracker:/home/fastdfs/tracker \
    -v /etc/localtime:/etc/localtime \
    -v /etc/fdfs:/home/fastdfs/conf \
    --restart=always \
     --net host \
     -e TRACKER_SERVER="16.32.15.115:22122" \
    qinziteng/fastdfs:5.05

4. Test upload files

docker exec -it fastdfs /bin/bash
echo "qinzt six six six ...." > six.txt
fdfs_upload_file /home/fastdfs/conf/client.conf six.txt
group1/M00/00/00/ECAPc2UPhBeADjk6AAAAGQ029dQ115.txt

OK, the upload was successful.

Guess you like

Origin blog.csdn.net/weixin_45310323/article/details/133223217