安裝FastDFS和Nginx踩過的坑

一、
(1)開啓Tracker和Storage後,使用netstat -unltp|grep fdfs查看Tracker和Storage的狀態,顯示Storage的狀態是SYS_WRITE,而不是LISTEN。
(2)使用/usr/bin/fdfs_monitor /etc/fdfs/storage.conf查看Storage和Tracker是否通信時,沒有看到有ACTIVE顯示。
(3)使用/usr/bin/fdfs_upload_file /etc/fdfs/client.conf 圖片進行文件上傳測試時,高能來了,報錯:

ERROR - file: tracker_proto.c, line: 48, server: 172.16.10.142:22122, response status 2 != 0
tracker_query_storage fail, error no: 2, error info: No such file or directory

查看tracker的日誌,報錯信息如下:

[2019-09-29 08:14:43] ERROR - file: connection_pool.c, line: 110, connect to 206.188.192.170:22122 fail, errno: 110, error info: Connection timed out
[2019-09-29 08:14:43] ERROR - file: tracker_mem.c, line: 4277, get sys files from other trackers fail, errno: 110

注意connect後面的那個ip地址不是我配的那個,也許是我的配置文件出了問題,於是我查看了storage.conf,果然是tracker_server的配置信息出了問題,於是配置回正確的IP,解決錯誤。

二、
編譯安裝Nginx時,make的時候報錯:

error: this statement may fall through [-Werror=implicit-fallthrough=]

按照https://blog.csdn.net/jaybill/article/details/80164370的方法,一步步解決了問題:
(1)進入Nginx目錄的objs文件夾,編輯該文件夾下的Makefile
(2)在CFLAGS後面加上:-Wno-implicit-fallthrough
(3)重新make

三、使用Nginx訪問FastDFS訪問上傳成功的文件時,報404
解決:
修改/usr/local/nginx/conf下的nginx.conf,把user nobody改成usr root
注意:是**/usr/local/nginx/conf下的nginx.conf**,而不是/usr/local/nginx+版本號/conf下的nginx.conf

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章