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

2.下载镜像文件

docker pull morunchang/fastdfs

3.安装tracker跟踪器容器

docker run -d --name tracker --restart=always --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 ;
keepalive_timeout ; #gzip on; server {
listen ;
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:
#这里的这个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.
storage_ids_filename = storage_ids.conf #HTTP settings
http.tracker_server_port= #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=
#这个端口号是tracker的端口号。
# connect timeout in seconds
# default value is 30s
connect_timeout= connection_pool_max_idle_time = # HTTP port on this tracker server
http.server_port=
这个是tracker的监听端口号,http访问的端口号。好像该不该都无所谓
# check storage HTTP server alive interval seconds
# <= for never check
# default value is
http.check_alive_interval=

5.退出容器

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

[root@ ~]# mkdir -p /home/docker/fastdfs/storage/
docker run -d --name storage --net=host --restart=always -e TRACKER_IP=189.215.159.153: -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 ;
keepalive_timeout ; #gzip on; server {
listen ;
      #######支持https###########
      #listen ssl;
      #server_name xx.xxxxx.com;
      #ssl on;
      #ssl_certificate /etc/nginx/cert/.pem;  #必须得先把这两个证书准备好
      #ssl_certificate_key /etc/nginx/cert/.key;
      #ssl_session_timeout 5m;
      #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
      #ssl_protocols TLSv1 TLSv1. TLSv1.;
      #ssl_prefer_server_ciphers on;
      #######支持https########### #这里是storage容器的监听端口号。
#charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
}

为了支持https需要在容器里面做一下操作

apt-get update
git clone https://github.com/happyfish100/libfastcommon.git
git clone https://github.com/happyfish100/fastdfs-nginx-module.git
cd libfastcommon/
./make.sh
./make.sh install
apt-get install wget
wget http://nginx.org/download/nginx-1.13.12.tar.gz
tar -xvf nginx-1.13..tar.gz
mv nginx-1.13. nginx
cd nginx
apt-get install openssl libssl-dev
./configure --prefix=/etc/nginx --add-module=/data/fastdfs-nginx-module/src --with-http_stub_status_module --with-http_ssl_module
make
make install
/etc/nginx/sbin/nginx -v
/etc/nginx/sbin/nginx -s reload

查看是否已经监听443端口

root@:/# ss -tnpl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN *: *:*
LISTEN *: *:* users:(("nginx",pid=,fd=))
LISTEN *: *:*
LISTEN *: *:* users:(("fdfs_storaged",pid=,fd=))
LISTEN 127.0.0.1: *:*
LISTEN *: *:* users:(("nginx",pid=,fd=))
LISTEN 127.0.0.1: *:*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
root@:/#

以上443端口已经监听,已经支持https形式

修改文件client.conf

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

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

vi /etc/fdfs/storage.conf
client_bind=true # the storage server port
port= # connect timeout in seconds
# default value is 30s
.
.
.
connection_pool_max_idle_time = # 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=
http.server_port=

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

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

8.报错调整ERROR - file: tracker_proto.c, line: 48, server: 10.171.22.124:22122, response status 2 != 0

排查思路:

在tracker上使用fdfs_monitor /etc/fdfs/client.conf 命令查看storage的状态是offline

fdfs_monitor /etc/fdfs/client.conf delete group1 storage的IP地址。    #先在tracker上删除storage的信息。

rm -rf /data/fastdfs/data        #删除storage的数据目录。

service fdfs_storaged restart    #重启storage

