您的位置:首页 > 数据库 > Redis

How to install Redis 3.2 on CentOS 6 and 7

2017-09-28 15:31 531 查看

WhatisRedis?

Redisisaflexibleopen-source,keyvaluedatastore,usedasadatabase,cacheandmessagebroker.Redisallowstheusertostorevastamountsofdatawithoutthelimitsofarelationaldatabase.Inordertoachieveitsoutstandingperformance,Redisworkswithanin-memorydataset.Dependingonyourusecase,youcanpersistiteitherbydumpingthedatasettodiskeveryonceinawhile,orbyappendingeachcommandtoalog.Persistencecanbeoptionallydisabled,ifyoujustneedafeature-rich,networked,in-memorycache.

Installnecessarypackages

OnCentOS6:
yuminstallwgetmakegcctcl
OnCentOS7
yuminstallwgetmakegcc

InstallRedis3.2

ForinstallingRedis3.2youhavetodownloadthesourcefileandcompileitbecauseRedis3.2isnotavailableinanyrepositoryyet.OnCentOS6andCentOS7
wget'target='_blank'>http://download.redis.io/releases/redis-3.2.8.tar.gz[/code]Nowyouhavetoextractthefilethatyoujustdownloadedbytyping:
tar-xvzfredis-3.2.8.tar.gz
Changedirectorywiththecommandbelow:
cdredis-3.2.8
It’stimetocompileyourRedisstepbystep:
cddeps
makehiredisluajemalloclinenoise
makegeohash-int
Nowrunbelowcommandtogetbacktotheparentdirectoryandrunthenextcommand:
cd../makemakeinstall
Andforgettingsurerunningatest:
maketest
It’sgoingtotakeafewminutes,youcancheckthateverythingisok.

Installinitscript

Inthissection,wearegoingtoinstall“initscript”tomanagetheprocessofRedis.
cdutils./install_server.sh
Youwillbepromptforsomeconfigurationyoucanhit“Enter”toacceptallthedefaultvaluesoryoucansetyours.Finally,yourRedisserverisinstalledandyoucanstarttheservicebythecommandbelow:ForCentOS6
serviceredis_6379start
ForCentOS7
systemctlstartredis_6379
IfyouwanttotestyourRedisserveryoucaneasilyusetheinstructionbelow:
redis-cli>settest"HugeServer">gettest
Theanswershouldbe“HugeServer”IfyouneedacontrolpanelforyourRedisServeryoumayusePhpredminorRedmon
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: