k8s 部署 fastdfs遇到的故障 response status 52 不= 0 fdfs_recv_response fail, result: 52

故障

[root@fastdfs-0 /]# fdfs_test /etc/fdfs/client.conf upload a.txt
This is FastDFS client test program v6.07

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.fastken.com/ 
for more detail.

[2021-12-28 09:40:27] DEBUG - base_path=/home/yuqing/fastdfs, connect_timeout=5, 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=172.16.90.25, port=23000

group_name=group1, ip_addr=172.16.90.25, port=23000
[2021-12-28 09:40:27] ERROR - file: tracker_proto.c, line: 50, server: 172.16.90.25:23000, response status 52 != 0
[2021-12-28 09:40:27] ERROR - file: ../client/storage_client.c, line: 990, fdfs_recv_response fail, result: 52
storage_upload_by_filename
upload file fail, error no: 52, error info: Invalid exchange

原因:fastdfs通过statefulset部署,采用service对业务组件暴露服务,/etc/fdfs/对应conf配置的tracker如下:

tracker_server = fastdfs:22122

fdfs_monitor得到的storage地址为宿主服务器地址,导致地址不匹配。

由于底层采用三副本glusterfs支持k8s的pvc,因此固定部署一个fastdfs实例,则实例名固定是fastdfs-0,修改所有conf对应tracker配置

tracker_server = fastdfs-0:22122

重新部署fastdfs。故障解决

[root@fastdfs-0 /]# fdfs_test /etc/fdfs/client.conf upload a.txt
This is FastDFS client test program v6.07

Copyright (C) 2008, Happy Fish / YuQing

FastDFS may be copied only under the terms of the GNU General
Public License V3, which may be found in the FastDFS source kit.
Please visit the FastDFS Home Page http://www.fastken.com/ 
for more detail.

[2021-12-28 09:50:42] DEBUG - base_path=/home/yuqing/fastdfs, connect_timeout=5, 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=172.20.64.129, port=23000

group_name=group1, ip_addr=172.20.64.129, port=23000
storage_upload_by_filename
group_name=group1, remote_filename=M01/00/00/rBRAgWHKbXKANiA0AAAAAt3qoQc999.txt
source ip address: 172.20.64.129
file timestamp=2021-12-28 09:50:42
file size=2
file crc32=3723141383
example file url: http://172.20.64.129/group1/M01/00/00/rBRAgWHKbXKANiA0AAAAAt3qoQc999.txt
storage_upload_slave_by_filename
group_name=group1, remote_filename=M01/00/00/rBRAgWHKbXKANiA0AAAAAt3qoQc999_big.txt
source ip address: 172.20.64.129
file timestamp=2021-12-28 09:50:42
file size=2
file crc32=3723141383
example file url: http://172.20.64.129/group1/M01/00/00/rBRAgWHKbXKANiA0AAAAAt3qoQc999_big.txt

上一篇:【SpringBoot2 从0开始】底层注解 - @Configuration


下一篇:安装FastDFS图片服务器