Redis实战——安装问题汇总

Posted onlyct

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redis实战——安装问题汇总相关的知识,希望对你有一定的参考价值。

问题:编译过程中出现报错

 

[[email protected] redis-4.0.9]$ make
cd src && make all
make[1]: Entering directory `/home/webapp/redis-4.0.9/src‘
    CC Makefile.dep
make[1]: Leaving directory `/home/webapp/redis-4.0.9/src‘
make[1]: Entering directory `/home/webapp/redis-4.0.9/src‘
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/home/webapp/redis-4.0.9/deps‘
(cd hiredis &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd linenoise &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd lua &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd jemalloc &amp;&amp; [ -f Makefile ] &amp;&amp; make distclean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(rm -f .make-*)
make[2]: Leaving directory `/home/webapp/redis-4.0.9/deps‘
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC=‘‘ &gt;&gt; .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers &gt;&gt; .make-settings
echo OPT=-O2 &gt;&gt; .make-settings
echo MALLOC=jemalloc &gt;&gt; .make-settings
echo CFLAGS= &gt;&gt; .make-settings
echo LDFLAGS= &gt;&gt; .make-settings
echo REDIS_CFLAGS= &gt;&gt; .make-settings
echo REDIS_LDFLAGS= &gt;&gt; .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC=‘‘ -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb   -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -DUSE_JEMALLOC -I../deps/jemalloc/include &gt;&gt; .make-settings
echo PREV_FINAL_LDFLAGS=  -g -ggdb -rdynamic &gt;&gt; .make-settings
(cd ../deps &amp;&amp; make hiredis linenoise lua jemalloc)
make[2]: Entering directory `/home/webapp/redis-4.0.9/deps‘
(cd hiredis &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd linenoise &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd lua &amp;&amp; make clean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(cd jemalloc &amp;&amp; [ -f Makefile ] &amp;&amp; make distclean) &gt; <a style="color:#3465A4" href="/dev/null">/dev/null</a> || true
(rm -f .make-*)
(echo "" &gt; .make-ldflags)
(echo "" &gt; .make-cflags)
MAKE hiredis
cd hiredis &amp;&amp; make static
make[3]: Entering directory `/home/webapp/redis-4.0.9/deps/hiredis‘
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/home/webapp/redis-4.0.9/deps/hiredis‘
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/home/webapp/redis-4.0.9/deps‘
make[1]: [persist-settings] Error 2 (ignored)
    CC adlist.o
<a style="color:#3465A4" href="/bin/sh">/bin/sh</a>: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/home/webapp/redis-4.0.9/src‘
make: *** [all] Error 2

 

提示gcc命令未找到,这是因为redis没有安装gcc编译器没安装
这时候只要安装编译器即可

[[email protected] redis-3.2.8]# yum install -y gcc g++ gcc-c++ make

安装完成提示

nstalled:
  gcc.x86_64 0:4.4.7-18.el6_9.2        gcc-c++.x86_64 0:4.4.7-18.el6_9.2       

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6            cpp.x86_64 0:4.4.7-18.el6_9.2   
  libstdc++-devel.x86_64 0:4.4.7-18.el6_9.2    mpfr.x86_64 0:2.4.1-6.el6       
  ppl.x86_64 0:0.10.2-11.el6                  

Dependency Updated:
  libgcc.x86_64 0:4.4.7-18.el6_9.2        libgomp.x86_64 0:4.4.7-18.el6_9.2    
  libstdc++.x86_64 0:4.4.7-18.el6_9.2    

Complete!

 


以上是关于Redis实战——安装问题汇总的主要内容,如果未能解决你的问题,请参考以下文章

Redis五大数据类型与使用场景汇总!!(含完整实战案例,建议收藏)

一天肝完Redis全是精华(实战操作汇总/1024特别奉献)

Redis实现分布式锁(设计模式应用实战)

Redis实现分布式锁(设计模式应用实战)

Redis系列--常用命令汇总

项目实战 redis 缓存