Code Monkey home page Code Monkey logo

Comments (7)

qbanxiaoli avatar qbanxiaoli commented on August 11, 2024

两台云服务器内网能互通吗?看起来22122端口连不上?

from fastdfs.

kebukeYi avatar kebukeYi commented on August 11, 2024

您好,我在一台阿里云服务器上 利用docker
执行 [docker pull qbanxiaoli/fastdfs] 拉取最新版本后
执行 [docker run -d --restart=always --net=host --name=fastdfs -e IP=公网IP -v /usr/fastdfs/data:/var/local qbanxiaoli/fastdfs]
在容器内部执行 fdfs_test /etc/fdfs/client.conf upload index.html 后出现如下错误:
bash-5.0# fdfs_test /etc/fdfs/client.conf upload index.html
This is FastDFS client test program v5.12

[2021-12-13 12:33:28] DEBUG - base_path=/var/local/fdfs/storage, connect_timeout=30, network_timeout=60, tracker_server_count=1, anti_steal_token=0, anti_steal_secret_key length=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s, use_storage_id=0, storage server id count: 0

tracker_query_storage_store_list_without_group:
server 1. group_name=, ip_addr=公网IP, port=23000
group_name=group1, ip_addr=公网IP, port=23000
[2021-12-13 12:33:28] ERROR - file: tracker_proto.c, line: 48, server: 公网IP:23000, response status 2 != 0
[2021-12-13 12:33:28] ERROR - file: ../client/storage_client.c, line: 996, fdfs_recv_response fail, result: 2

这会是什么原因? 我阿里云服务器上已经关闭了防火墙、并开启了 23000、22122、11411 三个端口,还是报这样的错误,我不知道是哪里出了问题。

上述问题是在公网IP下 不能完成测试的, 假如 我以 内网IP
执行 [docker run -d --restart=always --net=host --name=fastdfs -e IP=内网IP -v /usr/fastdfs/data:/var/local qbanxiaoli/fastdfs]
在容器内部执行 fdfs_test /etc/fdfs/client.conf upload index.html 后没有出现错误,并且也返回了访问URL,我也在阿里云服务器上 curl URL 是可以返回值的,但是这样我觉得不能算成功,我需要能外网能访问,所以也是失败。

请有空指点一二。

from fastdfs.

qbanxiaoli avatar qbanxiaoli commented on August 11, 2024

不支持公网IP,要用公网IP需要把fastdht的安装内容去掉

from fastdfs.

kebukeYi avatar kebukeYi commented on August 11, 2024

我先是把DockerFile 中有关 fdht 的所有有关的字眼 都删除了,然后更改docker-compose-linux.yml 文件中的IP ,我也设置成 内网IP了,随后执行 【docker-compose -f docker-compose-linux.yml up -d】 后 ,最后的错误是 【
libtool: compile: cc -c -I. -I../src -D_GNU_SOURCE -D_REENTRANT -O3 ../src/fileops/fileops_auto.c -o fileops_auto.o >/dev/null 2>&1
./libtool --mode=compile cc -c -I. -I../src -D_GNU_SOURCE -D_REENTRANT -O3 ../src/fileops/fop_basic.c
libtool: compile: cc -c -I. -I../src -D_GNU_SOURCE -D_REENTRANT -O3 ../src/fileops/fop_basic.c -fPIC -DPIC -o .libs/fop_basic.o
In file included from ./db_int.h:50,
from ../src/fileops/fop_basic.c:11:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
| ^~~~~~~
】不停的循环报这个警告,我真是55555555555

from fastdfs.

qbanxiaoli avatar qbanxiaoli commented on August 11, 2024

警告不影响,镜像构建可能需要几分钟

from fastdfs.

qbanxiaoli avatar qbanxiaoli commented on August 11, 2024

berkeley db也去掉

from fastdfs.

colin354 avatar colin354 commented on August 11, 2024

您好,我在两台云服务器上分别使用docker-compose启动,ip填写了两台机器的公网ip,内网ip也试过了。 在容器内部执行 fdfs_test /etc/fdfs/client.conf upload index.html 后出现如下错误:

[2021-11-30 14:11:35] ERROR - file: connection_pool.c, line: 130, connect to A服务器内网ip:22122 fail, errno: 110, error info: Operation timed out [2021-11-30 14:11:35] ERROR - file: tracker_proto.c, line: 48, server: B服务器内网ip:22122, response status 2 != 0 [2021-11-30 14:11:35] ERROR - file: ../client/tracker_client.c, line: 1085, fdfs_recv_response fail, result: 2 [2021-11-30 14:11:35] ERROR - file: tracker_proto.c, line: 48, server: A服务器内网ip:22122, response status 2 != 0 [2021-11-30 14:11:35] ERROR - file: ../client/tracker_client.c, line: 907, fdfs_recv_response fail, result: 2

docker-compose文件被我修改成如下:

version: '3' services: fastdfs: build: . image: ljb/fastdfs-cluster:v1.0 # 该容器是否需要开机启动+自动重启。若需要,则取消注释。 restart: always container_name: fastdfs ports: - "18888:80" - "22122:22122" - "23000:23000" environment: # nginx服务端口,默认80端口,可修改 WEB_PORT: 18888 # tracker_server服务端口,默认22122端口,可修改 FDFS_PORT: 22122 # storage_server服务端口,默认23000端口,可修改 STORAGE_PORT: 23000 # fastdht服务端口,默认11411端口,可修改 FDHT_PORT: 11411 # docker所在的宿主机内网地址,默认使用eth0网卡的地址 IP: A服务器内网ip,B服务器内网ip # 防盗链配置 # 是否做token检查,缺省值为false CHECK_TOKEN: 0 # 生成token的有效时长,默认900s TOKEN_TTL: 900 # 生成token的密钥 SECRET_KEY: FastDFS1234567890 # token检查失败,返回的本地文件内容,可以通过文件挂载的方式进行修改 TOKEN_CHECK_FAIL: /etc/fdfs/anti-steal.jpg volumes: # 将本地目录映射到docker容器内的fastdfs数据存储目录,将fastdfs文件存储到主机上,以免每次重建docker容器,之前存储的文件就丢失了。 - dfs_data:/var/local # 网络模式为host,可不暴露端口,即直接使用宿主机的网络端口,只适用于linux系统

network_mode: host

volumes: dfs_data: {}

希望您可以指点一下,谢谢

您好,我也遇到了相同的问题,请问最后解决了么?

from fastdfs.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.