安装redis

本文记录了Redis 2.4.13版本在Ubuntu Linux环境下的安装过程及配置注意事项,并通过一个简单的Java示例展示了如何使用Jedis客户端连接Redis进行读写操作。


安装redis记录:

环境

Linux wuyingbo 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 i386 GNU/Linux

1、下载

redis-2.4.13.tar.gz                 是稳定版本stable

2、解压

tar -xzvf  redis-2.4.13.tar.gz

3、make

4、cd src

5、运行

              ./redis-server        如果想在后台运行就执行       nohup  ./redis-server &

6、测试             ./redis-cli

set hello "world"

get hello


简单入门:

import redis.clients.jedis.Jedis;


public class RedisTest {
	public static void main(String[] args) {
//		Jedis(java.lang.String host, int port, int timeout) 
		Jedis jedis = new Jedis("127.0.0.1",6379);
		jedis.connect();
		jedis.set("java redis","hello java redis - jedis.");
		String  value  = jedis.get("java redis");
		System.out.println(value);
	}
}


[12592] 21 May 17:12:02 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

我将  vm.overcommit_memory = 1  写到了 /etc/sysctl.conf   中了。


root@wuyingbo:/usr/local/redis-2.4.13# make clean
cd src && make clean
make[1]: 正在进入目录 `/usr/local/redis-2.4.13/src'
rm -rf redis-server redis-benchmark redis-cli redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov
make[1]:正在离开目录 `/usr/local/redis-2.4.13/src'
cd deps/hiredis && make clean
make[1]: 正在进入目录 `/usr/local/redis-2.4.13/deps/hiredis'
rm -rf libhiredis.so libhiredis.a hiredis-example hiredis-test hiredis-example* *.o *.gcda *.gcno *.gcov
make[1]:正在离开目录 `/usr/local/redis-2.4.13/deps/hiredis'
cd deps/linenoise && make clean
make[1]: 正在进入目录 `/usr/local/redis-2.4.13/deps/linenoise'
rm -f linenoise_example *.o
make[1]:正在离开目录 `/usr/local/redis-2.4.13/deps/linenoise'
(cd deps/jemalloc && make distclean)
make[1]: 正在进入目录 `/usr/local/redis-2.4.13/deps/jemalloc'
rm -f src/jemalloc.o src/arena.o src/atomic.o src/base.o src/bitmap.o src/chunk.o src/chunk_dss.o src/chunk_mmap.o src/chunk_swap.o src/ckh.o src/ctl.o src/extent.o src/hash.o src/huge.o src/mb.o src/mutex.o src/prof.o src/rtree.o src/stats.o src/tcache.o
rm -f src/jemalloc.pic.o src/arena.pic.o src/atomic.pic.o src/base.pic.o src/bitmap.pic.o src/chunk.pic.o src/chunk_dss.pic.o src/chunk_mmap.pic.o src/chunk_swap.pic.o src/ckh.pic.o src/ctl.pic.o src/extent.pic.o src/hash.pic.o src/huge.pic.o src/mb.pic.o src/mutex.pic.o src/prof.pic.o src/rtree.pic.o src/stats.pic.o src/tcache.pic.o
rm -f src/jemalloc.d src/arena.d src/atomic.d src/base.d src/bitmap.d src/chunk.d src/chunk_dss.d src/chunk_mmap.d src/chunk_swap.d src/ckh.d src/ctl.d src/extent.d src/hash.d src/huge.d src/mb.d src/mutex.d src/prof.d src/rtree.d src/stats.d src/tcache.d
rm -f src/jemalloc.pic.d src/arena.pic.d src/atomic.pic.d src/base.pic.d src/bitmap.pic.d src/chunk.pic.d src/chunk_dss.pic.d src/chunk_mmap.pic.d src/chunk_swap.pic.d src/ckh.pic.d src/ctl.pic.d src/extent.pic.d src/hash.pic.d src/huge.pic.d src/mb.pic.d src/mutex.pic.d src/prof.pic.d src/rtree.pic.d src/stats.pic.d src/tcache.pic.d
rm -f test/allocated test/allocm test/bitmap test/mremap test/posix_memalign test/rallocm test/thread_arena
rm -f test/allocated.o test/allocm.o test/bitmap.o test/mremap.o test/posix_memalign.o test/rallocm.o test/thread_arena.o
rm -f test/allocated.d test/allocm.d test/bitmap.d test/mremap.d test/posix_memalign.d test/rallocm.d test/thread_arena.d
rm -f test/allocated.out test/allocm.out test/bitmap.out test/mremap.out test/posix_memalign.out test/rallocm.out test/thread_arena.out
rm -f lib/libjemalloc.so.1 lib/libjemalloc.so lib/libjemalloc_pic.a lib/libjemalloc.a
rm -rf autom4te.cache
rm -f config.log
rm -f config.status
rm -f config.stamp
rm -f include/jemalloc/jemalloc_defs.h
rm -f Makefile doc/html.xsl doc/manpages.xsl doc/jemalloc.xml include/jemalloc/jemalloc.h include/jemalloc/internal/jemalloc_internal.h test/jemalloc_test.h
make[1]:正在离开目录 `/usr/local/redis-2.4.13/deps/jemalloc'
root@wuyingbo:/usr/local/redis-2.4.13# make
cd src && make all
make[1]: 正在进入目录 `/usr/local/redis-2.4.13/src'
MAKE hiredis
make[2]: 正在进入目录 `/usr/local/redis-2.4.13/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  sds.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
make[2]:正在离开目录 `/usr/local/redis-2.4.13/deps/hiredis'
MAKE linenoise
make[2]: 正在进入目录 `/usr/local/redis-2.4.13/deps/linenoise'
cc  -c -Wall -W -Os -g linenoise.c
cc  -c -Wall -W -Os -g example.c
cc  -Wall -W -Os -g -o linenoise_example linenoise.o example.o
make[2]:正在离开目录 `/usr/local/redis-2.4.13/deps/linenoise'
MAKE jemalloc
checking for xsltproc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether compiler supports -std=gnu99... yes
checking whether compiler supports -Wall... yes
checking whether compiler supports -pipe... yes
checking whether compiler supports -g3... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of void *... 4
checking size of int... 4
checking size of long... 4
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking whether __asm__ is compilable... yes
checking whether __attribute__ syntax is compilable... yes
checking whether compiler supports -fvisibility=hidden... yes
checking whether mremap(...MREMAP_FIXED...) is compilable... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for ld... /usr/bin/ld
checking for autoconf... no
checking whether compiler supports -O3... yes
checking whether compiler supports -funroll-loops... yes
checking configured backtracing method... N/A
checking STATIC_PAGE_SHIFT... 12
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_create in -lpthread... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for dlopen in -ldl... yes
checking for TLS... yes
checking for ffsl... yes
checking whether Darwin OSAtomic*() is compilable... no
checking whether Darwin OSSpin*() is compilable... no
checking for memalign... yes
checking for valloc... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/html.xsl
config.status: creating doc/manpages.xsl
config.status: creating doc/jemalloc.xml
config.status: creating include/jemalloc/jemalloc.h
config.status: creating include/jemalloc/internal/jemalloc_internal.h
config.status: creating test/jemalloc_test.h
config.status: creating config.stamp
config.status: creating include/jemalloc/jemalloc_defs.h
===============================================================================
jemalloc version   : 2.2.5-0-gfc1bb70e5f0d9a58b39efa39cc549b5af5104760

CC                 : gcc
CPPFLAGS           :  -D_GNU_SOURCE -D_REENTRANT
CFLAGS             : -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops
LDFLAGS            : 
LIBS               :  -lpthread -ldl
RPATH_EXTRA        : 

XSLTPROC           : 
XSLROOT            : /usr/share/xml/docbook/stylesheet/docbook-xsl

PREFIX             : /usr/local
BINDIR             : /usr/local/bin
INCLUDEDIR         : /usr/local/include
LIBDIR             : /usr/local/lib
DATADIR            : /usr/local/share
MANDIR             : /usr/local/share/man

srcroot            : 
abs_srcroot        : /usr/local/redis-2.4.13/deps/jemalloc/
objroot            : 
abs_objroot        : /usr/local/redis-2.4.13/deps/jemalloc/

JEMALLOC_PREFIX    : je_
JEMALLOC_PRIVATE_NAMESPACE
                   : 
install_suffix     : 
autogen            : 0
cc-silence         : 1
debug              : 0
stats              : 0
prof               : 0
prof-libunwind     : 0
prof-libgcc        : 0
prof-gcc           : 0
tiny               : 1
tcache             : 1
fill               : 0
xmalloc            : 0
sysv               : 0
swap               : 0
dss                : 0
dynamic_page_shift : 0
lazy_lock          : 1
tls                : 1
===============================================================================
make[2]: 正在进入目录 `/usr/local/redis-2.4.13/deps/jemalloc'
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/jemalloc.o src/jemalloc.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/jemalloc.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/arena.o src/arena.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/arena.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
src/arena.c: 在函数‘arena_run_split’中:
src/arena.c:315:9: 警告: 变量‘old_ndirty’被设定但未被使用 [-Wunused-but-set-variable]
src/arena.c: 在函数‘bin_info_run_size_calc’中:
src/arena.c:2449:25: 警告: 变量‘good_hdr_size’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/atomic.o src/atomic.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/atomic.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/base.o src/base.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/base.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/bitmap.o src/bitmap.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/bitmap.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk.o src/chunk.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/chunk.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_dss.o src/chunk_dss.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/chunk_dss.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_mmap.o src/chunk_mmap.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/chunk_mmap.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/chunk_swap.o src/chunk_swap.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/chunk_swap.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ckh.o src/ckh.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/ckh.c:38:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/ctl.o src/ctl.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/ctl.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/extent.o src/extent.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/extent.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/hash.o src/hash.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/hash.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/huge.o src/huge.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/huge.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mb.o src/mb.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/mb.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/mutex.o src/mutex.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/mutex.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/prof.o src/prof.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/prof.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/rtree.o src/rtree.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/rtree.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/stats.o src/stats.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/stats.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
src/stats.c: 在函数‘stats_print’中:
src/stats.c:394:7: 警告: 变量‘large’被设定但未被使用 [-Wunused-but-set-variable]
src/stats.c:393:7: 警告: 变量‘bins’被设定但未被使用 [-Wunused-but-set-variable]
src/stats.c:392:7: 警告: 变量‘unmerged’被设定但未被使用 [-Wunused-but-set-variable]
src/stats.c:391:7: 警告: 变量‘merged’被设定但未被使用 [-Wunused-but-set-variable]
gcc -std=gnu99 -Wall -pipe -g3 -fvisibility=hidden -O3 -funroll-loops -c -D_GNU_SOURCE -D_REENTRANT -Iinclude -Iinclude -o src/tcache.o src/tcache.c
In file included from include/jemalloc/internal/jemalloc_internal.h:584:0,
                 from src/tcache.c:2:
