下载redis版本:https://redis.io/download           我下载的是:redis-3.0.6

下载后,在linux上      tar -zxvf redis-3.0.6,进入redis-3.0.6 目录,使用make进行编译

在安装Redis,使用make命令编译的时候,抛出异常
[root@node1 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

这个是本地的Linux没有安装gcc的原因,因为我的Linux没有联网所以使用离线安装,也就是先再Windows上下载RPM包,然后移动到Linux上手动安装
安装gcc的步骤:
在ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.8/x86_64/os/Packages/连接里 下载gcc所需的RPM包
从网上查,需要下面这些包
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

下载完后,新建个目录(在你安装应用的目录下即可,随意),将这些刚下载的包放到目录下,使用
[root@node1 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

可以看到使用rpm -ivh 有依赖问题,所以我使用的忽略依赖,强制安装
[root@node1 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%]
[root@node1 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%]

查看gcc是否安装成功
[root@node1 redis-3.0.6]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

所有的RPM包安装完后,再使用make命令,抛出下面异常
[root@node1 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

说是缺少libgmp.so.3 我从http://www.rpmfind.net/linux/rpm2html/search.php?query=gmp&submit=Search+...&system=&arch=连接中下载里了    gmp-4.3.1-12.el6.x86_64.rpm 这个包并安装,再次使用make还是抛出异常
[root@node1 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

在Redis的目录中有个redme文件,里面有这么一段
Selecting a non-default memory allocator when building Redis is 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 was picked because jemalloc has proven to have 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, use:

% make MALLOC=jemalloc

Verbose build

这段大概意思是:在Redis时选择一个内存分配器是通过MALLOC变量来设置的,jemalloc是Linux的默认的值。如果你的linux中没有jemalloc 所以抛出这个异常。
使用make MALLOC=libc
安装完成
.......
.......
.......
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'

在{redis_home}/src/ 下,启动服务端  使用命令 ./redis-server
[root@node1 src]# ./redis-server
4017:C 16 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 16 Sep 15:06:57.727 * Increased maximum number of open files to 10032 (it was originally set to 1024).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.0.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 4017
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'

4017:M 16 Sep 15:06:57.728 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
4017:M 16 Sep 15:06:57.728 # Server started, Redis version 3.0.6
4017:M 16 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.overcommit_memory=1' for this to take effect.
4017:M 16 Sep 15:06:57.728 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will 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 your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
4017:M 16 Sep 15:06:57.728 * The server is now ready to accept connections on port 6379
4017:M 16 Sep 15:08:59.648 # User requested shutdown...
4017:M 16 Sep 15:08:59.648 * Saving the final RDB snapshot before exiting.
4017:M 16 Sep 15:08:59.649 * DB saved on disk
4017:M 16 Sep 15:08:59.649 # Redis is now ready to exit, bye bye...

在{redis_home}/src/ 下,启动客户端  使用命令 ./redis-cli
127.0.0.1:6379> set zhang 123
OK
127.0.0.1:6379> get zhang
"123"

查看redis 进程
[root@node1 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

=============================================================================================================================================================
停止redis 服务
[root@node1 src]# ./redis-cli shutdown

redis服务端
4071:M 16 Sep 15:17:03.867 # User requested shutdown...
4071:M 16 Sep 15:17:03.867 * Saving the final RDB snapshot before exiting.
4071:M 16 Sep 15:17:04.248 * DB saved on disk
4071:M 16 Sep 15:17:04.248 # Redis is now ready to exit, bye bye...

查看redis进程
[root@node1 src]# ps -ef |grep redis
root       4080   3341  0 15:19 pts/4    00:00:00 grep --color=auto redis
[root@node1 src]#

安装 redis [standlone模式]的更多相关文章

  1. spark的standlone模式安装和application 提交

    spark的standlone模式安装 安装一个standlone模式的spark集群,这里是最基本的安装,并测试一下如何进行任务提交. require:提前安装好jdk 1.7.0_80 :scal ...

  2. Spring Boot 入门(十):集成Redis哨兵模式,实现Mybatis二级缓存

    本片文章续<Spring Boot 入门(九):集成Quartz定时任务>.本文主要基于redis实现了mybatis二级缓存.较redis缓存,mybaits自带缓存存在缺点(自行谷歌) ...

  3. linux安装redis及主从复制、读写分离、哨兵模式

    Redis安装与部署 版本最好选择3.0及以上.以后还可以部署Redis集群. 1.下载: [root@bogon redis-3.0.0]# cd /usr/local [root@bogon lo ...

  4. Ubuntu安装redis并配置远程、密码以及开启php扩展

    一.前言 redis是当前流行的nosql数据库,很多网站都用它来做缓存,今天我们来安装并配置下redis 二.安装并配置redis 1.安装redis sudo apt-get install re ...

  5. centos7.0 安装redis集群

    生产环境下redis基本上都是用的集群,毕竟单机版随时都可能挂掉,风险太大.这里我就来搭建一个基本的redis集群,功能够用但是还需要完善,当然如果有钱可以去阿里云买云数据库Redis版的,那个还是很 ...

  6. windows下与linux下安装redis及redis扩展

    1.        Redis的介绍 Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起 ...

  7. 离线安装redis集群

    Step0:redis集群组件需求 Step1:离线安装ruby Step2:离线安装rubygems Step3:安装rubygems的 redis api Step4:离线安装tcl 8.6 St ...

  8. windows下安装redis以及简单的事例

    1.安装服务端下载地址:http://code.google.com/p/servicestack/wiki/RedisWindowsDownload我下载了一个 redis-2.0.0服务器包,解压 ...

  9. CentOS 安装Redis

    redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括strin ...

随机推荐

  1. android如何取消闹铃

    取消闹钟: Intent intent = new Intent(context, TestReceiver.class); PendingIntent pi = PendingIntent.getB ...

  2. SQLite中的内连接简化技巧

    SQLite中的内连接简化技巧   在SQLite中,通过内连接可以将两个表通过条件表达式关联起来,构成一个新记录集或视图.形式如下:   SELECT ... FROM t1 JOIN t2 ON ...

  3. ACM入门指南

    本文已经转移到了:http://harryguo.me/2015/11/03/ACM-%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97/ 什么是ACM? 想必打开这篇博客的人已 ...

  4. Count Primes -- LeetCodes (primality test)

    Description: Count the number of prime numbers less than a non-negative number, n. 思路:这题第一种思路是写一个is_ ...

  5. 【bzoj1485:】【 [HNOI2009]有趣的数列】模任意数的卡特兰数

    (上不了p站我要死了,侵权度娘背锅) Description 我们称一个长度为2n的数列是有趣的,当且仅当该数列满足以下三个条件: (1)它是从1到2n共2n个整数的一个排列{ai}: (2)所有的奇 ...

  6. MyBatis参数为Integer型并赋值为0时判断失误的问题解决

    mybatis.xml中有if判断条件判断参数不为空时,赋值为0的Integer参数被MyBatis判断为空,因此不执行<if test="param != null and para ...

  7. 开始使用 Docker (Linux 上运行 SQL Server) 上的 SQL Server 容器 - SQL Server | Microsoft Docs

    原文:开始使用 Docker (Linux 上运行 SQL Server) 上的 SQL Server 容器 - SQL Server | Microsoft Docs 快速入门:使用 Docker ...

  8. ostu进行遥感图像的分割

    城市地区道路网的简单的阈值分割.采用的是单ostu(最佳阈值分割)算法,废话少说,如果不太清楚该算法,请参考文献[1]中的图像分割这一章的介绍.程序直接运行的效果如下.

  9. xcode 6 exporting ipa 提示 Your account already has a valid iOS distribution certificate

    在Product - Archive 包过程中,选择Save for Ad hoc Deployment模式[给内部人员测试],export包时,弹出了如下提示 自己遇到时候问题:首先adhoc需要本 ...

  10. Could not find com.android.tools.build:gradle:3.0.0-alpha3

    最近使用Android Studio 3.0 canary 3 时新建项目遇到标题所示错误,后网上找到解决办法.记录如下: 在项目的build.gradle文件中添加如下内容即可解决. reposit ...