一,查看本地centos的版本

  1. [root@localhost lib]# cat /etc/redhat-release
  2. CentOS Linux release 8.1.1911 (Core)

说明:架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest

对应的源码可以访问这里获取: https://github.com/liuhongdi/

说明:作者:刘宏缔 邮箱: 371125307@qq.com

二,fastdfs的下载与安装

  1. 请参见 centos8安装fastdfs6.06集群方式一之:软件下载与安装
  2. 地址: https://www.cnblogs.com/architectforest/p/12388972.html

三,tracker的安装/配置/运行

  1. 请参见 centos8安装fastdfs6.06集群方式二之:tracker的安装/配置/运行
  2. 地址: https://www.cnblogs.com/architectforest/p/12389095.html

四,四台storage上:生成启动fastdfs默认的配置文件

  1. [root@localhost fastdfs-6.06]# cd /etc/fdfs/
  2. [root@localhost fdfs]# cp storage.conf.sample storage.conf
  3. [root@localhost fdfs]# cp client.conf.sample client.conf

说明:不需要生成tracker.conf,因为storage上不再运行tracker服务

五,四台storage上:安装nginx及fastdfs-nginx-module

1,解压nginx:

  1. [root@localhost source]# tar -zxvf nginx-1.17.8.tar.gz

3,解压fastdfs-nginx-module

  1. [root@localhost source]# tar -zxvf V1.22.tar.gz

4,修改config文件,把/usr/local 替换成 /usr

  1. [root@localhost source]# cd fastdfs-nginx-module-1.22/
  2. [root@localhost fastdfs-nginx-module-1.22]# cd src
  3. [root@localhost src]# vi config

5,nginx配置,添加fastdfs-nginx-module和http_stub_status_module 模块

  1. [root@localhost fdfs]# cd /usr/local/source/nginx-1.17.8/
  2. [root@localhost nginx-1.17.8]# ./configure --prefix=/usr/local/soft/nginx --with-http_stub_status_module --add-module=/usr/local/source/fastdfs-nginx-module-1.22/src/

6,编译安装nginx

  1. [root@localhost nginx-1.17.8]# make && make install

7,检查安装是否成功?

  1. [root@localhost nginx-1.17.8]# ls /usr/local/soft/ | grep nginx
  2. nginx

查看指定的编译参数是否起作用?

  1. [root@localhost fdfs]# /usr/local/soft/nginx/sbin/nginx -V
  2. nginx version: nginx/1.17.8
  3. built by gcc 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)
  4. configure arguments: --prefix=/usr/local/soft/nginx --with-http_stub_status_module --add-module=/usr/local/source/fastdfs-nginx-module-1.22/src/

六,四台storage上:配置并启动storage服务

1,创建storage服务所需的目录

  1. [root@localhost fdfs]# mkdir /data/fastdfs/storage
  2. [root@localhost fdfs]# chmod 777 /data/fastdfs/storage/

2,  配置storage服务

编辑storage的配置文件:

[root@localhost fdfs]# vi /etc/fdfs/storage.conf

各配置项包括:

  1. group_name = group1
  2. base_path = /data/fastdfs/storage
  3. //配置base_path为上面所创建的storage目录
  4. store_path0 = /data/fastdfs/storage
  5. //上面的store_path :存储所在的目录,可以设置多个,注意从0开始
  6. tracker_server = 172.17.0.2:22122
  7. tracker_server = 172.17.0.3:22122
  8. //上面是tracker_server的ip和端口
  9. http.server_port = 80
  10. //上面是指定http服务的端口

说明://后面是我加的注释,不要写到配置文件中

说明:配置的不同之处:

  1. 172.17.0.4 group_name = group1
  2. 172.17.0.5 group_name = group1
  3. 172.17.0.6 group_name = group2
  4. 172.17.0.7 group_name = group2

说明:从上面我们可以看到,storage_server在启动时要注册到tracker_server,

从而实现由tracker_server对其进行调度

3,启动storage服务

  1. [root@localhost fdfs]# /etc/init.d/fdfs_storaged start
  2. 正在启动 fdfs_storaged (via systemctl): [ 确定 ]