include/jemalloc/internal/tcache.h: 在函数‘tcache_dalloc_large’中:
include/jemalloc/internal/tcache.h:393:9: 警告: 变量‘pageind’被设定但未被使用 [-Wunused-but-set-variable]
include/jemalloc/internal/tcache.h:391:11: 警告: 变量‘arena’被设定但未被使用 [-Wunused-but-set-variable]
ar crus lib/libjemalloc.a src/jemalloc.o src/arena.o src/atomic.o src/base.o src/bitmap.o src/chunk.o src/chunk_dss.o src/chunk_mmap.o src/chunk_swap.o src/ckh.o src/ctl.o src/extent.o src/hash.o src/huge.o src/mb.o src/mutex.o src/prof.o src/rtree.o src/stats.o src/tcache.o
make[2]:正在离开目录 `/usr/local/redis-2.4.13/deps/jemalloc'
    CC ae.o
    CC anet.o
    CC redis-benchmark.o
    CC sds.o
    CC adlist.o
    CC zmalloc.o
MAKE hiredis
make[2]: 正在进入目录 `/usr/local/redis-2.4.13/deps/hiredis'
make[2]: 没有什么可以做的为 `static'。
make[2]:正在离开目录 `/usr/local/redis-2.4.13/deps/hiredis'
    LINK redis-benchmark
    CC redis-cli.o
    CC release.o
    LINK redis-cli
    CC redis-check-dump.o
    CC lzf_c.o
    CC lzf_d.o
    LINK redis-check-dump
    CC redis-check-aof.o
    LINK redis-check-aof
    CC dict.o
    CC redis.o
    CC pqsort.o
    CC zipmap.o
    CC sha1.o
    CC ziplist.o
    CC networking.o
    CC util.o
    CC object.o
    CC db.o
    CC replication.o
    CC rdb.o
    CC t_string.o
    CC t_list.o
    CC t_set.o
    CC t_zset.o
    CC t_hash.o
    CC config.o
    CC aof.o
    CC vm.o
    CC pubsub.o
    CC multi.o
    CC debug.o
    CC sort.o
    CC intset.o
    CC syncio.o
    CC slowlog.o
    CC bio.o
    CC memtest.o