在tracker上再次使用fdfs_monitor查看storage的状态,显示active。上传图片,正常了。

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

  1. docker安装fastdfs与java客户端测试

    一.docker 安装FastDFS 1.拉取镜像 docker pull morunchang/fastdfs 2.创建并启动tracker容器 docker run -d --name=track ...

  2. docker安装fastdfs碰到storage的IP地址映射宿主地址问题

    一.概述 最近公司准备全面实施docker部署,解决每次项目实施安装部署环境工作量大问题,mysql5.7.oracle12c很顺利,在安装fastdfs时碰到storage的IP地址映射问题.服务器 ...

  3. Linux 安装FastDFS<单机版>(使用Mac远程访问)

    阅读本文需要先阅读安装FastDFS<准备> 一 编译环境 yum install gcc-c++ yum -y install libevent yum install -y pcre ...

  4. CentOS7 安装FastDFS单机版

    1. 下载 FastDFS https://github.com/happyfish100/fastdfs/releases libfastcommon https://github.com/happ ...

  5. docker 安装 fastdfs

    fastdfs 安装 //1.拉取镜像 docker pull morunchang/fastdfs //2.启动tracker docker run -d --name tracker --net= ...

  6. 使用Docker安装FastDFS(分布式文件系统)

    1. 获取镜像 可以利用已有的FastDFS Docker镜像来运行FastDFS. 获取镜像可以通过下载 docker image pull delron/fastdfs 也可是直接使用提前下载的镜 ...

  7. Docker安装FastDFS

    什么是FastDFS? FastDFS 是用 c 语言编写的一款开源的分布式文件系统.FastDFS 为互联网量身定制, 充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用 ...

  8. Docker与FastDFS的安装命令及使用

    Docker特点 1)上手快 用户只需要几分钟,就可以把自己的程序“Docker 化”.Docker 依赖于“写时复制” (copy-on-write)模型,使修改应用程序也非常迅速,可以说达到“随心 ...

  9. Linux 安装FastDFS<准备>(使用Mac远程访问)

    阅读本文需要一定的Linux基础 一 FastDFS简介 fastdfs是用c语言编写的一款开源分布式文件系统, fastdfs为互联网量身定制, 充分考虑了冗余备份, 负载均衡, 线性扩容等机制, ...

随机推荐

  1. git合并分支上指定的commit

    merge 能够胜任平常大部分的合并需求.但也会遇到某些特殊的情况,例如正在开发一个新的功能,线上说有一个紧急的bug要修复.bug修好了但并不像把仍在开发的新功能代码也提交到线上去.这时候也许想要一 ...

  2. Win7/Win8安装"我们无法创建新的分区,也找不到现有的分区"的解决方法

    如果你用pe启动光盘和pe启动盘.加载iso安装时遇到"我们无法创建新的分区,也找不到现有的分区"的情况.. 把iso里的boot和bootgmr以及sources复制到c盘,pe ...

  3. Mysql的复杂语句

    简单的crud操作很容易,但是对于嵌套的查询语句,多表查询语句,以及条件查询语句,这些都很复杂,需要不断练习. limit a,b: 从a开始,长度为b. SELECT * FROM tb_quali ...

  4. node-sass 安装

    设置 export ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" export SASS_BINARY_SI ...

  5. Jwt 中 token应该存储到哪里?

    关于 token 的存储问题 JWT: csrf 攻击无法获取第三方的 cookie,而是直接使用 cookie进行查询的时候会自动携带 cookie. xss攻击通过代码注入可以获取 cookie. ...

  6. IBM flex system P260

    CMM 机箱管理模块 提供如下功能: 电力控制 风扇管理 机箱和计算节点初始化 交换机管理 诊断:机箱.IO选项和计算节点 资源发现和库存管理 资源告警和监控 机箱和计算节点的电源管理 安全策略管理 ...

  7. lombok安装方法

    一.介绍 lombok网址:https://projectlombok.org/download.html lombok能够在编译源码的时候自动生成getter和setter方法.即它最终能够达到的效 ...

  8. 主从读写分离----mysql-proxy0.8.5安装与配置

    废话不多说,直接开干: 1.安装环境: yum -y install libevent glib2 lua gcc gcc-c++ autoconf mysql-devel libtool pkgco ...

  9. 【凸包板题】Gym - 101484E E. Double Fence

    http://codeforces.com/gym/101484/problem/E 题解 凸包板题 #define _CRT_SECURE_NO_WARNINGS #include<cmath ...

  10. OC变量限定符和属性限定符

    ARC当中变量的四种生命周期限定符 __strong __weak __unsafe_unretained __autoreleaseing __strong 是默认的限定符,无需显示引入,只要有强引 ...