Install fastdfs on Docker Mount directory -v /e/fdfs/tracker:/var/fdfs View Network docker network ls # Network list docker network create --driver bridge --subnet=192.168.127.0/24 fastdfs_fastdfs_net # Create a custom network segment not in use yet Download image docker pull season/fastdfs Create a tracker container. The default port of the Tracker server is 22122. ## The deployment process uses the bridge network docker run -ti -d --name trakcer -v /f/fastdfs/tracker_data:/fastdfs/tracker/data -p 22122:22122 season/fastdfs tracker Use Docker images to build storage containers (storage servers that provide capacity and backup services) ## 172.17.0.2 is the IP address of the containerdocker run -tid --name storage -v /f/fastdfs/storage_data:/fastdfs/storage/data -v /f/fastdfs/store_path:/fastdfs/store_path -p 8080:8080 -p 23000:23000 -p 80:80 -e TRACKER_SERVER:172.17.0.2:22122 -e GROUP_NAME=group1 season/fastdfs storage At this point both services are started ### Configure the service, enter the storage container, and configure the port for http access in the storage configuration file. The configuration file is in storage.conf in the fdfs_conf directory. docker exec -it storage bash cd fdfs_conf more storage.conf Next, exit the storage container and copy the configuration file: docker cp storage:/fdfs_conf/storage.conf ./ Copy the modified configuration file to the storagee configuration directory: docker cp ./storage.conf storage:/fdfs_conf/ Restart the storage container docker stop storage docker start storage See the association between the tracker container and the storage container docker exec -it storage bash cd fdfs_conf fdfs_monitor storage.conf Upload files to the storage container in docker simulate client ## Open a client docker cp ./storage.conf fdfs_sh:/fdfs_conf/ Change the configuration file. Since it has been changed once before, just copy it now. docker exec -it fdfs_sh bash Create a txt file docker exec -it fdfs_sh bash echo hello>a.txt Enter the fdfs_conf directory and upload the file to the storage container cd fdfs_conf fdfs_upload_file storage.conf /a.txt Windows Commands netstat -aon|findstr "22122" # Check if the port is disabled netsh firewall set opmode mode=disable # Disable the firewall netsh firewall reset https://hub.docker.com/r/qbanxiaoli/fastdfs) Install and configure image acceleration using docker-toolbox in Windows Server 2012 R2 environment docker-machine ssh default sudo sed -i "s|EXTRA_ARGS='|EXTRA_ARGS='--registry-mirror=http://hub-mirror.c.163.com |g" /var/lib/boot2docker/profile exit docke-machine restart default Docker installation prompt: Error response from daemon: client is newer than server Solution: Use the command docker version to check the client version, and then simply change the client version to be consistent with the server version (export DOCKER_API_VERSION=1.22) Copy code DockerToolbox prompts: default Boot2Docker ISO is out-of-date Solution: This problem can be solved by downloading and copying the latest version of the Download the latest version of If the above error message is still displayed, it is because the version of Mounting Folders https://www.jb51.net/article/176813.htm Fastdfs integrated SpringBoot configuration #FastDFS fdfs: so-timeout: 1501 connect-timeout: 601 thumb-image: #thumbnail generation parameters width: 200 height: 200 tracker-list: - 192.168.118.162:22122 How to directly access the docker for windows container intranet through an independent IP Implementing IP intercommunication by configuring routing tables View ## Add route route -p add 172.17.0.0 MASK 255.255.255.0 10.0.75.2 How to directly access the docker for windows container intranet through an independent IP Docker deployment FastDfs--Method 2 -v /e/fdfs/tracker:/var/fdfs clone project ## This image is an image with Nginx integrated. git clone https://[email protected]/qbanxiaoli/fastdfs.git Enter the fastdfs directory cd fastdfs Modify docker-compose.yml and change ip shellversion: '3.0' services: fastdfs: build: . image: qbanxiaoli/fastdfs # Whether the container needs to be started and automatically restarted. Uncomment if necessary. restart: always container_name: fastdfs ports: - 8080:8080 - 22122:22122 - 23000:23000 environment: # Use TZ: Asia/Shanghai # nginx service port, default port 8080, can be modified WEB_PORT: 8080 # tracker_server service port, default port 22122, can be modified FDFS_PORT: 22122 # Fastdht service port, default port 11411, can be modified FDHT_PORT: 11411 # The IP intranet address of the host machine where Docker is located. By default, the IP address of the eth0 network card is used: 192.168.118.93 volumes: # Map the local directory to the fastdfs data storage directory in the docker container, and store the fastdfs files on the host to avoid losing the previously stored files every time the docker container is rebuilt. - /e/fastdfs/fastdfs:/var/local # Since Windows and Unix cannot recognize the host network, a new network segment needs to be created to force the container IP to be consistent with the host IP networks: fastdfs_net: ipv4_address: 192.168.118.93 networks: fastdfs_net: driver: bridge driver_opts: parent: eth0 ipam: config: - subnet: 192.168.118.0/24 Execute the docker-compose command shelldocker-compose up -d Test whether fastdfs is successfully built # Enter the container docker exec -it fastdfs /bin/bash Restart tracker_server shell/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart Restart storage_server shell/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart View storage status shellfdfs_monitor /etc/fdfs/client.conf localhost:8080 access nginx Indicates that the deployment was successful! The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Simple tutorial on using Navicat For MySQL
>>: Vue routing returns the operation method of restoring page status
1. Installation of Docker under CentOS8 curl http...
Recently, I want to regularly back up important i...
This article introduces in detail some of the tech...
This article introduces how to configure Nginx to...
1. Introduction Containers use a sandbox mechanis...
Method 1: <input id= "File1" type= &q...
You can easily input Chinese and get Chinese outp...
introduction Most people who have used databases ...
MySQL Introduction to MySQL MySQL was originally ...
This article shares the encapsulation code of Jav...
After a long period of transplantation and inform...
This article example shares the specific code of ...
Table of contents 1. The role of nginx process lo...
The following CSS class names starting with a num...
Query the MySQL source first docker search mysql ...