https://files.cnblogs.com/files/xiaojf/nginx-1.12.0.tar.gz

https://files.cnblogs.com/files/xiaojf/libfastcommon-master.zip

https://files.cnblogs.com/files/xiaojf/fastdfs-nginx-module-master.zip

https://files.cnblogs.com/files/xiaojf/fastdfs-client-java-master.zip

https://files.cnblogs.com/files/xiaojf/fastdfs-5.11.zip

1.1 安装libfastcommon

由于我的centOS7是最小化安装,我里面没有安装zip解压。 
先安装 :

yum -y install unzip zip

安装成功后解压libfastcommon-master.zip

unzip libfastcommon-master.zip

进入我们刚刚解压的目录:

[root@localhost ftp]# cd libfastcommon-master
[root@localhost libfastcommon-master]# ll
total
drwxr-xr-x root root Apr : doc
-rw-r--r-- root root Apr : HISTORY
-rw-r--r-- root root Apr : INSTALL
-rw-r--r-- root root Apr : libfastcommon.spec
-rwxr-xr-x root root Apr : make.sh
drwxr-xr-x root root Apr : php-fastcommon
-rw-r--r-- root root Apr : README
drwxr-xr-x root root Jun : src

当我们./make.sh的时候会提示,gcc命令没有找到。

用yum安装gcc: 
yum命令相当好用,是RedHad和CentOS从指定服务器下载RPM包并自动安装。我个人比较喜欢。

yum -y install gcc-c++

这个时候分别执行./make.sh和./make.sh install,正常情况是可以成功的。 
libfastcommon默认会被安装到/usr/lib64/libfastcommon.so但是FastDFS的主程序却在/usr/local/lib目录下 
这个时候我们就要建立一个软链接了,实际上也相当于windows上的快捷方式。

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

1.2安装FastDFS

解压FastDFS安装包

unzip fastdfs-5.11.zip

解压后看到:

[root@localhost ftp]# ls
593d8f1eN5b3b8133.jpg libfastcommon-master
fastdfs-5.11 libfastcommon-master.zip
fastdfs-5.11.zip nginx-1.12..tar.gz
fastdfs-client-java-master.zip record.txt
fastdfs-nginx-module-master.zip zookeeper-3.4..tar.gz

进到刚解压的目录

cd fastdfs-5.11
./make.sh
./make.sh install

如果没有报错那么就成功了。安装log中会提示FastDFS安装到了/etc/fdfs目录下。

成功后查看安装目录:

[root@localhost ftp]# cd /etc/fdfs/
[root@localhost fdfs]# ll
-rw-r--r-- root root Jun : client.conf.sample
-rw-r--r-- root root Jun : storage.conf.sample
-rw-r--r-- root root Jun : tracker.conf.sample

我们需要把这三个示例文件复制一份,去掉.sample。

cp client.conf.sample client.conf
cp storage.conf.sample storage.conf
cp tracker.conf.sample tracker.conf

FastDFS安装结束。

1.3安装tracker

1.3.1创建tracker工作目录

这个目录可以自定义,用来保存tracker的data和log 
根据个人习惯,我创建了下面的目录:

[root@localhost ~]# cd /usr/
[root@localhost usr]# mkdir yong.cao
[root@localhost usr]# cd yong.cao/
[root@localhost yong.cao]# mkdir dev
[root@localhost yong.cao]# cd dev/
[root@localhost dev]# mkdir fastdfs
[root@localhost yong.cao]# cd fastdfs/
[root@localhost dev]# mkdir fastdfs_tracker
[root@localhost fastdfs]# cd fastdfs_tracker/
[root@localhost fastdfs_tracker]# pwd
/usr/yong.cao/dev/fastdfs/fastdfs_tracker #这个是我最终创建的目录
[root@localhost fastdfs_tracker]#

1.3.2配置tracker

cd /etc/fdfs
vim tracker.conf

最小化的CentOS7是没有安装vim的,可以把vim tracker.conf命令改成vi tracker.conf,也可以去下载一个vim

yum -y install vim     #简单粗暴安装方法

打开后重点关注下面4个配置: 
1.disabled=false #默认开启 
2.port=22122 #默认端口号 
3.base_path=/usr/yong.cao/dev/fastdfs/fastdfs_tracker #我刚刚创建的目录 
4.http.server_port=6666 #默认端口是8080

1.3.3启动tracker

保存配置后启动tracker,命令如下:

service fdfs_trackerd start

如果不能启动,或提示用systemctl可改用命令:

systemctl start fdfs_trackerd

成功后应该可以看到:

[root@localhost fdfs]# service fdfs_trackerd start
Starting fdfs_trackerd (via systemctl): [ OK ]

进行刚刚创建的tracker目录,发现目录中多了data和log两个目录

[root@localhost fdfs]# cd /usr/yong.cao/dev/fastdfs/fastdfs_tracker/
[root@localhost fastdfs_tracker]# ll
total
drwxr-xr-x root root Jun : data
drwxr-xr-x root root Jun : logs

