docker安装fastdfs单机版

docker search fastdfs
INDEX       NAME                                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/season/fastdfs                 FastDFS                                         39
docker.io   docker.io/luhuiguo/fastdfs               FastDFS is an open source high performance...   17                   [OK]
docker.io   docker.io/morunchang/fastdfs             A FastDFS image                                 9
docker.io   docker.io/ygqygq2/fastdfs-nginx          整合了nginx的fastdfs                                4                    [OK]
docker.io   docker.io/lionheart/fastdfs-tracker      just have a try on autobuilded -_-#             3                    [OK]
docker.io   docker.io/imlzw/fastdfs-tracker          fastdfs的tracker服务                               2                    [OK]
docker.io   docker.io/qbanxiaoli/fastdfs             FastDFS单机版                                      2                    [OK]
docker.io   docker.io/appcrash/fastdfs_nginx         fastdfs with nginx                              1
docker.io   docker.io/delron/fastdfs                                                                 1
docker.io   docker.io/evan1120/fastdfs_storage       The fastdfs storage image                       1                    [OK]
docker.io   docker.io/evan1120/fastdfs_tracker       The fastdfs tracker docker image, only con...   1                    [OK]
docker.io   docker.io/imlzw/fastdfs-storage          fastdfs的storage服务                               1                    [OK]
docker.io   docker.io/imlzw/fastdfs-storage-dht      fastdfs的storage服务,并且集成了fastdht的服务,实现文件排重        1                    [OK]
docker.io   docker.io/john123951/fastdfs_storage     fastdfs storage                                 1                    [OK]
docker.io   docker.io/lionheart/fastdfs-storage      更加规范的Dockerfile,能够自动构建了。                        1                    [OK]
docker.io   docker.io/lionheart/fastdfs_storage      the fastdfs file system‘s storage node          1
docker.io   docker.io/lionheart/fastdfs_tracker      fastdfs file system‘s tracker node              1
docker.io   docker.io/ecarpo/fastdfs-storage                                                         0
docker.io   docker.io/john123951/fastdfs_tracker     fastdfs tracker                                 0                    [OK]
docker.io   docker.io/manuku/fastdfs-fastdht         fastdfs fastdht                                 0                    [OK]
docker.io   docker.io/manuku/fastdfs-storage-dht     fastdfs storage dht                             0                    [OK]
docker.io   docker.io/manuku/fastdfs-storage-proxy   fastdfs storage proxy                           0                    [OK]
docker.io   docker.io/manuku/fastdfs-tracker         fastdfs tracker                                 0                    [OK]
docker.io   docker.io/mypjb/fastdfs                  this is a fastdfs docker project                0                    [OK]
docker.io   docker.io/tsl0922/fastdfs                FastDFS is an open source high performance...   0                    [OK]

2.下载镜像文件

docker pull morunchang/fastdfs

3.安装tracker跟踪器容器

docker run -d --name tracker --net=host morunchang/fastdfs sh tracker.sh

tracker容器使用host网络,docker容器中的几种网络模式,这里就不介绍了,后面有时间进行补充。
4.进入tracker容器

docker exec -it tracker /bin/bash

修改文件 nginx.conf

vi /etc/nginx/conf/nginx.conf
http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
    #                  ‘$status $body_bytes_sent "$http_referer" ‘
    #                  ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       8089;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

        location ~ /M00 {
                    root /data/fast_data/data;
                    ngx_fastdfs_module;...................

这里是nginx监听tracker的端口号,即tracker的访问端口号,不过,需要直接访问tracker么?
修改文件client.conf

vi /etc/fdfs/client.conf
.
.

# the base path to store log files
base_path=/data/fast_data

# tracker_server can ocur more than once, and tracker_server format is
#  "host:port", host can be hostname or ip address
tracker_server=x.x.x.x:22122
#这里的这个IP是你本地/服务器的ip,端口号tracker的端口号,你需要自己指定,但是需要跟tracker.conf文件中的端口号一致。
# specify storage ids filename, can use relative or absolute path
# same as tracker.conf
# valid only when load_fdfs_parameters_from_tracker is false
# since V4.05
storage_ids_filename = storage_ids.conf

#HTTP settings
http.tracker_server_port=8089

#use "#include" directive to include HTTP other settiongs
##include http.conf
这里的端口号是tracker的访问端口号,和上面的22122不是一个。

修改文件tracker.conf

vi /etc/fdfs/tracker.conf
......
disabled=false

# bind an address of this host
# empty for bind all addresses of this host
bind_addr=

# the tracker server port
port=22122
#这个端口号是tracker的端口号。
# connect timeout in seconds
# default value is 30s
connect_timeout=30

connection_pool_max_idle_time = 3600

# HTTP port on this tracker server
http.server_port=8089
这个是tracker的监听端口号,http访问的端口号。
# check storage HTTP server alive interval seconds
# <= 0 for never check
# default value is 30
http.check_alive_interval=30

5.退出容器

6.安装storage储存器容器
现在/home下面创建文件夹

[[email protected]0007 chencang]# mkdir -p /home/docker/fastdfs/storage/
docker run -d --name storage --net=host -e TRACKER_IP=124.225.159.153:22122 -v /home/docker/fastdfs/storage:/data/fast_data -e GROUP_NAME=group1 morunchang/fastdfs sh storage.sh
#IP建议用公网ip,私网的ip网络进入不了

注意:这里的端口号是tracker容器的ip和端口号,不是tracker的http访问的端口号。
进入容器

docker exec -it storage /bin/bash
修改文件nginx.conf
vi /etc/nginx/conf/nginx.conf
....
...

http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
    #                  ‘$status $body_bytes_sent "$http_referer" ‘
    #                  ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       8080;
        server_name  localhost;
        #这里是storage容器的监听端口号。
        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }

