1024programmer News Some precautions for docker to install fastdfs mirror

Some precautions for docker to install fastdfs mirror

1. Prepare the docker environment

Second, search fastdfs mirror

3. Pull the image

docker pull delron/fastdfs

The reason for choosing the delron/fastdfs mirror is that it includes nginx and does not need to install nginx forwarding by itself. You can also choose qbanxiaoli/fastdfs, which also includes nginx

Fourth, start the tracker service

 docker run -d --network=host --name tracker -v /root/fastdfs/tracker:/var/fdfs delron/fastdfs tracker

5. Start the storage service

 docker run -d --name storage --restart=always --net host -v /root/fastdfs/storage:/var/fdfs -e TRACKER_SERVER="IP:22122" delron/fastdfs storage

Note that if it is a cloud server, you need to change the IP to the external network ip

6. Points to note

1. If it is a cloud server, you need to open ports 22122, 23000, and 8888 in the security group entry direction of the cloud server background, and open the above three ports in the cloud server firewall configuration.

2. Test whether the build is successful

 docker exec -it storage /bin/bash
 echo "Hello FastDFS">index.html
 fdfs_test /etc/fdfs/client.conf upload index.html

If the deployment is successful, the following screenshot should be returned after executing the above command

3. Access the resources just tested and uploaded

The default address is http://ip:8888/url, where ip is the external network ip, and url is the value of remote_filename spliced ​​with the group_name value returned after uploading

As shown above, the access address is http://ip:8888/group1/M00/00/00/wKgARmCu6TCAKyFbAAAADpNIeWE63_big.html

7. Modify the access port

Enter the storage container (docker exec -it storage bash), find the configuration file storage.conf in the /etc/fdfs directory, modify http.server_port=8888 to the port you want,

Enter the conf under the nginx installation directory (/usr/local/nginx), modify the 8888 port in nginx.conf to the port you want, and it must correspond to the http.server_port in the previous step

Restart nginx

Restart storage

Note: After modifying the port, if it is a cloud server, you need to go to the cloud server background security group to release the modified port in the ingress direction and release the modified port in the cloud server firewall

The above are the details of some precautions for installing fastdfs images with docker. For more information about installing fastdfs with docker, please pay attention to other related articles!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/some-precautions-for-docker-to-install-fastdfs-mirror/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索