CentOS 7.5下搭建高可用的FastDFS分布式文件系统
FastDFS是一个开源的轻量级分布式文件系统,由跟踪服务器(tracker server)、存储服务器(storage server)和客户端(client)三个部分组成,主要解决了海量数据存储问题,特别适合以中小文件(建议范围:4KB < file_size > /etc/hosts/etc/ld.so.conf.d/local.confldconfig
cd ../
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www -s /sbin/nologin
tar -zxvf pcre-8.42.tar.gz
tar -zxvf ngx_cache_purge-2.3.tar.gz
tar -zxvf nginx-1.15.5.tar.gz
cd nginx-1.15.5
./configure --prefix=/usr/local/nginx \
--with-pcre=/opt/pcre-8.42 \
--user=www \
--group=www \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--with-ld-opt="-ljemalloc" \
--with-http_realip_module \
--add-module=/opt/fastdfs-nginx-module/src \
--add-module=/opt/ngx_cache_purge-2.3
make;make install #修改mod_fastdfs配置文件
cp /opt/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
cd /opt/fastdfs/conf/ #进入fastdfs安装包文件夹
cp anti-steal.jpg http.conf mime.types /etc/fdfs/
vi /etc/fdfs/mod_fastdfs.conf
base_path=/tmp 改为 base_path=/data/fastdfs
tracker_server=tracker:22122 改为 tracker_server=192.168.5.71:22122
store_path0=/home/yuqing/fastdfs 改为 store_path0=/data/fastdfs
url_have_group_name = false 改为 true #配置nginx
server {
listen 80;
server_name 192.168.5.72;
location /group1/M00 {
ngx_fastdfs_module;
}
} #添加nginx启动脚本
cat >> /etc/init.d/nginx
页:
[1]