tracker 安装需要
#卸载系统自带libevent,自带版本过低,安装fastdfs会出错
rpm -qa|grep libevent
# 或者
yum remove libevent*
#安装libevent
yum install libevent.i686yum install libevent-devel.i686
2.安装
#step 1. download FastDFS source package and unpack it tar -zxvf FastDFS_v4.06.tar.gz #for example: tar -zxvf FastDFS_v4.06.tar.gz #step 2. enter the FastDFS dir cd FastDFS #step 3. make all ./make.sh #step 4. make install ./make.sh install
3.配置文件在
4.在192服务器上面tracker.conf的配置文件里面(只改)
base_path=/data/fastdfs/tracker
这个文件自己手动创建 mkdir -p /data/fastdfs/tracker
执行如下命令
fdfs_trackerd /etc/fdfs/tracker.conf
5.查看如下命令
6.下面是安装nginx的过程(安装nginx的运行环境) 192上面不需要源码安装
yum openssl-devel zlib-devel pcre-devel gcc
可以查看如下连接非常简单
http://wiki.nginx.org/Install
8.nginx的配置文件如下
upstream tomcat_cluster{ server 192.168.1.193:80; server 192.168.1.195:80; } server { listen 80; server_name 192.168.1.192; server_name_in_redirect off; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location /group1 { proxy_pass http://tomcat_cluster; #转向tomcat处理 } }
8.storage2的安装
上面的1.2.3步骤完全一样
只是在195的服务器上面的改动(storage.conf)
base_path=/data/fastdfs/storage
tracker_server=192.168.1.192:22122
store_path0=/data/fastdfs/storage
fdfs_storaged /etc/fdfs/storage.conf
9.在storage2上面配置nginx(采用源码安装) nginx-1.6.0.tar.gz上面从官网下载 fastdfs-nginx-module_v1.15.tar.gz 从官网下载
yum openssl-devel zlib-devel pcre-devel gcc
tar zxvf nginx-1.6.0.tar.gz tar zxvf fastdfs-nginx-module_v1.15.tar.gz cd nginx-1.6.0 tar zxvf fastdfs-nginx-module_v1.15.tar ./configure --prefix=/usr/local/nginx --add-module=/tmp/fastdfs-nginx-module/src make make install
10.在storage2 上面 cp /tmp/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
修改该文件
tracker_server=192.168.1.192:22122 store_path0=/data/fastdfs/storage url_have_group_name = true
11.修改storage2上面的nginx
vim /usr/local/nginx/conf/nginx.conf
location /group1/M00 { alias /data/fastdfs/storage; ngx_fastdfs_module; }
12.启动storage2上面的nginx
/usr/local/nginx/sbin/nginx
13.同理storage1上面
同上面8,9,10,11,12
14.查看上传到服务器上面的文件
有问题及时联系,第一时间回复