Installing the Redis Database

Source: Internet
Author: User
Tags benchmark download redis gmp redis version sha1

Download Redis version: https://redis.io/download i downloaded: redis-3.0.6

After download, TAR-ZXVF redis-3.0.6 on Linux, go to redis-3.0.6 directory, compile with make

When installing Redis, when compiling with the make command, throw an exception
[[email protected] redis-3.0.6]# make
CD src && make all
MAKE[1]: Entering directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
CC ADLIST.O
/bin/sh:cc:command not found
MAKE[1]: * * * [ADLIST.O] Error 127
MAKE[1]: Leaving directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
Make: * * * [ALL] Error 2

This is the reason that the local Linux does not have GCC installed because my Linux is not networked so use offline installation, that is, first download the RPM package on Windows, and then move to Linux manually installed
Steps to install GCC:
Download the RPM package required for GCC in the ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.8/x86_64/os/Packages/connection
From the Internet, the following packages are required
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.7-17.el6.x86_64.rpm
gcc-4.4.7-17.el6.x86_64.rpm
gcc-c++-4.4.7-17.el6.x86_64.rpm
glibc-devel-2.12-1.192.el6.x86_64.rpm
glibc-headers-2.12-1.192.el6.x86_64.rpm
kernel-headers-2.6.32-642.el6.x86_64.rpm
libgomp-4.4.7-17.el6.x86_64.rpm
libstdc++-devel-4.4.7-17.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm

After downloading, create a new directory (in the directory where you install the app), and place the newly downloaded packages in the directory, using
[Email protected] gcc]# RPM-UVH ppl-0.10.2-11.el6.x86_64.rpm
Warning:ppl-0.10.2-11.el6.x86_64.rpm:header V4 dsa/sha1 Signature, key ID 192a7d7d:nokey
error:failed dependencies:
Libgmp.so.3 () (64bit) is needed by ppl-0.10.2-11.el6.x86_64

You can see that using RPM-IVH has dependency problems, so I use the Ignore dependency, force installation
[Email protected] gcc]# RPM-IVH cloog-ppl-0.15.7-1.2.el6.x86_64.rpm--nodeps--force
Warning:cloog-ppl-0.15.7-1.2.el6.x86_64.rpm:header V4 dsa/sha1 Signature, key ID 192a7d7d:nokey
Preparing ... ################################# [100%]
Updating/installing ...
1:cloog-ppl-0.15.7-1.2.el6 ################################# [100%]
[Email protected] gcc]# RPM-IVH cpp-4.4.7-17.el6.x86_64.rpm--nodeps--force
Warning:cpp-4.4.7-17.el6.x86_64.rpm:header V4 dsa/sha1 Signature, key ID 192a7d7d:nokey
Preparing ... ################################# [100%]
Updating/installing ...
1:cpp-4.4.7-17.el6 ################################# [100%]

To see if GCC is installed successfully
[Email protected] redis-3.0.6]# gcc--version
GCC (gcc) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) Free Software Foundation, Inc.
This was free software;  See the source for copying conditions. There is NO
Warranty Not even to merchantability or FITNESS for A particular PURPOSE.

After all RPM packages are installed, use the make command to throw the following exception
[[email protected] redis-3.0.6]# make
CD src && make all
MAKE[1]: Entering directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
CC ADLIST.O
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/cc1:error while loading shared libraries:libgmp.so.3:cannot open shared Object File:no such file or directory
MAKE[1]: * * * [ADLIST.O] Error 1
MAKE[1]: Leaving directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
Make: * * * [ALL] Error 2

Say is missing libgmp.so.3 me from http://www.rpmfind.net/linux/rpm2html/search.php?query=gmp&submit=Search+...&system= &arch= connection in the download gmp-4.3.1-12.el6.x86_64.rpm this package and install, again use make or throw an exception
[[email protected] redis-3.0.6]# make
CD src && make all
MAKE[1]: Entering directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
CC ADLIST.O
In file included from adlist.c:34:
Zmalloc.h:50:31:error:jemalloc/jemalloc.h:no such file or directory
Zmalloc.h:55:2: Error: #error "Newer version of Jemalloc required"
MAKE[1]: * * * [ADLIST.O] Error 1
MAKE[1]: Leaving directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '
Make: * * * [ALL] Error 2

