Linux安装布隆过滤器过程中make编译报错“fatal error:tdigest.h:没有那个文件或目录”处理指南

安装redisbloom时通过make编译报错解决方法

1.首先将redisbloom克隆到本地电脑,代码实现如下:

git clone https://github.com/RedisLabsModules/redisbloom.git

备注:此时不报错则万事大吉,代码顺利被克隆下来;若是报错则看接下来的处理

2.若是报错如下:

fatal: unable to access 'https://github.com/RedisLabsModules/redisbloom.git/': gnutls_handshake() failed: Error in the pull function.

则可以将https改为 git解决,如下所示:

git clone https://github.com/RedisLabsModules/redisbloom.git

修改为:

git clone git://github.com/RedisLabsModules/redisbloom.git

执行成功:

hongrong@hongrong:~$ git clone git://github.com/RedisLabsModules/redisbloom.git
Cloning into 'redisbloom'...
remote: Enumerating objects: 2668, done.
remote: Counting objects: 100% (209/209), done.
remote: Compressing objects: 100% (144/144), done.
remote: Total 2668 (delta 94), reused 101 (delta 46), pack-reused 2459
Receiving objects: 100% (2668/2668), 793.04 KiB | 1.18 MiB/s, done.
Resolving deltas: 100% (1722/1722), done.

3.执行成功会生成一个redisbloom目录,切换到此目录下

hongrong@hongrong:~$ cd redisbloom/

接下来执行make,报错如下:

hongrong@hongrong:~/redisbloom$ make
cc  -Wall -Wno-unused-function -g -ggdb -O2 -fPIC -std=gnu99 -D_GNU_SOURCE -I/home/hongrong/redisbloom/contrib -I/home/hongrong/redisbloom -I/home/hongrong/redisbloom/src -I/home/hongrong/redisbloom/deps/t-digest-c/src  -c -o /home/hongrong/redisbloom/src/rebloom.o /home/hongrong/redisbloom/src/rebloom.c
make: cc: Command not found
<builtin>: recipe for target '/home/hongrong/redisbloom/src/rebloom.o' failed
make: *** [/home/hongrong/redisbloom/src/rebloom.o] Error 127

以上报错执行:sudo apt install gcc即可

sudo apt install gcc

4.redisbloom目录下继续执行make编译
报错如图:
在这里插入图片描述

在这里插入图片描述
5.根据以上报错执行git submodule sync

 git submodule sync 

接下来执行git submodule init

git submodule init

发现有报错:大概意思是说子模组未对该路径注册

hongrong@hongrong:~/redisbloom$ git submodule init
Submodule 'deps/readies' (https://github.com/RedisLabsModules/readies.git) registered for path 'deps/readies'
Submodule 'deps/t-digest-c' (https://github.com/RedisBloom/t-digest-c) registered for path 'deps/t-digest-c'

6.根据报错执行下sudo apt install update
依然还是报错:

hongrong@hongrong:~/redisbloom$ git submodule update 
Cloning into '/home/hongrong/redisbloom/deps/readies'...
fatal: unable to access 'https://github.com/RedisLabsModules/readies.git/': gnutls_handshake() failed: Error in the pull function.
fatal: clone of 'https://github.com/RedisLabsModules/readies.git' into submodule path '/home/hongrong/redisbloom/deps/readies' failed
Failed to clone 'deps/readies'. Retry scheduled
Cloning into '/home/hongrong/redisbloom/deps/t-digest-c'...
fatal: unable to access 'https://github.com/RedisBloom/t-digest-c/': gnutls_handshake() failed: Error in the pull function.
fatal: clone of 'https://github.com/RedisBloom/t-digest-c' into submodule path '/home/hongrong/redisbloom/deps/t-digest-c' failed
Failed to clone 'deps/t-digest-c'. Retry scheduled
Cloning into '/home/hongrong/redisbloom/deps/readies'...
fatal: unable to access 'https://github.com/RedisLabsModules/readies.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
fatal: clone of 'https://github.com/RedisLabsModules/readies.git' into submodule path '/home/hongrong/redisbloom/deps/readies' failed
Failed to clone 'deps/readies' a second time, aborting

在这里插入图片描述7.执行下以下命令

sudo vim .gitmodules

如图:
在这里插入图片描述将以上url 的https改为git并保存,修改完如下图:
在这里插入图片描述接着再执行git submodule sync 同步下

git submodule sync 
hongrong@hongrong:~/redisbloom$ git submodule sync 
Synchronizing submodule url for 'deps/readies'
Synchronizing submodule url for 'deps/t-digest-c'

再执行git submodule init

git submodule init 

接下来执行git submodule update

git submodule update 
hongrong@hongrong:~/redisbloom$ git submodule update 
Cloning into '/home/hongrong/redisbloom/deps/readies'...
Cloning into '/home/hongrong/redisbloom/deps/t-digest-c'...
Submodule path 'deps/readies': checked out '60652c75fdf0760c1c125760a6412fba51175740'
Submodule path 'deps/t-digest-c': checked out '265c005e2f2e6b389bdecb3633672bfb2add98f1'

在这里插入图片描述8.此时再次执行make,出现以下报错
在这里插入图片描述根据以上报错执行下sudo apt-get install cmake

9.再次执行make,依然报错
在这里插入图片描述在这里插入图片描述在这里插入图片描述
根据以上报错执行下终极命令:sudo apt-get install “build-essential”

sudo apt-get install "build-essential"

在这里插入图片描述在这里插入图片描述在这里插入图片描述
10.最后再执行下make即可成功编译
成功编译的显示界面如下:
在这里插入图片描述此时在redisbloom目录下会生成一个redisbloom.so 文件,说明布隆过滤器安装成功
在这里插入图片描述

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
布隆过滤器是一种用于判断某个元素是否存在于一个集合的数据结构。在Linux Redis,可以通过安装和使用RedisBloom模块来实现布隆过滤器的功能。 要安装RedisBloom模块,可以按照以下步骤进行操作: 1. 找到RedisBloom的源码压缩包地址。 2. 在Linux系统进行下载并解压源码压缩包。 3. 进入解压后的目录,并进行编译。 4. 将编译后的redisbloom.so文件移动到Redis的安装目录下,例如/usr/local/redis。 完成安装后,可以启动Redis服务器,并使用Redis客户端进行布隆过滤器的操作。布隆过滤器的使用方式和命令可以参考RedisBloom模块的官方文档或者相关教程。 需要注意的是,布隆过滤器也可能存在被穿透的情况。这意味着布隆过滤器判断某个元素不存在时,仍然有一定的概率会误判为存在。因此,在使用布隆过滤器时需要权衡其特点和适用场景,以保证判断的准确性。 希望以上信息对你有帮助。如果你还有其他问题,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Redis 的布隆过滤器安装及其使用](https://blog.csdn.net/qq_40230026/article/details/123048191)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Linux Redis布隆过滤器](https://blog.csdn.net/u013271384/article/details/129480958)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值