First, you can download the website under CentOS (http://redis.io/ or Chinese redis site http://www.redis.cn/)
Generally installed under opt from the desktop to move to opt under the command MV Redis-3.2.0.tar.gz. /.. /.. /OPT (Centos7.2)
Unzip: TAR-ZXVF redis-3.2.0.tar.gz then go to CD redis-3.2.0 perform installation make error
Cause: The GCC workaround is not installed: Install Gcc[[email protected] ~]$ yum-y install gcc automake autoconf libtool make result: Make is successful after installation
2. If you enter the make prompt:ZMALLOC.H:50:31: Fatal error: jemalloc/jemalloc.h: no file or directoryThere is this passage in the README. Allocator---------Selecting A non-default memory Allocator when building Redis was done by setting the ' MALLOC ' Enviro Nment variable. Redis is compiled and linked against libc malloc by default, with the exception of the Jemalloc being the default on Linux s Ystems. This default is picked because Jemalloc has proven to the 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, u SE:% make Malloc=jemalloc says about allocator allocator, if there is a MALLOC environment variable, it will be useful to set up Redis for this environment variable. And libc is not the default allocator, the default is Jemalloc, because Jemalloc is proven to have fewer fragmentation problems than libc. But if you don't have a jemalloc and only libc of course make a mistake. So add such a parameter.
Workaround:
[email protected] redis-3.2.0]# make MALLOC=LIBC
Until the result is output:
That's OK.
After make the redis-3.2.0 directory will appear after the compiled Redis service program Redis-server, as well as the client program for testing REDIS-CLI, two programs located in the installation directory SRC directory:
Start the Redis service below.
#cd SRC
#./redis-server Note that this way of starting Redis is using the default configuration. You can also tell Redis to start with the following command using the specified configuration file through the startup parameters.
#cd SRC
#./redis-server redis.confredis.conf is a default configuration file. We can use our own configuration files as needed.
Once the Redis service process is started, you can use the test client program REDIS-CLI to interact with the Redis service. Like what:
#cd SRC
#./redis-cli
#set Foo Bar
Ok
#get Foo
"Bar"
---------------------to this installation success
Installing Redis under Linux