4,检查storage服务启动是否成功?

  1. [root@localhost fdfs]# ps auxfww | grep fdfs
  2. root 15630 0.0 0.0 12320 972 pts/0 S+ 15:46 0:00 | | \_ grep --color=auto fdfs
  3. root 15026 0.0 0.1 155696 6964 ? Sl 15:13 0:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
  4. root 15573 2.7 1.7 150736 66292 ? Sl 15:45 0:02 /usr/bin/fdfs_storaged /etc/fdfs/storage.conf

说明:看到fdfs_storaged,表示storage服务启动成功

5,检查storage服务是否已绑定到端口:23000?

  1. [root@localhost fdfs]# netstat -anp | grep 23000
  2. tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 15573/fdfs_storaged

说明:23000 端口是在配置文件 /etc/fdfs/storage.conf中定义的,如下:

  1. # the storage server port
  2. port = 23000

七,四台存储服务器上:配置fastdfs-nginx-module

1,生成配置文件:

  1. [root@localhost nginx-1.17.8]# cp /usr/local/source/fastdfs-nginx-module-1.22/src/mod_fastdfs.conf /etc/fdfs/

2,编辑配置文件:

  1. [root@localhost nginx-1.17.8]# vi /etc/fdfs/mod_fastdfs.conf

配置以下几项

  1. group_name=group1
  2. connect_timeout=10
  3. tracker_server=172.17.0.2:22122
  4. tracker_server=172.17.0.3:22122
  5. url_have_group_name = true
  6. store_path0=/data/fastdfs/storage
  7. group_count = 2
  8.  
  9. [group1]
  10.  
  11. group_name=group1
  12. storage_server_port=23000
  13. store_path_count=1
  14. store_path0=/data/fastdfs/storage
  15.  
  16. [group2]
  17.  
  18. group_name=group2
  19. storage_server_port=23000
  20. store_path_count=1
  21. store_path0=/data/fastdfs/storage

说明: 最上面的group_name

当机器属于group1这组时,值为group1

当机器属于group2这组时,值为group2

说明:url_have_group_name = true

这一项不要漏掉,会导至nginx不正常工作

3,复制另两个web访问用到配置文件到fdfs配置目录下:

  1. [root@d5d19e99e782 /]# cp /usr/local/source/fastdfs-6.06/conf/http.conf /etc/fdfs/
  2. [root@d5d19e99e782 /]# cp /usr/local/source/fastdfs-6.06/conf/mime.types /etc/fdfs/

八,四台存储服务器上:配置nginx

编辑nginx的配置文件:

  1. [root@localhost conf]# vi /usr/local/soft/nginx/conf/nginx.conf

在server listen 80 的这个server配置下面,

增加一个location

  1. location ~/group([0-9]) {
  2. root /data/fastdfs/storage/data;
  3. ngx_fastdfs_module;
  4.  
  5. }

九,四台存储服务器上:启动nginx

1,启动

  1. [root@localhost storage]# /usr/local/soft/nginx/sbin/nginx

2,检查nginx是否已成功启动

  1. [root@localhost storage]# ps auxfww | grep nginx
  2. root 24590 0.0 0.0 12320 980 pts/0 S+ 16:44 0:00 | | \_ grep --color=auto nginx
  3. root 24568 0.0 0.0 41044 428 ? Ss 16:44 0:00 \_ nginx: master process /usr/local/soft/nginx/sbin/nginx
  4. nobody 24569 0.0 0.1 74516 4940 ? S 16:44 0:00 \_ nginx: worker process