最后我们需要给tracker加入开机启动

[root@localhost fastdfs_tracker]# ll /etc/rc.d/rc.local
-rw-r--r-- root root Jun : /etc/rc.d/rc.local

发现并没有执行权限,需要加一下:

chmod +x /etc/rc.d/rc.local

加完后应该是这样的:

-rwxr-xr-x  root root  Jun  : /etc/rc.d/rc.local
修改rc.local
vim /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local
service fdfs_trackerd start

查看一下tracker的端口监听情况

[root@localhost fastdfs_tracker]# netstat -unltp|grep fdfs
tcp 0.0.0.0: 0.0.0.0:* LISTEN /fdfs_trackerd

端口22122成功监听。

1.4 安装storage

storage的安装与tracker很类似。

1.4.1 为storage配置工作目录

与tracker不现的是,由于storage还需要一个目录用来存储数据,所以我另外多建了一个fasdfs_storage_data 
下面是我的目录结构:

[root@localhost fastdfs]# ls
fastdfs_storage fastdfs_storage_data fastdfs_tracker

1.4.2 修改storage配置文件

修改storage.conf

vim /etc/fdfs/storage.conf

1.disabled=false 
2.group_name=group1 #组名,根据实际情况修改 
3.port=23000 #设置storage的端口号,默认是23000,同一个组的storage端口号必须一致 
4.base_path=/usr/yong.cao/dev/fastdfs/fastdfs_storage #设置storage数据文件和日志目录 
5.store_path_count=1 #存储路径个数,需要和store_path个数匹配 
6.base_path0=/usr/yong.cao/dev/fastdfs/fastdfs_storage_data #实际文件存储路径 
7.tracker_server=192.168.128.131:22122 #我CentOS7的ip地址 
8.http.server_port=8888 #设置 http 端口号

修改保存后创建软引用

ln -s /usr/bin/fdfs_storaged /usr/local/bin

1.4.3 启动storage

service fdfs_storaged start

如果不能启动,或提示用systemctl可改用命令:

systemctl start fdfs_storaged

成功后应该可以看到:

[root@localhost fdfs]# service fdfs_stroaged start
Starting fdfs_storaged (via systemctl): [ OK ]

同样的,设置开机启动: 
修改rc.local

vim /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local
service fdfs_trackerd start
service fdfs_storaged start

查看一下服务是否启动

[root@localhost fastdfs]# netstat -unltp | grep fdfs
tcp 0.0.0.0: 0.0.0.0:* LISTEN /fdfs_trackerd
tcp 0.0.0.0: 0.0.0.0:* LISTEN /fdfs_storaged

服务已正常启动。

1.4.4 校验整合

到这里,fastdfs的东西都已安装完成,最后我们还要确定一下,storage是否注册到了tracker中去。 
查看命令:

/usr/bin/fdfs_monitor /etc/fdfs/storage.conf

成功后可以看到:

ip_addr = 192.168.128.131 (localhost.localdomain) ACTIVE

[root@localhost fastdfs]# /usr/bin/fdfs_monitor /etc/fdfs/storage.conf
[-- ::] DEBUG - base_path=/usr/yong.cao/dev/fastdfs/fastdfs_storage, connect_timeout=, network_timeout=, tracker_server_count=, anti_steal_token=, anti_steal_secret_key length=, use_connection_pool=, g_connection_pool_max_idle_time=3600s, use_storage_id=, storage server id count:
server_count=, server_index=
tracker server is 192.168.128.131:
group count:
Group :
group name = group1
disk total space = MB
disk free space = MB
trunk free space = MB
storage server count =
active server count =
storage server port =
storage HTTP port =
store path count =
subdir count per path =
current write server index =
current trunk file id =
Storage :
id = 192.168.128.131
ip_addr = 192.168.128.131 (localhost.localdomain) ACTIVE
http domain =
version = 5.11
join time = -- ::
up time = -- ::
total storage = MB
free storage = MB
upload priority =
store_path_count =
subdir_count_per_path =
storage_port =
storage_http_port =
current_write_path =
source storage id =
if_trunk_server =
connection.alloc_count =
connection.current_count =
connection.max_count =
total_upload_count =
success_upload_count =
total_append_count =
success_append_count =
total_modify_count =
success_modify_count =
total_truncate_count =
success_truncate_count =
total_set_meta_count =
success_set_meta_count =
total_delete_count =
success_delete_count =
total_download_count =
success_download_count =
total_get_meta_count =
success_get_meta_count =
total_create_link_count =
success_create_link_count =
total_delete_link_count =
success_delete_link_count =
total_upload_bytes =
success_upload_bytes =
total_append_bytes =
success_append_bytes =
total_modify_bytes =
success_modify_bytes =
stotal_download_bytes =
success_download_bytes =
total_sync_in_bytes =
success_sync_in_bytes =
total_sync_out_bytes =
success_sync_out_bytes =
total_file_open_count =
success_file_open_count =
total_file_read_count =
success_file_read_count =
total_file_write_count =
success_file_write_count =
last_heart_beat_time = -- ::
last_source_update = -- ::
last_sync_update = -- ::
last_synced_timestamp = -- ::
[root@localhost fastdfs]#

