xtdyzw 发表于 2015-12-22 23:13

启动fdfs报ERROR - file: storage_func.c, No such file or director y错误

前几个月在linux上安装fdfs以后,运行命令 /usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf restart后控制台没有任何反应,正常的情况是会初始化创建下面 这些目录的,但是楼主运行那个命令几百次了就是没有出现想要的结果,害的加班很晚也没搞定(当时闹心,嘤嘤嘤真的想哭),最后只能通过在虚拟化平台下克隆已经运行正常fdfs服务器,费了好大的周折。 今天又要迁移fdfs的文件系统了,又安装了一次,这次运行启动命令后依然没有任何反映,查看了/fdfs/storage/logs下的storaged.log日志文件,提示2015-12-22 22:25:46] ERROR - file: storage_func.c, line: 1326, getgrnam fail, errno: 2, error info: No such file or director
y
CRIT - exit abnormally!

ERROR - file: storage_func.c, line: 1326, getgrnam fail, errno: 2, error info: No such file or director
y
CRIT - exit abnormally!
这样的错误额, 流汗.........
提示getgrnam fail 意思是获取gr--group名字失败,在1326行,进入 fdfs安装目录/usr/local/src/FastDFS/storage下,vistorage_func.c文件,查看1326行内容,pGroup = getgrnam(g_run_by_group); 这里变量获取运行fdfs的组,意思就是运行fdfs程序是需要有fdfs组运行的,单纯的root用户运行不起来, 在运行正常的fdfs服务器上面执行命令 ps -ef |grep fdfs 后发现运行程序的属主是fastdfs用户

查看了/etc/passwd /etc/group没有关于fdfs用户组,echo fastdfs:x:500:500::/home/fastdfs:/sbin/nologin >>/etc/passwd echo fastdfs:x:500: >> /etc/group以后再运行/usr/local/bin/fdfs_storaged /etc/fdfs/storage.conf restart命令成功,
页: [1]
查看完整版本: 启动fdfs报ERROR - file: storage_func.c, No such file or director y错误