centos8安装fastdfs6.06集群方式三之:storage的安装/配置/运行的更多相关文章

  1. centos8安装fastdfs6.06集群方式二之:tracker的安装/配置/运行

    一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...

  2. centos8安装fastdfs6.06集群方式一之:软件下载与安装

    一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...

  3. centos8安装fastdfs6.06(单机方式)

    一,下载 fastdfs6.06 1,官方地址 https://github.com/happyfish100 2,说明:当前版本:共3个子模块 fastdfs v6.06 libfastcommon ...

  4. zookeeper安装和搭建集群方式(window)

    1.   概述 ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护.名字服务.分布式同步.组服务等.ZooKeeper的目标就是封装好复杂 ...

  5. jenkins集群(三) -- master和slave配置git

    一.Linux(master)上安装git 1.运行命令:yum -y install git 2.git的默认安装目录是:  二.给Linux下Git配置好秘钥(公钥 + 私钥) 1.添加用户和密码 ...

  6. Docker安装部署es集群

    Docker安装部署es集群:环境准备:已安装docker的centos服务器一台1. 拉取es版本docker pull elasticsearch:5.6.82. 新建文件夹 数据挂载目录 和 配 ...

  7. Cloudera Manager安装之利用parcels方式安装单节点集群(包含最新稳定版本或指定版本的安装)(添加服务)(CentOS6.5)(四)

    不多说,直接上干货! 福利 => 每天都推送 欢迎大家,关注微信扫码并加入我的4个微信公众号:   大数据躺过的坑      Java从入门到架构师      人工智能躺过的坑          ...

  8. 三种Tomcat集群方式的优缺点分析

    三种Tomcat集群方式的优缺点分析 2009-09-01 10:00 kit_lo kit_lo的博客 字号:T | T 本文对三种Tomcat集群方式的优缺点进行了分析.三种集群方式分别是:使用D ...

  9. redis集群的三种方式

    Redis三种集群方式:主从复制,哨兵模式,Cluster集群. 主从复制 基本原理 当新建立一个从服务器时,从服务器将向主服务器发送SYNC命令,接收到SYNC命令后的主服务器会进行一次BGSAVE ...

随机推荐

  1. Win10更新后蓝牙出现故障的解决方法

    昨天Win10自动更新后,我发现我的键盘突然就不管用了,检查了一下发现原来蓝牙没有打开,同时任务栏中的蓝牙图标也不见了. 不久之前,这样的情况已经出现过了一次,那次好像更新系统后就好了,但这次是系统更 ...

  2. mysql数据库常见问题修改(待补充)

    1.修改mysql最大连接数的方法:临时修改:1.使用命令show variables 来查看当前最大连接数 show variables like '%max_connections%'; 使用命令 ...

  3. 按正常步骤对github的仓库进行push自己本地的代码提示push rejected

    按正常步骤对github的仓库进行push自己本地的代码提示push rejected. 大概原因是:初始化项目时,远程仓库我建了README.md文件,而本地仓库与远程仓库尚未进行文件关联,因此需要 ...

  4. 《Redis内存数据库》Redis数据类型和基本操作

    前言 redis 有多种数据类型,兼容应用的开发. 说明 第一种数据类型:string(字符串) set key value     -- 设置key和key对应的value值 get key    ...

  5. CentOS 7使用PuppeteerSharp无头浏览器注意事项

    环境: CentOS 7.6.1810 .net core 3.1 PuppeteerSharp 2.0.0 1.如网络部稳定可以提前下载需要的chromium 下载地址:https://storag ...

  6. Linux实战(11):Centos后期添加网卡配置

    前言 最近在折腾网卡,发现在已装centos上的机器上直接加网卡,开机后在系统中是没有启动的,下面的步骤是启动的过程,大家可以参考一下. 正文 首先我们先看网卡配置目录下的文件跟网卡 查询UUID y ...

  7. Linux实战(5):Centos8安装python

    Centos8正式版已经发布了,已经尝鲜的小伙伴们会发现与其他Linux发行版不同,CentOS 8默认不安装Python.接下来的操作指导大家如何安装python3. 转自链接 安装python3 ...

  8. Linux常用命令详解(3)

    pidofpstopipuptimewgetcurltrddtargrepfind 命令详解 1.pidof 获取正在运行程序的PID 实例1: [root@ken ~]# pidof sshd 24 ...

  9. docker之windows安装&centOS安装

    按这个安装  没什么毛病 https://blog.csdn.net/vitaair/article/details/80894890 https://www.runoob.com/docker/ce ...

  10. 本周 GitHub 速览:您的代码有声儿吗?(Vol.38)

    作者:HelloGitHub-小鱼干 摘要:还记得花式夸赞程序员的彩虹屁插件 vscode-rainbow-fart 吗?它后续有人啦!JazzIt 同它的前辈 vscode-rainbow-fart ...