Centos7.2 FastDFS_V5.05 集群的安装与配置1
环境: Centos 7.2/64位 两台服务器 都为tracker 和 storage
10.100.0.1 storage tracker
10.100.0.2 storage tracker
1 和 2安装配置类似, 下面以一台为例
1, 安装依赖包,添加fastDFS运行用户
yum install -y zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip
useradd -s /sbin/nologin fastdfs
2,创建数据存储目录
mkdir -p /export/fastdfs/{storage,tracker}
[root@localhost src]# ll /export/fastdfs
total 0
drwxr-xr-x 2 root root 6 Dec 10 15:18 storage #Storage目录保存运行日志及其data数据
drwxr-xr-x 2 root root 6 Dec 10 15:17 tracker #tracker目录保存运行日志
3,安装libfastcommon
下载最新版本: libfastcommon
wget https://github.com/happyfish100/libfastcommon/archive/master.zip
unzip master.zip
cd libfastcommon-master/
./make.sh
./make.sh install
4, 安装Fastdfs
wget http://sourceforge.net/projects/fastdfs/files/FastDFS%20Server%20Source%20Code/FastDFS%20Server%20with%20PHP%20Extension%20Source%20Code%20V5.05/FastDFS_v5.05.tar.gz/download
tar zxf FastDFS_v5.05.tar.gz && cd FastDFS
./make.sh
./make.sh install
chown -R fastdfs: /export/fastdfs
5, 配置tracker 和 storage 配置文件, 对应修改(配置文件的路径:/etc/fdfs/)
vi storage.conf
group_name=group1
base_path=/export/fastdfs/storage
store_path0=/export/fastdfs/storage
tracker_server=192.168.0.205:22122
tracker_server=192.168.0.206:22122
http.server_port=80
vi tracker.conf
base_path=/export/fastdfs/trackervi client.conf
tracker_server=192.168.0.205:22122
tracker_server=192.168.0.206:22122
6.安装fastdfs-nginx-module模块
cd /usr/local
wget http://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz/download
tar zxf fastdfs-nginx-module_v1.16.tar.gz
cd fastdfs-nginx-module/srcvi conf #更改如下, 去掉local,并指定lib64(64系统)
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/"
CORE_LIBS="$CORE_LIBS -L/usr/lib64 -lfastcommon -lfdfsclient"
vi mod_fastdfs.conf
group_name=group1
base_path=/export/fastdfs/storage
store_path0=/export/fastdfs/storage
tracker_server=192.168.0.205:22122
tracker_server=192.168.0.206:22122
url_have_group_name = true #是true 不是ture
并且该文件修改完成以后复制到/etc/fdfs/目录
7.安装Nginx
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar zxf nginx-1.8.0.tar.gz
useradd -s /sbin/nologin wwwcd nginx-1.8.0
/configure --user=www --group=www --add-module=/usr/local/fastdfs-nginx-module/src/ --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module
make
make install
8.配置Nginx
server {
listen 80;
server_name 192.168.0.205;
root /webdata/fastdfs.com;
index index.html index.htm;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html last;
}
location /group1/M00 {
root /export/fastdfs/storage/data/;
ngx_fastdfs_module;
}
}
access_log off;
}
9.开机启动脚本制作
cd /etc/rc.d/init.d
vim fdfs_trackerd(把/usr/local/bin 改成/usr/bin)
vim fdfs_storaged(把/usr/local/bin 改成/usr/bin)
并且
chmod 755 fdfs_trackerd
chmod 755 fdfs_storaged
chkconfig --add fdfs_trackerd(加入开机列表)
chkconfig fdfs_trackerd on (系统启动自动加载)
chkconfig --add fdfs_storaged
chkconfig fdfs_storaged on
10.Nginx启动脚本
cd /etc/rc.d/init.d
vim nginx
#!/bin/bash
# chkconfig: - 30 21
# description: http service.
# Source Function Library
. /etc/init.d/functions
# Nginx Settings
NGINX_SBIN="/usr/local/nginx/sbin/nginx"
NGINX_CONF="/usr/local/nginx/conf/nginx.conf"
NGINX_PID="/usr/local/nginx/logs/nginx.pid"
RETVAL=0
prog="Nginx"
start() {
echo -n $"Starting $prog: "
mkdir -p /dev/shm/nginx_temp
daemon $NGINX_SBIN -c $NGINX_CONF
RETVAL=$?
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -p $NGINX_PID $NGINX_SBIN -TERM
rm -rf /dev/shm/nginx_temp
RETVAL=$?
echo
return $RETVAL
}
reload(){
echo -n $"Reloading $prog: "
killproc -p $NGINX_PID $NGINX_SBIN -HUP
RETVAL=$?
echo
return $RETVAL
}
restart(){
stop
start
}
configtest(){
$NGINX_SBIN -c $NGINX_CONF -t
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
configtest)
configtest
;;
*)
echo $"Usage: $0 {start|stop|reload|restart|configtest}"
RETVAL=1
esac
exit $RETVAL
chmod 755 /etc/init.d/nginx
chkconfig --add nginx //加入开机启动列表
chkconfig nginx on //启动开机启动
10.测试fastdfs是否成功方法:
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /tmp/busu.txt
浏览器访问方法:http://172.18.112.102/group1/M00/00/00/rBJwZlfiGP2AfgLaAABocDvysUM611_big.png
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
ln -s /export/fastdfs/storage/data /export/fastdfs/storage/data/M00 (配置文件中stoage存放数据的路径)
11.备注:
进入facdstdfs5.0.5的安装文件夹的conf目录下,将目录下面的http.conf和mime.types拷贝到/etc/fdfs/下,如果不执行这一步,后边在启动nginx时会报错。
Centos7.2 FastDFS_V5.05 集群的安装与配置1的更多相关文章
- ZooKeeper 集群的安装、配置---Dubbo 注册中心
ZooKeeper 集群的安装.配置.高可用测试 Dubbo 注册中心集群 Zookeeper-3.4.6 Dubbo 建议使用 Zookeeper 作为服务的注册中心. Zookeeper 集群中只 ...
- Dubbo入门到精通学习笔记(十四):ActiveMQ集群的安装、配置、高可用测试,ActiveMQ高可用+负载均衡集群的安装、配置、高可用测试
文章目录 ActiveMQ 高可用集群安装.配置.高可用测试( ZooKeeper + LevelDB) ActiveMQ高可用+负载均衡集群的安装.配置.高可用测试 准备 正式开始 ActiveMQ ...
- Dubbo入门到精通学习笔记(十三):ZooKeeper集群的安装、配置、高可用测试、升级、迁移
文章目录 ZooKeeper集群的安装.配置.高可用测试 ZooKeeper 与 Dubbo 服务集群架构图 1. 修改操作系统的/etc/hosts 文件,添加 IP 与主机名映射: 2. 下载或上 ...
- ceph集群的安装和配置教程
本篇主题: 1.怎样配置ssh免登陆访问 2.为什么搭建集群要关闭防火墙和selinux,如何关闭 3.从哪里获取ceph的安装包,怎样安装才是快速正确的 4.为什么要配置时间同步服务,怎样配置 5. ...
- PXC(Percona XtraDB Cluster)集群的安装与配置
Percona XtraDB Cluster是针对MySQL用户的高可用性和扩展性解决方案,基于Percona Server .其包括了Write Set REPlication补丁,使用Galera ...
- Hadoop-2.6.0 集群的 安装与配置
1. 配置节点bonnie1 hadoop环境 (1) 下载hadoop- 2.6.0 并解压缩 [root@bonnie1 ~]# wget http://apache.fayea.com/had ...
- 【Spark】---- 在Linux集群上安装和配置Spark
1 安装JDK 1) 进入JDK官网 2) 下载JDK安装包 3)配置环境变量,在/etc/profile增加以下代码 JAVA_HOME=/home/hadoop/jdk1.6.0_38 PAT ...
- 分布式架构高可用架构篇_01_zookeeper集群的安装、配置、高可用测试
参考: 龙果学院http://www.roncoo.com/share.html?hamc=hLPG8QsaaWVOl2Z76wpJHp3JBbZZF%2Bywm5vEfPp9LbLkAjAnB%2B ...
- Hadoop集群的安装与配置(centos 6.5)
一.Hadoop搭建准备(centOs6.5 且每个系统都要有同一个用户,如:hadoop) 1.IP的配置 包括Master和Slaves的IP配置,之间能够相互ping通: 例如: ...
随机推荐
- lua相关库安装常见问题
一.先安装lua brew install lua 我本机的安装路径为:/usr/local/Cellar/lua/5.3.4_2 二.安装luarocks 下载luarocks的安装包: http: ...
- Web应用扩展系列(1):架构篇(转)
原文:Web应用扩展系列(1):架构篇 在这篇文章中,我将尽量涵盖Web应用扩展或性能调优时可能会遇到的一些架构问题. 首先,让我们来统一一些名词或项目的概念,下文中我将列举在扩展Web应用时可能会遇 ...
- 爬虫之FileCookieJar
简介 虽然CookieJar模块能够做到给请求设置cookie,但是它的cookie是保存在内存里的,每次用都需要重新设置, 这就衍生了一个它的子类---FileCookieJar,它可以将cooki ...
- Install Haskell on Ubuntu and CentOS
For Ubuntu: Step one: Install GHC If you don't want to install curl you can skip step 1 and just dir ...
- OCR技术浅探: 光学识别(3)
经过前面的文字定位和文本切割,我们已经能够找出图像中单个文字的区域,接下来可以建立相应的模型对单字进行识别. 模型选择 在模型方面,我们选择了深度学习中的卷积神经网络模型,通过多层卷积神经网络,构建了 ...
- Spark机器学习系列之13: 支持向量机SVM
Spark 优缺点分析 以下翻译自Scikit. The advantages of support vector machines are: (1)Effective in high dimensi ...
- HDFS集中式的缓存管理原理与代码剖析
转载自:http://www.infoq.com/cn/articles/hdfs-centralized-cache/ HDFS集中式的缓存管理原理与代码剖析 Hadoop 2.3.0已经发布了,其 ...
- JVM之参数分配详解
开篇之前,推荐一个关于JVM很不错的博客:http://www.cnblogs.com/redcreen/archive/2011/05/04/2036387.html 一.堆参数设置 -XX:+Pr ...
- Python误区之strip,lstrip,rstrip
最近在处理数据的时候,想把一个字符串开头的“)”符号去掉,所以使用targetStr.lstrip(")"),发现在 将处理完的数据插入到数据库时会出现编码报错,于是在网上搜到了这 ...
- java反射之获取类的基本信息(一)
一.反射原理. Java 反射机制.通俗来讲呢,就是在运行状态中,我们可以根据“类的部分已经的信息”来还原“类的全部的信息”.这里“类的部分已经的信息”,可以是“类名”或“类的对象”等信息.“类的全部 ...