http://blog.csdn.net/clevercode/article/details/52244358
http://ylw6006.blog.51cto.com/470441/p-6
http://blog.csdn.net/zglwy/article/details/52783244
/etc/fdfs中找不到track.conf和storage.conf
http://ylw6006.blog.51cto.com/470441/948729
[root@db1 ~]# wget http://cloud.github.com/downloads/libevent/libevent/libevent-2.0.14
-stable.tar.gz
[root@db1 ~]# tar -zxvpf libevent-2.0.14-stable.tar.gz
[root@db1 ~]# cd libevent-2.0.14-stable
[root@db1 libevent-2.0.14-stable]# ./configure --prefix=/usr/local/libevent-2.0.14 &&
make && make install
[root@db1 ~]# wget http://fastdfs.googlecode.com/files/FastDFS_v3.02.tar.gz
[root@db1 ~]# tar -zxvf FastDFS_v3.02.tar.gz
[root@db1 ~]# cd FastDFS
[root@db1 FastDFS]# grep -A 4 '/usr/local/FastDFS' make.sh
TARGET_PREFIX=/usr/local/FastDFS
TARGET_CONF_PATH=/etc/fdfs
WITH_HTTPD=1
WITH_LINUX_SERVICE=1
[root@db1 FastDFS]# ./make.sh C_INCLUDE_PATH=/usr/local/libevent-2.0.14/include
LIBRARY_PATH=/usr/local/libevent-2.0.14/lib
[root@db1 FastDFS]# ./make.sh install
[root@db1 FastDFS]# ls /etc/fdfs/
client.conf http.conf mime.types storage.conf tracker.conf
http://blog.csdn.net/ly_feng/article/details/9040181
错误提示:
libtool: compile: unrecognized option `-DHAVE_CONFIG_H'
解决方法:
# yum -y install gcc-c++
yum -y install gcc
FastDFS安装过程中出现的问题
http://blog.csdn.net/fd315063004/article/details/7703214
问题一:无法找到libevent-1.4.so.2库
[root@localhost conf]# /usr/local/bin/fdfs_trackerd/home/yuqing/FastDFS/conf/tracker.conf
/usr/local/bin/fdfs_trackerd: error while loading shared libraries: libevent-1.4.so.2:cannot open shared object file: No such file or directory
原因是系统debug的路径中没有我们实际的动态库的路径
解决步骤:
1. 确定已经安装了libevent
2. find / -name libevent-1.4.so.2
找到库文件实际存在的路径:/usr/lib/libevent-1.4.so.2
3. 在DEBUG日志中查看系统到底是到哪里去找库文件而没有找到
LD_DEBUG=libs/usr/local/bin/fdfs_trackerd –v
查出来是 trying file=/usr/lib64/libevent-1.4.so.2
4. 做一个软链接
ln –s /usr/lib/libevent-1.4.so.2 /usr/lib64/libevent-1.4.so.2
搞定。
问题二:启动Storaged的时候不成功,日志报:No route to host
解决方法是关闭两端的防火墙。
问题三: 文件上传后存放的位置和名称:
如上传test.txt到storage上,存放在/home/yuqing/FastDFS/data/00/00/CsBAaE_tXv6txIgKAAAAEDYmZBM100_big.txt
CleverCode发现fastdfs是一个很好的开源的轻量级分布式文件系统。
本次安装资源包下载:http://download.csdn.NET/download/clevercode/9607300。
http://blog.itblood.com/nginx-emerg-getpwnam-www-failed.html
在配置nginx 时提示如下错误时:
nginx: [emerg] getpwnam(“www”) failed
解决方案一
在nginx.conf中 把user nobody的注释去掉既可
解决方案二
错误的原因是没有创建www这个用户,应该在服务器系统中添加www用户组和用户www,如下命令:
1
2
|
/usr/sbin/groupadd -f www
/usr/sbin/useradd -g www www
|
以上方法测试通过,启动后,在浏览器里输入IP,即可查看到:
Welcome to nginx!的欢迎界面
除非注明,文章为IT热血青年原创,欢迎转载!转载请注明本文地址,谢谢。
1 安装fastdfs
# cd /usr/local/src/fastdfs
# tar xzf FastDFS_v4.06.tar.gz
# cd FastDFS
# vi make.sh
去掉注释
WITH_LINUX_SERVICE=1
# ./make.sh
# ./make.sh install
2 配置tracker
2.1 创建与配置tracker数据目录
# mkdir -p /data0/fastdfs/tracker
# vi /etc/fdfs/tracker.conf
base_path=/data0/fastdfs/tracker
2.2 启动tracker
# service fdfs_trackerd start
2.3 查看启动
# netstat -anp | grep 22122
3 配置storage
3.1 创建与配置storage目录
# mkdir -p /data0/fastdfs/storage/storage0
# vi /etc/fdfs/storage.conf
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.130:22122
3.2 启动storage
# service fdfs_storaged start
3.3 查看启动
# netstat -anp | grep 23000
4 安装nginx
4.1 安装pcre-8.12.tar.gz
# cd /usr/local/src/nginx
# tar zxvf pcre-8.12.tar.gz
# cd pcre-8.12
# ./configure
# make && make install
4.2 解压fastdfs-nginx-module_v1.15.tar.gz
# cd /usr/local/src/nginx
# tar zxvf fastdfs-nginx-module_v1.15.tar.gz
4.3 安装nginx
# groupadd www #添加www组
# useradd -g www www -s /bin/false #创建nginx运行账户www并加入到www组,不允许www用户直接登录系统
创建安装目录与日志目录
a) 安装目录
# mkdir /usr/local/nginx
b) 日志目录
# mkdir /data0/logs/nginx
# chown www:www /data0/logs/nginx -R
# cd /usr/local/src/nginx
# tar zxvf nginx-1.5.0.tar.gz
# cd nginx-1.5.0
4) 配置。通常将软件安装在/usr/local/目录下。将fastdfs-nginx-module/src模块添加进来
# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=/usr/local/src/nginx/fastdfs-nginx-module/src
5)编译安装
# make && make install
6) 检查是否安装成功
# cd /usr/local/nginx/sbin
# ./nginx -t
4.4 配置mod_fastdfs.conf
# cp /usr/local/src/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
# vi /etc/fdfs/mod_fastdfs.conf
base_path=/data0/fastdfs
tracker_server=192.168.101.130:22122
group_name=group1
url_have_group_name = true
store_path0=/data0/fastdfs/storage/storage0
4.5 配置nginx.conf
# vi /usr/local/nginx/conf/nginx.conf
location /group1/M00 {
root /data0/fastdfs/storage/storage0/data;
ngx_fastdfs_module;
}
4.6 启动nginx
# service iptables stop
# cd /usr/local/nginx/sbin/
# ./nginx
5 测试
6.1 配置client.conf
# vi /etc/fdfs/client.conf
base_path=/tmp
tracker_server=192.168.101.130:22122
http.tracker_server_port=80
6.2 上传txt
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload test.txt
6.3 上传图片
# /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload clevercode.png