Centos8 Redis7

一 配置(可能用到)

  1. 将 Linux 内核超量使用内存设置设置为1,修改/etc/sysctl.conf,添加vm.overcommit_memory = 1。然后重启或使用命令 sysctl vm.overcommit_memory=1 使之生效。
  2. 关闭Linux特性Transparent Huge Pages:
    echo never > /sys/kernel/mm/transparent_hugepage/enabled

二 Redis简单安装

1.下载

wget https://download.redis.io/redis-stable.tar.gz

2.编译

tar -xzvf redis-stable.tar.gz
cd redis-stable
make

以下为拓展命令
编译支持TLS

make BUILD_TLS=yes

编译支持systemd,需要安装systemd开发环境库,Debian/Ubuntu :libsystemd-dev,CentOS :systemd-devel

make USE_SYSTEMD=yes

追加后缀

make PROG_SUFFIX="-alt"

编译32位

make 32bit

32位编译报错,安装libc6-dev-i386 或 g+±multilib,清理编译文件后

make CFLAGS="-m32 -march=native" LDFLAGS="-m32"

对编译文件清理

make distclean

空间配置器(Allocator)
Linux默认使用jemalloc,比libc malloc内存碎片化问题小。

To force compiling against libc malloc, use:

make MALLOC=libc

To compile against jemalloc on Mac OS X systems:

make MALLOC=jemalloc

3.安装
默认安装至 /usr/local/bin

make install

指定安装路径:

make PREFIX=/some/other/directory install

使用install_server.sh安装,交互式问答,通过/etc/init.d/redis_<portnumber> 启动关闭

cd utils
./install_server.sh

如果报错:
This systems seems to use systemd.
Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!
注释相关代码即可

#bail if this system is managed by systemd
#_pid_1_exe="$(readlink -f /proc/1/exe)"
#if [ "${_pid_1_exe##*/}" = systemd ]
#then
#       echo "This systems seems to use systemd."
#       echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
#       exit 1
#fi
#unset _pid_1_exe

![结果
通过上述操作,会生成一个/etc/init.d/redis_6379,可能需要对相关的配置文件和该命令进行修改。

4.布隆过滤器安装
https://blog.csdn.net/u013271384/article/details/129480958
5.Cluster集群模式
https://blog.csdn.net/u013271384/article/details/130465559

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值