centos8安装fastdfs6.06集群方式三之:storage的安装/配置/运行
一,查看本地centos的版本
- [root@localhost lib]# cat /etc/redhat-release
- CentOS Linux release 8.1.1911 (Core)
说明:架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,fastdfs的下载与安装
- 请参见 centos8安装fastdfs6.06集群方式一之:软件下载与安装
- 地址: https://www.cnblogs.com/architectforest/p/12388972.html
三,tracker的安装/配置/运行
- 请参见 centos8安装fastdfs6.06集群方式二之:tracker的安装/配置/运行
- 地址: https://www.cnblogs.com/architectforest/p/12389095.html
四,四台storage上:生成启动fastdfs默认的配置文件
- [root@localhost fastdfs-6.06]# cd /etc/fdfs/
- [root@localhost fdfs]# cp storage.conf.sample storage.conf
- [root@localhost fdfs]# cp client.conf.sample client.conf
说明:不需要生成tracker.conf,因为storage上不再运行tracker服务
五,四台storage上:安装nginx及fastdfs-nginx-module
1,解压nginx:
- [root@localhost source]# tar -zxvf nginx-1.17.8.tar.gz
3,解压fastdfs-nginx-module
- [root@localhost source]# tar -zxvf V1.22.tar.gz
4,修改config文件,把/usr/local 替换成 /usr
- [root@localhost source]# cd fastdfs-nginx-module-1.22/
- [root@localhost fastdfs-nginx-module-1.22]# cd src
- [root@localhost src]# vi config
5,nginx配置,添加fastdfs-nginx-module和http_stub_status_module 模块
- [root@localhost fdfs]# cd /usr/local/source/nginx-1.17.8/
- [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
- [root@localhost nginx-1.17.8]# make && make install
7,检查安装是否成功?
- [root@localhost nginx-1.17.8]# ls /usr/local/soft/ | grep nginx
- nginx
查看指定的编译参数是否起作用?
- [root@localhost fdfs]# /usr/local/soft/nginx/sbin/nginx -V
- nginx version: nginx/1.17.8
- built by gcc 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)
- 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服务所需的目录
- [root@localhost fdfs]# mkdir /data/fastdfs/storage
- [root@localhost fdfs]# chmod 777 /data/fastdfs/storage/
2, 配置storage服务
编辑storage的配置文件:
[root@localhost fdfs]# vi /etc/fdfs/storage.conf
各配置项包括:
- group_name = group1
- base_path = /data/fastdfs/storage
- //配置base_path为上面所创建的storage目录
- store_path0 = /data/fastdfs/storage
- //上面的store_path :存储所在的目录,可以设置多个,注意从0开始
- tracker_server = 172.17.0.2:22122
- tracker_server = 172.17.0.3:22122
- //上面是tracker_server的ip和端口
- http.server_port = 80
- //上面是指定http服务的端口
说明://后面是我加的注释,不要写到配置文件中
说明:配置的不同之处:
- 172.17.0.4 group_name = group1
- 172.17.0.5 group_name = group1
- 172.17.0.6 group_name = group2
- 172.17.0.7 group_name = group2
说明:从上面我们可以看到,storage_server在启动时要注册到tracker_server,
从而实现由tracker_server对其进行调度
3,启动storage服务
- [root@localhost fdfs]# /etc/init.d/fdfs_storaged start
- 正在启动 fdfs_storaged (via systemctl): [ 确定 ]
4,检查storage服务启动是否成功?
- [root@localhost fdfs]# ps auxfww | grep fdfs
- root 15630 0.0 0.0 12320 972 pts/0 S+ 15:46 0:00 | | \_ grep --color=auto fdfs
- root 15026 0.0 0.1 155696 6964 ? Sl 15:13 0:00 /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
- 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?
- [root@localhost fdfs]# netstat -anp | grep 23000
- tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 15573/fdfs_storaged
说明:23000 端口是在配置文件 /etc/fdfs/storage.conf中定义的,如下:
- # the storage server port
- port = 23000
七,四台存储服务器上:配置fastdfs-nginx-module
1,生成配置文件:
- [root@localhost nginx-1.17.8]# cp /usr/local/source/fastdfs-nginx-module-1.22/src/mod_fastdfs.conf /etc/fdfs/
2,编辑配置文件:
- [root@localhost nginx-1.17.8]# vi /etc/fdfs/mod_fastdfs.conf
配置以下几项
- group_name=group1
- connect_timeout=10
- tracker_server=172.17.0.2:22122
- tracker_server=172.17.0.3:22122
- url_have_group_name = true
- store_path0=/data/fastdfs/storage
- group_count = 2
- [group1]
- group_name=group1
- storage_server_port=23000
- store_path_count=1
- store_path0=/data/fastdfs/storage
- [group2]
- group_name=group2
- storage_server_port=23000
- store_path_count=1
- store_path0=/data/fastdfs/storage
说明: 最上面的group_name
当机器属于group1这组时,值为group1
当机器属于group2这组时,值为group2
说明:url_have_group_name = true
这一项不要漏掉,会导至nginx不正常工作
3,复制另两个web访问用到配置文件到fdfs配置目录下:
- [root@d5d19e99e782 /]# cp /usr/local/source/fastdfs-6.06/conf/http.conf /etc/fdfs/
- [root@d5d19e99e782 /]# cp /usr/local/source/fastdfs-6.06/conf/mime.types /etc/fdfs/
八,四台存储服务器上:配置nginx
编辑nginx的配置文件:
- [root@localhost conf]# vi /usr/local/soft/nginx/conf/nginx.conf
在server listen 80 的这个server配置下面,
增加一个location
- location ~/group([0-9]) {
- root /data/fastdfs/storage/data;
- ngx_fastdfs_module;
- }
九,四台存储服务器上:启动nginx
1,启动
- [root@localhost storage]# /usr/local/soft/nginx/sbin/nginx
2,检查nginx是否已成功启动
- [root@localhost storage]# ps auxfww | grep nginx
- root 24590 0.0 0.0 12320 980 pts/0 S+ 16:44 0:00 | | \_ grep --color=auto nginx
- root 24568 0.0 0.0 41044 428 ? Ss 16:44 0:00 \_ nginx: master process /usr/local/soft/nginx/sbin/nginx
- nobody 24569 0.0 0.1 74516 4940 ? S 16:44 0:00 \_ nginx: worker process
centos8安装fastdfs6.06集群方式三之:storage的安装/配置/运行的更多相关文章
- centos8安装fastdfs6.06集群方式二之:tracker的安装/配置/运行
一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...
- centos8安装fastdfs6.06集群方式一之:软件下载与安装
一,查看本地centos的版本 [root@localhost lib]# cat /etc/redhat-release CentOS Linux release 8.1.1911 (Core) 说 ...
- centos8安装fastdfs6.06(单机方式)
一,下载 fastdfs6.06 1,官方地址 https://github.com/happyfish100 2,说明:当前版本:共3个子模块 fastdfs v6.06 libfastcommon ...
- zookeeper安装和搭建集群方式(window)
1. 概述 ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护.名字服务.分布式同步.组服务等.ZooKeeper的目标就是封装好复杂 ...
- jenkins集群(三) -- master和slave配置git
一.Linux(master)上安装git 1.运行命令:yum -y install git 2.git的默认安装目录是: 二.给Linux下Git配置好秘钥(公钥 + 私钥) 1.添加用户和密码 ...
- Docker安装部署es集群
Docker安装部署es集群:环境准备:已安装docker的centos服务器一台1. 拉取es版本docker pull elasticsearch:5.6.82. 新建文件夹 数据挂载目录 和 配 ...
- Cloudera Manager安装之利用parcels方式安装单节点集群(包含最新稳定版本或指定版本的安装)(添加服务)(CentOS6.5)(四)
不多说,直接上干货! 福利 => 每天都推送 欢迎大家,关注微信扫码并加入我的4个微信公众号: 大数据躺过的坑 Java从入门到架构师 人工智能躺过的坑 ...
- 三种Tomcat集群方式的优缺点分析
三种Tomcat集群方式的优缺点分析 2009-09-01 10:00 kit_lo kit_lo的博客 字号:T | T 本文对三种Tomcat集群方式的优缺点进行了分析.三种集群方式分别是:使用D ...
- redis集群的三种方式
Redis三种集群方式:主从复制,哨兵模式,Cluster集群. 主从复制 基本原理 当新建立一个从服务器时,从服务器将向主服务器发送SYNC命令,接收到SYNC命令后的主服务器会进行一次BGSAVE ...
随机推荐
- Win10更新后蓝牙出现故障的解决方法
昨天Win10自动更新后,我发现我的键盘突然就不管用了,检查了一下发现原来蓝牙没有打开,同时任务栏中的蓝牙图标也不见了. 不久之前,这样的情况已经出现过了一次,那次好像更新系统后就好了,但这次是系统更 ...
- mysql数据库常见问题修改(待补充)
1.修改mysql最大连接数的方法:临时修改:1.使用命令show variables 来查看当前最大连接数 show variables like '%max_connections%'; 使用命令 ...
- 按正常步骤对github的仓库进行push自己本地的代码提示push rejected
按正常步骤对github的仓库进行push自己本地的代码提示push rejected. 大概原因是:初始化项目时,远程仓库我建了README.md文件,而本地仓库与远程仓库尚未进行文件关联,因此需要 ...
- 《Redis内存数据库》Redis数据类型和基本操作
前言 redis 有多种数据类型,兼容应用的开发. 说明 第一种数据类型:string(字符串) set key value -- 设置key和key对应的value值 get key ...
- CentOS 7使用PuppeteerSharp无头浏览器注意事项
环境: CentOS 7.6.1810 .net core 3.1 PuppeteerSharp 2.0.0 1.如网络部稳定可以提前下载需要的chromium 下载地址:https://storag ...
- Linux实战(11):Centos后期添加网卡配置
前言 最近在折腾网卡,发现在已装centos上的机器上直接加网卡,开机后在系统中是没有启动的,下面的步骤是启动的过程,大家可以参考一下. 正文 首先我们先看网卡配置目录下的文件跟网卡 查询UUID y ...
- Linux实战(5):Centos8安装python
Centos8正式版已经发布了,已经尝鲜的小伙伴们会发现与其他Linux发行版不同,CentOS 8默认不安装Python.接下来的操作指导大家如何安装python3. 转自链接 安装python3 ...
- Linux常用命令详解(3)
pidofpstopipuptimewgetcurltrddtargrepfind 命令详解 1.pidof 获取正在运行程序的PID 实例1: [root@ken ~]# pidof sshd 24 ...
- docker之windows安装¢OS安装
按这个安装 没什么毛病 https://blog.csdn.net/vitaair/article/details/80894890 https://www.runoob.com/docker/ce ...
- 本周 GitHub 速览:您的代码有声儿吗?(Vol.38)
作者:HelloGitHub-小鱼干 摘要:还记得花式夸赞程序员的彩虹屁插件 vscode-rainbow-fart 吗?它后续有人啦!JazzIt 同它的前辈 vscode-rainbow-fart ...