memtest.c: 在函数‘memtest_test’中:
memtest.c:208:9: 警告: 大整数隐式截断为无符号类型 [-Woverflow]
memtest.c:208:9: 警告: 大整数隐式截断为无符号类型 [-Woverflow]
    LINK redis-server

Hint: To run 'make test' is a good idea ;)

make[1]:正在离开目录 `/usr/local/redis-2.4.13/src'








在 Windows 系统上安装 Redis 有多种方式,主要包括使用 WSL(Windows Subsystem for Linux)运行原生的 Linux 版本 Redis、通过已编译的 Windows 兼容版本安装,或者以服务形式进行部署。以下是详细的安装方法: ### 使用 WSL 安装 Redis 1. **启用 WSL 并安装 Linux 发行版** - 打开 PowerShell,以管理员身份运行以下命令: ```powershell wsl --install ``` - 完成后重启系统,并设置默认的 Linux 发行版(如 Ubuntu)。 2. **更新系统并安装 Redis** - 启动 WSL 终端,输入以下命令更新包管理器并安装 Redis: ```bash sudo apt update sudo apt install redis-server ``` 3. **配置与启动 Redis** - 默认配置文件位于 `/etc/redis/redis.conf`,可根据需求修改。 - 启动 Redis 服务: ```bash sudo service redis start ``` - 验证是否正常运行: ```bash redis-cli ping ``` 若返回 `PONG`,则表示安装成功[^1]。 ### 使用 Windows 编译版本安装 Redis 1. **下载适用于 Windows 的 Redis** - 可从 GitHub 获取适用于 Windows 的 Redis 发行版本,例如 Redis-x64-3.2.100 或更高版本。 2. **解压并配置 Redis** - 将下载的压缩包解压到指定目录(如 `D:\Redis`)。 - 修改 `redis.windows.conf` 文件中的配置项(如绑定 IP 地址、端口等)。 3. **启动 Redis 服务器** - 打开命令提示符(CMD),进入 Redis 解压目录并运行: ```cmd cd D:\Redis\Redis-x64-3.2.100 redis-server redis.windows.conf ``` 4. **将 Redis 安装为 Windows 服务** - 在 CMD 中执行以下命令将其注册为服务: ```cmd redis-server --service-install redis.windows.conf ``` - 成功安装后,可通过“服务”管理界面启动或停止 Redis 服务[^2]。 ### 自定义安装路径与多实例配置 1. **复制 Redis 文件至新路径** - 假设目标路径为 `E:\Program Files\Redis2`,可将原有 Redis 文件夹内容复制至此。 2. **修改配置文件** - 编辑 `redis.conf` 文件,更改监听 IP 地址(`bind`)和端口号(`port`)以避免冲突。 3. **安装多个 Redis 实例** - 每个实例应使用不同的配置文件,分别指定各自的端口和服务名称。 - 使用类似命令安装服务: ```cmd redis-server --service-install redis-instance2.conf --service-name redisService2 ``` - 此方法允许在同一台机器上运行多个 Redis 服务[^3]。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值