Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build fastdfs distributed Cluster under docker

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to build a fastdfs distributed cluster under docker". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to build a fastdfs distributed cluster under docker".

In this paper, under centos6.8, through an example to demonstrate the use of fastdfs_in_docker project, using docker to build a fastdfs cluster environment. The deployment structure is:

1. Preconditions

1) all machines can be connected to the external network

2) docker is installed. For more information, please see

3) git is installed

4) the firewall is open to the ports to be used below (the ports can be opened before the fastdfs cluster starts)

2. Build steps

2.1 execute on all machines:

Git clone https://git.oschina.net/zjg23/fastdfs_in_docker.git;# downloads the project mkdir-p / home/fastdfs/ {tracker,storage} from the git server; # these two paths are used to mount to the docker container, especially the / home/fastdfs/storage path to ensure that there is enough storage space cd fastdfs_in_docker;docker build-t zjg23/fastdfs:2.0.; # build the image

The following figure shows that the image was built successfully.

2.2 execute on the build tracker,192.168.5.128:

Docker run-d-- name fdfs_tracker-v / home/fastdfs/tracker:/export/fastdfs/tracker-- net=host-e TRACKER_BASE_PATH=/export/fastdfs/tracker-e TRACKER_PORT=22123 zjg23/fastdfs:2.0 sh / usr/local/src/tracker.sh

2.3 build storage

2.3.1 execute on 192.168.5.129: docker run-d-- name fdfs_storage-v / home/fastdfs/storage:/export/fastdfs/storage-- net=host-e STORAGE_PORT=23001-e STORAGE_BASE_PATH=/export/fastdfs/storage-e STORAGE_PATH0=/export/fastdfs/storage-e TRACKER_SERVER=192.168.5.128:22123-e GROUP_COUNT=2-e HTTP_SERVER_PORT=8080-e GROUP_NAME=group1 zjg23/fastdfs:2.0 sh / usr/local/src/storage. Execute on sh2.3.2 192.168.5.130: docker run-d-- name fdfs_storage-v / home/fastdfs/storage:/export/fastdfs/storage-- net=host-e STORAGE_PORT=23001-e STORAGE_BASE_PATH=/export/fastdfs/storage-e STORAGE_PATH0=/export/fastdfs/storage-e TRACKER_SERVER=192.168.5.128:22123-e GROUP_COUNT=2-e HTTP_SERVER_PORT=8080-e GROUP_NAME=group1 zjg23/fastdfs:2.0 sh / usr/local/src/storage. Execute on sh2.3.3 192.168.5.131: docker run-d-- name fdfs_storage-v / home/fastdfs/storage:/export/fastdfs/storage-- net=host-e STORAGE_PORT=23001-e STORAGE_BASE_PATH=/export/fastdfs/storage-e STORAGE_PATH0=/export/fastdfs/storage-e TRACKER_SERVER=192.168.5.128:22123-e GROUP_COUNT=2-e HTTP_SERVER_PORT=8080-e GROUP_NAME=group2 zjg23/fastdfs:2.0 sh / usr/local/src/storage. Execute on sh2.3.4 192.168.5.132: docker run-d-- name fdfs_storage-v / home/fastdfs/storage:/export/fastdfs/storage-- net=host-e STORAGE_PORT=23001-e STORAGE_BASE_PATH=/export/fastdfs/storage-e STORAGE_PATH0=/export/fastdfs/storage-e TRACKER_SERVER=192.168.5.128:22123-e GROUP_COUNT=2-e HTTP_SERVER_PORT=8080-e GROUP_NAME=group2 zjg23/fastdfs:2.0 sh / usr/local/src/storage.sh

Interpretation of the command:

3. Check whether the construction is successful.

The results are as follows, indicating that we have correctly completed the installation according to the expected deployment architecture.

Nginx is installed on each storage, so files can also be accessed directly through http

4. Project address

Https://git.oschina.net/zjg23/fastdfs_in_docker.git

If you cannot view the attachment of the picture in the article, you can view the document in the project directly:

Thank you for your reading. The above is the content of "how to build fastdfs distributed cluster under docker". After the study of this article, I believe you have a deeper understanding of how to build fastdfs distributed cluster under docker, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report