kunpengat
故障排除
更新时间:2020/08/31 GMT+08:00
问题一:运行tracker过程中提示错误
问题描述:运行tracker过程中查看日志提示如下错误:
vi /home/fastdfs/tracker/logs/trackerd.log
[2019-07-09 14:49:32] ERROR - file: pthread_func.c, line: 120, call pthread_attr_setstacksize to 65536 fail, errno: 22, error info: Invalid argument [2019-07-09 14:49:32] ERROR - file: tracker_service.c, line: 78, init_pthread_attr fail, program exit! [2019-07-09 14:49:32] CRIT - exit abnormally!
问题原因:线程配置的存储空间不够。
解决方法:
- 修改tracker线程的存储空间,从64KB改为128KB。
修改内容如下面加粗部分所示。
# thread stack size, should >= 64KB # default value is 64KB thread_stack_size = 128KB
- 修改完成后,重启fdfs。
回显信息如下:
[root@ecs-001 fdfs]# ps -ef | grep fdfs_ root 7489 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start root 7502 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start root 17855 23849 0 20:36 pts/0 00:00:00 grep --color=auto fdfs_
- 找到tracker的进程号为7489,停止后重新启动。
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
- 再次查看进程,tracker的进程号已经改变。
回显信息如下:
[root@ecs-001 fdfs]# ps -ef | grep fdfs_ root 7502 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start root 17938 1 0 20:37 ? 00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start root 17965 23849 0 20:38 pts/0 00:00:00 grep --color=auto fdfs_
问题二:用浏览器访问测试时失败
问题描述:通过浏览器访问生成的“a.txt”文件时,即在浏览器中输入“http://[ECS IP]:80/group1/M00/00/00/wKgBzl0khdiAWJcGAAAAGmbRVtQ604.txt”时失败。查看Nginx错误日志:
vi /usr/local/nginx/logs/error.log
内容示例如下:
[2019-07-09 16:45:06] INFO - fastdfs apache / nginx module v1.15, response_mode=proxy, base_path=/home/fastdfs, url_have_grou p_name=0, group_name=group1, storage_server_port=23000, path_count=1, store_path0=/home/fastdfs, connect_timeout=2, network_t imeout=30, tracker_server_count=1, if_alias_prefix=, local_host_ip_count=2, anti_steal_token=0, token_ttl=0s, anti_steal_secr et_key length=0, token_check_fail content_type=, token_check_fail buff length=0, load_fdfs_parameters_from_tracker=1, storage _sync_file_max_delay=86400s, use_storage_id=0, storage server id count=0, flv_support=1, flv_extension=flv [2019-07-09 16:45:23] ERROR - file: ../common/fdfs_global.c, line: 52, the format of filename "group1/M00/00/00/wKgBzl0kT-mAS _9nAAAAAAAAAAA473.txt" is invalid 2019/07/09 16:45:24 [error] 6537#0: *2 open() "/usr/local/nginx/html/favicon.ico" failed (2: No such file or directory), clie nt: xx.xx.xx.xx, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "xx.xx.xx.xx", referrer: "http://xx.xx.xx.xx //group1/M00/00/00/wKgBzl0kT-mAS_9nAAAAAAAAAAA473.txt"
问题原因:配置“mod_fastdfs.conf”时候,漏配置“url_have_group_name = true”。
解决方法:
- 修改“mod_fastdfs.conf”,将“url_have_group_name”配置为“true”。
vi /etc/fdfs/mod_fastdfs.conf
修改后的内容,如下面加粗部分所示。
# if the url / uri including the group name # set to false when uri like /M00/00/00/xxx # set to true when uri like ${group_name}/M00/00/00/xxx, such as group1/M00/xxx # default value is false url_have_group_name = true
- 修改完成后,重启nginx、fdfs_tracker,fdfs_storage。
- 查看tracker和storage的进程号。
如下面加粗部分所示。
[root@ecs-001 fdfs]# ps -ef | grep fdfs_ root 7489 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start root 7502 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start root 17855 23849 0 20:36 pts/0 00:00:00 grep --color=auto fdfs_
- 找到tracker的进程号为7489,storage的进程号为7502,停止后重新启动。
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
- 再次查看进程,tracker、storaged的进程号已经改变。
如下面加粗部分所示。
[root@ecs-001 fdfs]# ps -ef | grep fdfs_ root 7560 1 0 17:03 ? 00:00:01 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start root 18406 1 0 20:47 ? 00:00:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start root 18416 23849 0 20:47 pts/0 00:00:00 grep --color=auto fdfs_
- 查看nginx的进程号。
如下面加粗部分所示。
[root@ecs-001 fdfs]# ps -ef | grep nginx root 7736 1 0 17:07 ? 00:00:00 nginx: master process ./nginx nobody 7737 7736 0 17:07 ? 00:00:00 nginx: worker process root 18471 23849 0 20:48 pts/0 00:00:00 grep --color=auto nginx
- 停止后重新启动。
/usr/local/nginx/sbin/nginx
[root@ecs-001 fdfs]# /usr/local/nginx/sbin/nginx ngx_http_fastdfs_set pid=18549
- 再次查看进程,nginx的进程号已经改变。
[root@ecs-001 fdfs]# ps -ef | grep nginx root 18550 1 0 20:49 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx nobody 18551 18550 0 20:49 ? 00:00:00 nginx: worker process root 18561 23849 0 20:49 pts/0 00:00:00 grep --color=auto nginx
- 查看tracker和storage的进程号。
父主题: 移植FastDFS
