CentOS 7安裝Redis
準備
CentOS
:7
Redis
:4.0.11
安裝
下載redis安裝包並上傳
解壓
[root@localhost redis]# tar -zxvf redis-4.0.11.tar.gz
執行編譯
[root@localhost redis]# make
可能存在異常問題
/bin/sh: cc
: 未找到命令
[root@localhost redis-4.0.11]# make
cd src && make all
make[1]: 進入目錄“/opt/apps/redis/redis-4.0.11/src”
CC adlist.o
/bin/sh: cc: 未找到命令
make[1]: *** [adlist.o] 錯誤 127
make[1]: 離開目錄“/opt/apps/redis/redis-4.0.11/src”
make: *** [all] 錯誤 2
redis依賴於gcc進行編譯,可使用yum安裝,如yum不可用,可以參考CentOS安裝配置yum進行配置
[root@localhost redis]# yum install gcc
- 致命錯誤:
jemalloc/jemalloc.h
:沒有那個檔案或目錄
[root@localhost redis-4.0.11]# make
cd src && make all
make[1]: 進入目錄“/opt/apps/redis/redis-4.0.11/src”
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: 致命錯誤:jemalloc/jemalloc.h:沒有那個檔案或目錄
#include <jemalloc/jemalloc.h>
^
編譯中斷。
make[1]: *** [adlist.o] 錯誤 1
make[1]: 離開目錄“/opt/apps/redis/redis-4.0.11/src”
make: *** [all] 錯誤 2
檢視 redis
說明檔案 README.md
,存在關於 Allocator
的說明資訊
Allocator
Selecting a non-default memory allocator when building Redis is done by setting
theMALLOC
environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.To force compiling against libc malloc, use:
% make MALLOC=libc
To compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc
關於分配器 Allocator
,如果存在 MALLOC
這個環境變數,會使用這個環境變數去構建 Redis
。但 libc
並不是預設分配器, 預設的是 jemalloc
,因此可以通過指定解決。
make MALLOC=libc
編譯測試
[root@localhost redis-4.0.11]# make test
cd src && make test
make[1]: 進入目錄“/opt/apps/redis/redis-4.0.11/src”
CC Makefile.dep
make[1]: 離開目錄“/opt/apps/redis/redis-4.0.11/src”
make[1]: 進入目錄“/opt/apps/redis/redis-4.0.11/src”
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] 錯誤 1
make[1]: 離開目錄“/opt/apps/redis/redis-4.0.11/src”
make: *** [test] 錯誤 2
redis
編譯測試依賴於 tcl
,可以 yum
安裝
[root@localhost redis-4.0.11]# yum install tcl
編譯並安裝
[root@localhost redis-4.0.11]# make install
其它
- 訪問來源限制
預設為bind 127.0.0.1,限制本機訪問,可設定不限制訪問來源IP(註釋效果一樣)或指定訪問IP
bind 0.0.0.0
相關文章
- CentOS 7 安裝redisCentOSRedis
- CentOS7安裝RedisCentOSRedis
- CentOS 7 yum 安裝與配置 RedisCentOSRedis
- Linux-Redis安裝(CentOS7)LinuxRedisCentOS
- centos7 安裝 redis-5.0.3CentOSRedis
- centos7 下安裝redis-4.0.2CentOSRedis
- Centos7怎麼安裝Redis5.0CentOSRedis
- 在Centos7上安裝Redis6CentOSRedis
- Centos 安裝RedisCentOSRedis
- CentOS redis安裝配置CentOSRedis
- Centos7-VMware+Centos7安裝配置CentOS
- 【CentOS】CentOS7安裝PostgreSQLCentOSSQL
- centos7安裝單機環境redis3.2CentOSRedisS3
- Centos7編譯安裝Redis 6.2.3 詳細教程CentOS編譯Redis
- CentOS 7 安裝 lnmpCentOSLNMP
- Centos 7安裝FTPCentOSFTP
- Centos 7 安裝JDKCentOSJDK
- Centos 7 安裝NginxCentOSNginx
- CentOS 7 - 安裝NginxCentOSNginx
- CentOS 7安裝MySQLCentOSMySql
- CentOS 7安裝ElasticsearchCentOSElasticsearch
- Centos 7安裝iscsiCentOS
- Centos 7 Docker 安裝CentOSDocker
- CentOS7安裝rabbitmqCentOSMQ
- centos 7 安裝 rabbitMqCentOSMQ
- centos7.3安裝redisCentOSRedis
- Centos安裝與配置RedisCentOSRedis
- Centos7安裝安裝部署dockerCentOSDocker
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- 在centos7中安裝redis,並通過node.js操作redisCentOSRedisNode.js
- CentOS 7 Minimal 安裝 LXQTCentOSQT
- CentOS 7 安裝 MySQL 5.7CentOSMySql
- centos7 安裝pipCentOS
- CentOS7 安裝 MySQLCentOSMySql
- centos7安裝protobufCentOS
- 4.1 CentOS7安裝CentOS
- CentOS7安裝wpsCentOS
- VirtualBox安裝Centos7CentOS