当前位置:网站首页 > 大数据架构 > 正文

Faiss 架构(fastdfs架构)



  • Tracker Server: 跟踪服务器,主要做调度工作,起到均衡的作用;负责管理所有的storage server和group,每个storage在启动后会连接 Tracker,告知自己所属 group 等信息,并保持周期性心跳。多个Tracker之间是对等关系,不存在单点故障。
  • Storage Server: 存储服务器,主要提供容量和备份服务;以 group 为单位,每个 group 内可以有多台 storage server,组内的storage server上的数据互为备份。
  • Client:客户端,上传下载数据的服务器
    模块之间的主要关系如下:



1, tracker

tracker server配置:

2, Storage

3,安装nginx和fastdfs-nginx-module

在10.250.112.143和10.250.112.144上

下载nginx module

安装nginx

wget

$ tar -zxvf nginx-1.12.2.tar.gz

$ cd nginx-1.12.2/

$ https://www.ctyun.cn/zhishi/configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx --modules-path=/usr/local/nginx/modules --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/logs/error.log --http-log-path=/usr/local/nginx/logs/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E' --add-module=/opt/fastdfs/fastdfs-nginx-module-1.20/src/

4,配置nginx

在10.250.112.143和10.250.112.144上

将原来内容去掉,改为下面的内容

注意:1,启动nginx, 用whereis nginx定位nginx的位置,进到sbin目录,使用 https://www.ctyun.cn/zhishi/nginx 启动。

2,将用到的端口到防火墙中打开,命令如下

vi /etc/sysconfig/iptables

添加要开放的端口,如8888,9270,22122等用到的端口

service iptables restart

注:

在nginx的构建中会遇到不少的报错,具体如下:

  • https://www.ctyun.cn/zhishi/configure: error: the Google perftools module requires the Google perftools library. You can either do not enable the module or install the library.

解决方法如下:

  • /configure: error: the HTTP rewrite module requires the PCRE library.
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: the HTTP cache module requires md5 functions from OpenSSL library. You can either disable the module by using --without-http-cache option, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-http_ssl_module --with-openssl= options.
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using –without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using –with-zlib= option.
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: the HTTP XSLT module requires the libxml2/libxslt libraries. You can either do not enable the module or install the libraries.
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: the HTTP image filter module requires the GD library. You can either do not enable the module or install the libraries.
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: perl module ExtUtils::Embed is required
    解决方法如下:

  • https://www.ctyun.cn/zhishi/configure: error: the GeoIP module requires the GeoIP library. You can either do not enable the module or install the library.
    解决方法如下:

  • 在make过程中会出现一个报错:/usr/include/fastdfs/fdfs_define.h:15:27: fatal error: common_define.h: No such file or directory
    解决方法如下:

5、配置文件访问的负载均衡和高可用

在10.250.112.145和10.250.112.146上安装nginx

wget

$ tar -zxvf nginx-1.12.2.tar.gz

$ cd nginx-1.12.2/

$ https://www.ctyun.cn/zhishi/configure

$ make

$ make install

nginx.conf配置文件如下

10.250.112.145 上keepalived配置文件如下:

新建一个check_nginx.sh文件,内容如下

到这里,所有的安装都完成了

在10.250.112.143上上传的图片就可以通过下面的路径访问了

后面一种是做过负载均衡的。

建立maven工程,引入

上传文件

下载文件

fdfs_client.conf 内容如下:

到此这篇Faiss 架构(fastdfs架构)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • plc200指令表与解释(plc1200指令大全)2026-04-08 13:54:07
  • 单链表的存储密度大于顺序表的存储密度(单向链表的存储密度)2026-04-08 13:54:07
  • 代码网站推荐大全(代码网站推荐大全软件)2026-04-08 13:54:07
  • 单片机设计原理图符号(单片机设计原理图符号大全)2026-04-08 13:54:07
  • 程序员入门代码大全(程序员简单代码大全)2026-04-08 13:54:07
  • 好玩的代码大全(好玩的代码大全关于高达)2026-04-08 13:54:07
  • 大气分层图(大气分层图手绘图)2026-04-08 13:54:07
  • kubectl 常用命令(kubectl命令大全)2026-04-08 13:54:07
  • cmake 多项目(cmake大型项目)2026-04-08 13:54:07
  • carplay怎么断开连接大众(carplay怎么无线连接 大众)2026-04-08 13:54:07
  • 全屏图片