下载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. bzoj 3462: DZY Loves Math II

    3462: DZY Loves Math II Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 211  Solved: 103[Submit][Sta ...

  2. Java中使用HttpRequest调用RESTfull的DELETE方法接口提示:How to fix HTTP method DELETE doesn't support output

    说明:无论是Spring框架还是Spring Boot的Feign形式的客户端,以下的解决方法都适用. 解决方法:直接升级JDK 1.8,这个问题是1.7的BUG. 参考: https://sales ...

  3. c# 中文字符(全角、半角)通用处理

    声明:本文仅提供一种编程思路,所提供代码仅供参考,如需使用,请自行完善. 我们在做程序的的时候经常要处理用户输入,作为我们的主要语言中文,经常会出现全角.半角的问题,这会在查询时给我们带来很多麻烦.本 ...

  4. Vue.js 2.0源码解析之前端渲染篇

    一.前言 Vue.js框架是目前比较火的MVVM框架之一,简单易上手的学习曲线,友好的官方文档,配套的构建工具,让Vue.js在2016大放异彩,大有赶超React之势.前不久Vue.js 2.0正式 ...

  5. springMVC初探视图解析器——ResourceBundleViewResolver

    视图解析器ResourceBundleViewResolver是根据proterties文件来找对应的视图来解析”逻辑视图“的, 该properties文件默认是放在classpath路径下的view ...

  6. NSPredicate谓词查询

    Cocoa提供了一个类NSPredicate类,该类主要用于指定过滤器的条件,该对象可以准确的描述所需条件,对每个对象通过谓词进行筛选,判断是否与条件相匹配.谓词表示计算真值或假值的函数. NSPre ...

  7. WCF IIS上部署服务

    一.选择应用程序池:.Net Framework 4.0集成模式 二.IIS Access is denied:程序所在文件夹给予Everyone权限 三.HTTP 错误 500.21 - Inter ...

  8. JAVA常见算法题(二十二)

    package com.xiaowu.demo; //利用递归方法求5!. public class Demo22 { public static void main(String[] args) { ...

  9. 遨游maxthon打开页面一片黑色,百度地图等黑屏解决办法

    遨游maxthon使用webkit极速核心,打开百度地图等页面一片黑色,黑屏了. 找了好久,不知道什么问题. 版本一样,都是4.4.xxx版本.另外一台机器又正常. 后来上傲游社区,好多人也有这个问题 ...

  10. Linux使用nginx部署Laravel

    问题描述 Laravel是PHP下当今最受欢迎的web应用开发框架,github上start数远超第二名Symfony,以前我用这个框架做项目的时候通常就是扔到apache里面,然后配置.htacce ...