当前位置:   article > 正文

FastDFS配置之常见错误_fastdfs部署,配置能用127.0.0.1么

fastdfs部署,配置能用127.0.0.1么

1、报错信息 :local_host_ip_count: 2, 127.0.0.1 192.168.108.118

jnydjky@jnydjky:/data/fastdfs/tracker/logs$ cat trackerd.log
[2019-12-05 10:21:34] INFO - FastDFS v5.05, base_path=/data/fastdfs/tracker, run_by_group=, run_by_user=, connect_timeout=30s, network_timeout=60s, port=22122, bind_addr=, max_connections=256, accept_threads=1, work_threads=4, store_lookup=2, store_group=, store_server=0, store_path=0, reserved_storage_space=10.00%, download_server=0, allow_ip_count=-1, sync_log_buff_interval=10s, check_active_interval=120s, thread_stack_size=64 KB, storage_ip_changed_auto_adjust=1, storage_sync_file_max_delay=86400s, storage_sync_file_max_time=300s, use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, trunk_file_size=64 MB, trunk_create_file_advance=0, trunk_create_file_time_base=02:00, trunk_create_file_interval=86400, trunk_create_file_space_threshold=20 GB, trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, trunk_compress_binlog_min_interval=0, use_storage_id=0, id_type_in_filename=ip, storage_id_count=0, rotate_error_log=0, error_log_rotate_time=00:00, rotate_error_log_size=0, log_file_keep_days=0, store_slave_file_use_link=0, use_connection_pool=0, g_connection_pool_max_idle_time=3600s
[2019-12-05 10:21:34] INFO - local_host_ip_count: 2,  127.0.0.1  192.168.108.118
[2019-12-05 10:21:47] CRIT - file: fdfs_trackerd.c, line: 496, catch signal 15, program exiting...
[2019-12-05 10:21:47] INFO - exit normally
  • 1
  • 2
  • 3
  • 4
  • 5

解决办法
将配置
vi /etc/fdfs/mod_fastdfs.conf

tracker_server=192.168.7.73:22122 # tracker服务IP和端口
url_have_group_name=true # 访问链接前缀加上组名
store_path0=/data/fastdfs/storage # 文件存储路径
  • 1
  • 2
  • 3

2、阿里云ESC实例迁移,导致服务器内网ip地址发生了改变,重启Storage时日志报错

[2017-09-14 15:04:54] ERROR - file: storage_ip_changed_dealer.c, line: 186, connect to tracker server 10.163.174.222:22122 fail, errno: 110, error info: Connection timed out
  • 1

这是由于Storage配置文件中tracker_server的ip地址还是旧地址,所以会出现连接超时的问题,将配置文件中的地址改成新的地址重启Storage

上传图片报错

root@ubuntu:/data/fastdfs/tracker# fdfs_test /etc/fdfs/client.conf upload /root/libfastcommon-1.0.7/fastdfs-5.05/conf/anti-steal.jpg ngx_fastdfs_module
root@ubuntu:/data/fastdfs/tracker# fdfs_test /etc/fdfs/client.conf upload /root/libfastcommon-1.0.7/fastdfs-5.05/conf/anti-steal.jpg 
  • 1
  • 2
[2019-12-06 00:25:10] ERROR - file: tracker_proto.c, line: 48, server: 10.10.10.128:22122, response status 2 != 0
[2019-12-06 00:25:10] ERROR - file: tracker_proto.c, line: 48, server: 10.10.10.128:22122, response status 2 != 0
tracker_query_storage fail, error no: 2, error info: No such file or directory
  • 1
  • 2
  • 3

在这里插入图片描述
去掉ngx_fastdfs_module
在这里插入图片描述
在这里插入图片描述
解决办法
storage的配置文件和tracker配置文件没问题
正确配置:store_path0=/home/fastdfs/storage
可能是tracker.conf与storage.conf中的group_name 没有对应上

group_name=group1
base_path=/data/fastdfs/tracker

http.server_port=8888
  • 1
  • 2
  • 3
  • 4

查看日志

端口22122被占用

root@ubuntu:/data/fastdfs/tracker# cat /data/fastdfs/tracker/logs/trackerd.log
[2019-12-06 00:44:30] INFO - local_host_ip_count: 2,  127.0.0.1  10.10.10.128
[2019-12-06 00:44:30] ERROR - file: sockopt.c, line: 770, bind port 22122 failed, errno: 98, error info: Address already in use.
[2019-12-06 00:44:30] CRIT - exit abnormally!

[2019-12-06 00:44:35] INFO - file: tracker_relationship.c, line: 383, selecting leader...
[2019-12-06 00:44:36] INFO - file: tracker_relationship.c, line: 401, I am the new tracker leader 10.10.10.128:22122
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

在这里插入图片描述
解决办法 :

令进行重启

fdfs_trackerd /etc/fdfs/tracker.conf restart          #重启Tracker
/data/fastdfs/tracker/logs$ cat trackerd.log         #查看日志
  • 1
  • 2

或者

ps -ef | grep tracker
#杀死对应的进程号
kill -9 xxxx
fdfs_trackerd /etc/fdfs/tracker.conf
  • 1
  • 2
  • 3
  • 4

参考链接 :

CentOS FastDFS配置之常见错误https://www.baidu.com/link?url=3Om-SYtSe1x-Ooge9MYm_BZ6GTkkYyT-ITG52EMoSvNbKnZCUDJUgIe0VT41kaLs&wd=&eqid=f5d78bd6000207ba000000045de9eec0
作者:就没一个昵称能用
链接:https://www.jianshu.com/p/078e6a88c369
FastDFS常见配置和安装错误问题 :http://www.netpc.com.cn/2411.html

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号