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
- centos7 安裝 redis-5.0.3CentOSRedis
- CentOS7+Redis Live安裝配置CentOSRedis
- centos7 安裝redis和redis擴充套件CentOSRedis套件
- centos7 下安裝redis-4.0.2CentOSRedis
- Linux-Redis安裝(CentOS7)LinuxRedisCentOS
- Centos 安裝RedisCentOSRedis
- centos7 安裝php7+mysql5.7+nginx+redisCentOSPHPMySqlNginxRedis
- 在Centos7上安裝Redis6CentOSRedis
- Centos7怎麼安裝Redis5.0CentOSRedis
- 【redis】centOS安裝配置redisRedisCentOS
- 如何在 CentOS 7 上安裝 Redis 伺服器CentOSRedis伺服器
- CentOS redis安裝配置CentOSRedis
- Centos7-VMware+Centos7安裝配置CentOS
- centos7安裝單機環境redis3.2CentOSRedisS3
- Centos7編譯安裝Redis 6.2.3 詳細教程CentOS編譯Redis
- 【CentOS】CentOS7安裝PostgreSQLCentOSSQL
- Centos 7安裝iscsiCentOS
- CentOS 7 安裝 lnmpCentOSLNMP
- CentOS 7 - 安裝NginxCentOSNginx
- Centos 7安裝FTPCentOSFTP
- Centos 7 安裝JDKCentOSJDK
- Centos 7 安裝NginxCentOSNginx
- CentOS 7安裝ElasticsearchCentOSElasticsearch
- CentOS7安裝rabbitmqCentOSMQ
- centos 7 安裝 rabbitMqCentOSMQ
- CentOS 7安裝MySQLCentOSMySql
- CentOS 7 安裝 GlusterFSCentOS
- CentOS 7安裝AzcopyCentOS
- centos 7 安裝 ffmpegCentOS
- CentOS 7 安裝 MySQLCentOSMySql
- Centos 7 Docker 安裝CentOSDocker
- centos7.3安裝redisCentOSRedis
- Centos安裝與配置RedisCentOSRedis
- Centos-redis安裝配置CentOSRedis
- centOS安裝redis3.0.6CentOSRedisS3