User-Profile-Image
hankin
  • 5
  • centos7
  • docker
  • mysql
  • PostgreSQL
  • git/gitlab
  • ELK
  • python
    • python-Tornado
    • python-django
  • redis
  • nginx
  • kvm
  • proxmox
  • mongo
  • kubernetes
  • prometheus
  • GlusterFs
  • nfs
  • freeswitch
  • httpd
  • shell脚本
  • linux
  • fastdfs
  • nextcloud
  • openssl
  • openvpn
  • rabbitmq
  • sqlite
  • svn
  • java
  • ubuntu
  • vue2
  • wordpress
  • php
  • IOT物联网
  • 项目
  • 故障处理
  • 树莓派
  • 博客存档
  • 未分类
  • 杂项
  • #1742(无标题)
  • 新视野
  • 分类
    • 项目
    • 树莓派
    • 杂项
    • 未分类
    • 新视野
    • 故障处理
    • 博客存档
    • 交换机
    • wordpress
    • vue2
    • ubuntu
    • svn
    • sqlite
    • shell脚本
    • redis
    • rabbitmq
    • python-django
    • python
    • proxmox
    • prometheus
    • PostgreSQL
    • php
    • openvpn
    • openssl
    • nginx
    • nfs
    • nextcloud
    • mysql
    • mongo
    • linux
    • kvm
    • kubernetes
    • java
    • IOT物联网
    • httpd
    • GlusterFs
    • git/gitlab
    • freeswitch
    • fastdfs
    • ELK
    • docker
    • centos7
  • 页面
    • #1742(无标题)
  • 友链
      请到[后台->主题设置->友情链接]中设置。
Help?

Please contact us on our email for need any support

Support
    首页   ›   fastdfs   ›   正文
fastdfs

docker部署单机fastdfs

2022-10-28 23:33:25
1256  0 0
安装脚本
#使用 docker部署fastdfs单机
echo "使用 docker部署fastdfs单机"
ip="192.168.1.58"

if [ -d "/usr/local/FastDfs/data" ]; then
    echo "/usr/local/FastDfs/data 目录存在,请手动删除后重试,删除命令:rm -rf /usr/local/FastDfs/data"
    exit
fi


#创建挂载目录页
mkdir -p /usr/local/FastDfs/data/tracker
mkdir -p /usr/local/FastDfs/data/storage


#下载镜像
docker pull docker.io/delron/fastdfs


#创建运行镜像
docker run -di --network=host --name tracker1 -v /usr/local/FastDfs/data/tracker:/var/fdfs  docker.io/delron/fastdfs  tracker
docker run -di --network=host --name storage1 -e TRACKER_SERVER=$ip:22122 -v /usr/local/FastDfs/data/storage:/var/fdfs -e GROUP_NAME=group1 docker.io/delron/fastdfs storage


#修改nginx配置文件
docker exec -d storage1 sed -i "s#            root   html;#            root /fastdfs/store_path/data;#g" /tmp/nginx/nginx-1.12.2/conf/nginx.conf
docker exec -d storage1 sed -i "s#            index  index.html index.htm;#            ngx_fastdfs_module;;#g" /tmp/nginx/nginx-1.12.2/conf/nginx.conf


#重启容器
#一定要先启动Tracker,在启动Storage
docker restart tracker1
sleep 20
docker restart storage1
sleep 20

#测试
docker exec -it storage1 /bin/bash -c ' echo "test ok" > a.txt'
add=`docker exec -it storage1 /bin/bash -c 'fdfs_upload_file /etc/fdfs/client.conf a.txt'`
URL="$ip:8888/$add"
UR=${URL%$'\r'}

echo 测试url: $UR
echo "正在测试,如果下一行显示 test ok  代表已成功安装"
curl $UR
其他命令
#docker stop storage1 && docker stop tracker1 && docker rm storage1 && docker rm tracker1  && rm -rf /usr/local/FastDfs/data
评论 (0)

点击这里取消回复。

欢迎您 游客  

Copyright © 2025 网站备案号 : 蜀ICP备2022017747号
smarty_hankin 主题. Designed by hankin
主页
页面
  • #1742(无标题)
博主
tang.show
tang.show 管理员
linux、centos、docker 、k8s、mysql等技术相关的总结文档
213 文章 2 评论 201804 浏览
测试
测试