修改文件client.conf

vi /etc/fdfs/client.conf
#不再本容器测试就不用改

tracker容器的访问端口号
修改文件storage的storage.conf

vi /etc/fdfs/storage.conf
client_bind=true

# the storage server port
port=23000

# connect timeout in seconds
# default value is 30s
.
.
.
connection_pool_max_idle_time = 3600

# use the ip address of this storage server if domain_name is empty,
# else this domain name will ocur in the url redirected by the tracker server
http.domain_name=

# the port of the web server on this storage server#storage的访问端口号
#http.server_port=8888
http.server_port=8080
  

7.退出容器,重启tracker和storage

docker restart storage tracker
netstat -tnlp    #查看监听的端口
cd /home/docker/fastdfs/storage/data/00/00/
#进入容器上传图片
[[email protected]0007:/]# fdfs_test /etc/fdfs/client.conf upload xxxxx.jpg

原文地址:https://www.cnblogs.com/linyouyi/p/10104909.html

时间: 2024-08-28 20:19:08

docker安装fastdfs单机版的相关文章

docker安装fastdfs与java客户端测试

一.docker 安装FastDFS 1.拉取镜像 docker pull morunchang/fastdfs 2.创建并启动tracker容器 docker run -d --name=tracker -v /home/fastdfs_docker/fdfs/tracker:/data/fast_data --privileged=true --net=host morunchang/fastdfs sh tracker.sh 3.创建并启动storage容器.此处只做单机版测试 注意:由于

Linux 安装FastDFS&lt;单机版&gt;(使用Mac远程访问)

阅读本文需要先阅读安装FastDFS<准备> 一 编译环境 yum install gcc-c++ yum -y install libevent yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel 二 安装libfastcommon 新建目录 mkdir /usr/local/libfastcommon 解压 cd libfastcommon压缩包

DataError: [-] Error: 2, No such file or directory解决你用Django写项目使用Docker安装FastDFS,测试的时候遇到这个问题

DataError: [-] Error: 2, No such file or directory我已经解决了 是因为我安装storage的时候docker run -dti --network=host --name storage -e TRACKER_SERVER=127.0.0.1:22122 -v /var/fdfs/storage:/var/fdfs delron/fastdfs storage 没有改为自己本机的IP地址TRACKER_SERVER=本机的ip地址:22122 本

Docker安装FastDFS

什么是FastDFS? FastDFS 是用 c 语言编写的一款开源的分布式文件系统.FastDFS 为互联网量身定制, 充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用 FastDFS 很容易搭建一套高性能的文件服务器集群提供文件上传.下载等服务. FastDFS 架构包括 Tracker server 和 Storage server.客户端请求 Tracker server 进行文 件上传.下载,通过 Tracker server 调度最终由 Storage

docker 安装 fastdfs

fastdfs 安装 //1.拉取镜像 docker pull morunchang/fastdfs //2.启动tracker docker run -d --name tracker --net=host morunchang/fastdfs sh tracker.sh //3.启动storage (172.21.91.218 ip 自行替换为docker 所在服务器的ip )( 此镜像不支持-p 参数) docker run -d --name storage --net=host -e

Linux 安装FastDFS&lt;准备&gt;(使用Mac远程访问)

阅读本文需要一定的Linux基础 一 FastDFS简介 fastdfs是用c语言编写的一款开源分布式文件系统, fastdfs为互联网量身定制, 充分考虑了冗余备份, 负载均衡, 线性扩容等机制, 并注重高可用, 高性能等指标, 使用fastdfs很容易搭建一套高性能的文件服务器集群提供文件上传|下载等服务. 二 FastDFS架构 fastdfs架构包括tracker server和storage server, 客户端请求tracker server进行文件上传|下载, 通过tracker

Docker和FastDFS分布式文件系统

FastDFS 是国内电商网站非常出名的一套框架,在国内的电商网站使用概率是非常大的,是淘宝的前架构师用 c 语言编写的一款开源的分布式文件系统.充分考虑了冗余备份(纵向).负载均衡.线性扩容(横向)等机制,并注重高可用.高性能等指标,使用 FastDFS 很容易搭建一套高性能的文件服务器集群提供文件上传.下载等服务. 作用:分布式存储静态文件:提供文件上传和下载功能. FastDFS 架构包括 Tracker server 和 Storage server.客户端请求 Tracker serv

ubuntu下docker安装与版本升级

ubuntu 下docker安装与版本升级 一.系统环境 系统:ubuntu-server 14.04 x86_64 内核:3.13.0-32-generic 二.Docker安装 --------------------------------------------------------------------------------- 要想安装最新版本的Docker需要使用Docker源来安装 $ sudo su - root # apt-get -y installapt-transp

CentOS Docker 安装

CentOS Docker 安装 Docker支持以下的CentOS版本: CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本 前提条件 目前,CentOS 仅发行版本中的内核支持 Docker. Docker 运行在 CentOS 7 上,要求系统为64位.系统内核版本为 3.10 以上. Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位.系统内核版本为 2.6.32-431 或者更高版本. 使用 yum 安装