There's a redme file in the Redis directory, and there's a
Selecting a Non-default memory allocator when building Redis are done by setting
The ' MALLOC ' 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 is picked because Jemalloc has proven to having fewer
Fragmentation problems than libc malloc.

To force compiling against libc malloc, use:

% make MALLOC=LIBC

To compile against Jemalloc in Mac OS X systems, use:

% make Malloc=jemalloc

Verbose Build

This paragraph probably means that selecting a memory allocator on Redis is set by the malloc variable, and Jemalloc is the default value for Linux. If you do not have jemalloc in Linux, throw this exception.
Using Make MALLOC=LIBC
Installation Complete
.......
.......
.......
LINK REDIS-CLI
CC REDIS-BENCHMARK.O
LINK Redis-benchmark
CC REDIS-CHECK-DUMP.O
LINK Redis-check-dump
CC REDIS-CHECK-AOF.O
LINK redis-check-aof

Hint:it ' s a good idea to run ' make test ';)

MAKE[1]: Leaving directory '/USR/LOCAL/DEVELOPMENT/REDIS-3.0.6/SRC '


Under {redis_home}/src/, start the server-side use command./redis-server
[Email protected] src]#./redis-server
4017:c Sep 15:06:57.727 # warning:no config file specified, using the default Config. In order to specify a config file use./redis-server/path/to/redis.conf
4017:m SEP 15:06:57.727 * Increased maximum number of open files to 10032 (it is originally set to 1024).
_._
_.-' __ '-._
_.-``    `.  `_. "-._ Redis 3.0.6 (00000000/0)
.-`` .-```. ' \ \ _.,_ '-._
(',.-' | ',) Running in standalone mode
| '-._ '-...-' __...-. '-._| '     ' _.-' | port:6379
|     '-._ '. _/_.-' | pid:4017
'-._ '-._ '-./_.-' _.-'
| '-._ '-._ '-.__.-' _.-' _.-' |
|           '-._ '-._ _.-' _.-' | Http://redis.io
'-._ '-._ '-.__.-' _.-' _.-'
| '-._ '-._ '-.__.-' _.-' _.-' |
| '-._ '-._ _.-' _.-' |
'-._ '-._ '-.__.-' _.-' _.-'
'-._ '-.__.-' _.-'
'-._ _.-'
'-.__.-'

4017:m Sep 15:06:57.728 # warning:the TCP Backlog setting of 511 cannot be enforced BECAUSE/PROC/SYS/NET/CORE/SOMAXCO NN is set to the lower value of 128.
4017:m Sep 15:06:57.728 # Server started, Redis version 3.0.6
4017:m Sep 15:06:57.728 # 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.overcom Mit_memory=1 ' for the take effect.
4017:m Sep 15:06:57.728 # WARNING You has Transparent Huge Pages (THP) support for enabled in your kernel. This would create latency and memory usage issues with Redis. To fix this issue run the command ' echo never >/sys/kernel/mm/transparent_hugepage/enabled ' as root, and add it to you R/etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
4017:m SEP 15:06:57.728 * The server is now a ready-to-accept connections on port 6379
4017:m SEP 15:08:59.648 # User requested shutdown ...
4017:m SEP 15:08:59.648 * Saving the final RDB snapshot before exiting.
4017:m Sep 15:08:59.649 * DB saved on disk
4017:m Sep 15:08:59.649 # Redis is now ready to exit, Bye bye ...

Under {redis_home}/src/, start the client use command./REDIS-CLI
127.0.0.1:6379> set Zhang 123
Ok
127.0.0.1:6379> get Zhang
"123"


View the Redis process
[Email protected] redis-3.0.6]# Ps-ef|grep Redis
Root 4071 3341 0 15:15 pts/4 00:00:00./redis-server *:6379
Root 4075 3244 0 15:15 pts/2 00:00:00 grep--color=auto Redis

=============================================================================================================== ==============================================
Stop Redis Service
[Email protected] src]#/REDIS-CLI shutdown

Redis Service Side
4071:m SEP 15:17:03.867 # User requested shutdown ...
4071:m SEP 15:17:03.867 * Saving the final RDB snapshot before exiting.
4071:m Sep 15:17:04.248 * DB saved on disk
4071:m Sep 15:17:04.248 # Redis is now ready to exit, Bye bye ...

View the Redis process
[Email protected] src]# Ps-ef |grep Redis
Root 4080 3341 0 15:19 pts/4 00:00:00 grep--color=auto Redis
[Email protected] src]#

Installing the Redis Database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.