Redis 环境安装

安装

如果已经安装了老版本3.0.6

1. 卸载软件
sudo apt-get remove redis-server
2. 清除配置
sudo apt-get remove --purge redis-server
3. 删除残留文件
sudo find / -name redis
一般设置如下
sudo rm -rf var/lib/redis/
sudo rm -rf /var/log/redis
sudo rm -rf /etc/redis/
sudo rm -rf /usr/bin/redis-*

下载地址:http://redis.io/download ,下载最新文档版本,稳定版系列.

  1. 下载安装文件

    wget http://download.redis.io/releases/redis-3.2.3.tar.gz
  2. 解压
    tar -zxvf redis-3.2.3.tar.gz
  3. copy文件并ls查看
    sudo mkdir -p /usr/local/redis/
    sudo cp -r redis-3.2.3/* /usr/local/redis/
    ls /usr/local/redis/
  4. 进入安装目录
    cd /usr/local/redis/
  5. 编译

    首先打开README.md,翻阅基本buildinstall方式。

    sudo make

    尝试环境是否可以正常使用(Hint: It's a good idea to run 'make test' ;)

    sudo make test

    如果出现

    \o/ All tests passed without errors!
  6. 表示redis环境没有问题。

  7. 安装 最后安装路径

    sudo make install
  8. 查看编译好的命令文件

    ls /usr/local/bin/redis-*
    --/usr/local/bin/redis-benchmark 性能测试工具,例如:redis-benchmark -n 1000000 -c 50 , 50个客户端,并发1000000个SETs/GETs查询
    --/usr/local/bin/redis-check-aof 更新日志检查
    --/usr/local/bin/redis-check-dump 本地数据文件检查
    --/usr/local/bin/redis-cli 命令行操作工具
    --/usr/local/bin/redis-server 服务器程序
  9. 修改配置文件
    sudo mkdir /etc/redis
    sudo cp redis.conf /etc/redis/
    ls /etc/redis/redis.conf

    启动redis

$redis-server /etc/redis/redis.conf

出现以下代表启动成功

python@ubuntu:~$ redis-sever /etc/redis/redis.conf
未找到 'redis-sever' 命令,您要输入的是否是:
命令 'redis-server' 来自于包 'redis-server' (universe)
redis-sever:未找到命令
python@ubuntu:~$ redis-server /etc/redis/redis.conf
23003:M 17 Sep 10:52:57.535 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.3 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 23003
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 23003:M 17 Sep 10:52:57.536 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
23003:M 17 Sep 10:52:57.537 # Server started, Redis version 3.2.3
23003:M 17 Sep 10:52:57.537 # 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.
23003:M 17 Sep 10:52:57.537 # 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.
23003:M 17 Sep 10:52:57.537 * The server is now ready to accept connections on port 6379

连接redis服务器

新开一个窗口,或者redis-server后台启动。

通过

$ redis-cli

得到

127.0.0.1:6379>
127.0.0.1:6379> ping
PONG

代表redis服务器已经正常安装并且可以使用了。

Redis之Redis的更多相关文章

  1. Java Spring mvc 操作 Redis 及 Redis 集群

    本文原创,转载请注明:http://www.cnblogs.com/fengzheng/p/5941953.html 关于 Redis 集群搭建可以参考我的另一篇文章 Redis集群搭建与简单使用 R ...

  2. CentOS下安装Redis及Redis的PHP扩展

    1.安装Redis 1.1 如果没有安装wget,安装wget yum install wget 1.2 在http://redis.io/download页面查看redis版本,并下载安装 wget ...

  3. redis/php redis扩展 安装

    作者:silenceper 日期:2013-10-03 原文地址: http://silenceper.com/archives/952.html 我是在CentOS 6.3 中进行的. 使用到的软件 ...

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

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

  5. redis系列-redis的使用场景

    redis越来越受大家欢迎,提升下速度,做下缓存,完成KPI之利器呀.翻译一篇文章<<How to take advantage of Redis just adding it to yo ...

  6. 搭建LNAMP环境(五)- PHP7源码安装Redis和Redis拓展

    上一篇:搭建LNAMP环境(四)- 源码安装PHP7 一.安装Redis 1.创建redis用户组和用户 groupadd redis useradd -r -g redis -s /sbin/nol ...

  7. redis配置文件redis.conf参数说明

    redis配置文件redis.conf参数说明 (2013-01-09 21:20:40)转载▼ 标签: redis配置 redis.conf 配置说明 杂谈 分类: nosql # By defau ...

  8. 【Redis】Redis的基本安装及使用

    在Linux上安装Redis Redis的安装很简单.基本上是下载.解压.运行安装脚本.我用的Redis版本是3.2.1. [nicchagil@localhost app]$ wget -q htt ...

  9. vagrant系列教程(四):vagrant搭建redis与redis的监控程序redis-stat(转)

    上一篇php7环境的搭建 真是火爆,仅仅两天时间,就破了我之前swagger系列的一片文章,看来,大家对搭建环境真是情有独钟. 为了访问量,我今天再来一篇Redis的搭建.当然不能仅仅是redis的搭 ...

  10. [redis] 分布式 Redis 的 CRUD 实现

    1.applicationContext-redis.xml <?xml version="1.0" encoding="UTF-8"?> < ...

随机推荐

  1. A Secure Cookie Protocol 安全cookie协议 配置服务器Cookie

    Title http://www.cse.msu.edu/~alexliu/publications/Cookie/cookie.pdf AbstractCookies are the primary ...

  2. The Model represents your data structures.

    w模型代表数据结构. https://www.codeigniter.com/userguide3/overview/mvc.html http://codeigniter.org.cn/user_g ...

  3. d3.js:数据可视化利器之 修改文档:DOM操作符

    style: CSS样式操作符 style()操作符用来设置或获取选择集中各DOM元素的CSS样式: selection.style(name[,value[,priority]]) style()操 ...

  4. 排序算法review<2>--Shell 排序

    shell排序方法也是一种插入排序算法,于1959年由D.L.Shell提出,其基本方法是:首先将带排序文件分为d1(d1<n)组,将所有彼此之间间隔为d和d的倍数的记录放在一组中,然后在组内进 ...

  5. PDO 指南

    简介 前面咱已经见过MySQLi了,现在咱一起来看看PDO类.PDO是PHP Data Objects的缩写,它被描述为“在PHP中访问数据库的轻量级,兼容性的接口”.尽管它的名字不咋好听,但PDO是 ...

  6. 解决启动Tomcat时遇到INFO: Destroying ProtocolHandler ["ajp-apr-8009"]

    问题描述: 启动Tomcat时,出现INFO: Destroying ProtocolHandler ["ajp-apr-8009"]等信息 这说明端口号被占用了... 解决方法: ...

  7. linux环境下的python安装过程

    一.下载python源码包 打开ubuntu下的shell终端,通过wget命令下载python源码包,如下图所示: wget https://www.python.org/ftp/python/3. ...

  8. 安装CentOS 7 文字版

    下载镜像 http://mirrors.163.com/ CentOS 7.4 http://mirrors.163.com/centos/7.4.1708/isos/x86_64/ 选择 CentO ...

  9. Python 函数的使用小结

    函数的好处:提高代码复用性,简化代码,代码可扩展. 函数只有调用的时候才会被执行. 1.参数: 形参&实参:位置参数,属于必填参数:默认值参数,为非必填参数,没有传值时使用默认值:关键字参数: ...

  10. 爬虫——请求库之requests

    阅读目录 一 介绍 二 基于GET请求 三 基于POST请求 四 响应Response 五 高级用法 一 介绍 #介绍:使用requests可以模拟浏览器的请求,比起之前用到的urllib,reque ...