Skip to content

毛俊的博客

docker安装fastdfs

docker, fastdfs1 min read

搜索fastdfs镜像:

1docker search fastdfs
2NAME DESCRIPTION STARS OFFICIAL AUTOMATED
3season/fastdfs FastDFS 63
4luhuiguo/fastdfs FastDFS is an open source high performance d… 24 [OK]

选择**STARS`数最多的作为镜像并拉取:

1docker image pull season/fastdfs

在宿主机中新建目录用,于存放fastdfs配置文件和数据:

1mkdir -p ~/docker/fastdfs/etc
2mkdir -p ~/docker/fastdfs/data/storage_data
3mkdir -p ~/docker/fastdfs/data/store_path
4mkdir -p ~/docker/fastdfs/data/tracker_data

启动容器:

1docker run--name fdfs --net=host season/fastdfs

查看容器id:

1docker ps -aq --filter name=fdfs

根据查到的容器id,复制fdfs的配置到宿主机的配置文件夹: docker cp 66a27dc049f7:/fdfs_conf/. ~/docker/fastdfs/etc

修改tracker.conf:

1base_path=/fastdfs/storage

storage.conf主要修改如下:

1tracker_server=192.168.8.105:22122

修改为宿主机的ip

启动tracker:

1docker run -itd --name fdfs_tracker1 -v ~/docker/fastdfs/data/tracker_data/data:/fastdfs/tracker -v ~/docker/fastdfs/etc:/fdfs_conf --privileged=true --net=host season/fastdfs tracker

docker run -tid --name tracker -v

© 2020 by 毛俊的博客. All rights reserved.
Theme by LekoArts