fastdfs5.11+centos7.2 按照部署(二)【转载】的更多相关文章

  1. fastdfs5.11+centos7.2 按照部署(三)【转载】

    1.测试 前面两篇博文已对FastDFS的安装和配置,做了比较详细的讲解.FastDFS的基础模块都搭好了,现在开始测试下载. 1.1 配置客户端 同样的,需要修改客户端的配置文件: vim /etc ...

  2. fastdfs5.11+centos7.2 按照部署(一)【转载】

    1.绪论 最近要用到fastDFS,所以自己研究了一下,在搭建FastDFS的过程中遇到过很多的问题,为了能帮忙到以后搭建FastDFS的同学,少走弯路,与大家分享一下.FastDFS的作者淘宝资深架 ...

  3. CentOS7.4安装部署openstack [Liberty版] (二)

    继上一篇博客CentOS7.4安装部署openstack [Liberty版] (一),本篇继续讲述后续部分的内容 一.添加块设备存储服务 1.服务简述: OpenStack块存储服务为实例提供块存储 ...

  4. Hadoop生态圈-CentOs7.5单机部署ClickHouse

    Hadoop生态圈-CentOs7.5单机部署ClickHouse 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 到了新的公司,认识了新的同事,生产环境也得你去适应新的集群环境,我 ...

  5. 在CentOS7 开发与部署 asp.net core app笔记

    原文:在CentOS7 开发与部署 asp.net core app笔记 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/lihongzhai/art ...

  6. centos7 下zookeeper 部署 单机多实例模式

    centos7 下zookeeper 部署 本文参考https://www.linuxidc.com/Linux/2016-09/135052.htm 1.创建/usr/local/zookeeper ...

  7. CentOS7.4安装部署openstack [Liberty版] (一)

    一.OpenStack简介 OpenStack是一个由NASA(美国国家航空航天局)和Rackspace合作研发并发起的,以Apache许可证授权的自由软件和开放源代码项目. OpenStack是一个 ...

  8. CentOS7服务器上部署深度/机器学习环境推荐首选anaconda3

    CentOS7服务器上部署深度/机器学习环境推荐首选anaconda3,亲测~~ 因为可以创建不同的环境版本或虚拟环境 CentOS7服务器安装anaconda3后,CentOS7服务器开启后自动将a ...

  9. FasterRunner在Centos7.6服务器部署

    前言: 测试工作,就是要保障软件产品质量,如何保障软件产品质量,是一个博大精深的问题.功能测试,性能测试,接口测试,安全测试等.而在现实的项目过程中,软件版本的快速迭代,给测试的时间会越来越少.特别是 ...

随机推荐

  1. 前端基础----jquery

    一.jQuery是什么? <1> jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team. <2>jQuery是继 ...

  2. 03-树2. List Leaves (25) 二叉树的层序遍历

    03-树2. List Leaves (25) 题目来源:http://www.patest.cn/contests/mooc-ds/03-%E6%A0%912 Given a tree, you a ...

  3. STL源码分析-内存分配器

    http://note.youdao.com/noteshare?id=744696e5f6daf0f2f03f10e381485e67

  4. Exchange-fanout 广播模式

    一.前言 我们看到生产者将消息投递到Queue中,实际上这在RabbitMQ中这种事情永远都不会发生.实际的情况是,生产者将消息发送到Exchange(交换器,下图中的X),由Exchange将消息路 ...

  5. c#代码访问https服务器以及https的webservice

    代码访问https类似浏览器操作 1.验证证书 2.如果要求客户端证书,提供客户端证书 具体代码如下: 访问https的web public static void ProcessRequest() ...

  6. 前端PHP入门-005-爱情是常量还是变量

    常量 常--汉语字面为:长久,经久不变. 常量那就好翻译了:长久不变的值. 常量的使用范围非常广泛. 我们在以后,定义我们的工作目录.定义一些特点的帐户密码.版本号等我们都会使用到常量.所以这一块的知 ...

  7. Java运行原理研究(未完待续)

    java的介绍和定性 java的优缺点分析 jdk的组成结构 jvm的工作原理 java的跨平台原理 java的编译和运行过程

  8. 深入探索C++对象模型(七)

    站在对象模型的尖端(On the Cusp of the Object Model) Template 下面是有关template的三个主要讨论方向: template的声明,基本上来说就是当你声明一 ...

  9. 2017 ACM暑期多校联合训练 - Team 4 1007 HDU 6073 Matching In Multiplication (模拟)

    题目链接 Problem Description In the mathematical discipline of graph theory, a bipartite graph is a grap ...

  10. 59、有用过with statement吗?它的好处是什么?

    python中的with语句是用来干嘛的?有什么作用? with语句的作用是通过某种方式简化异常处理,它是所谓的上下文管理器的一种 用法举例如下: with open('output.txt', 'w ...