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. .net core 启动域名及端口配置

    前两天转载一篇.net core 启动分析,由于发布时候一直纠结在默认5000端口上,所以好好研究了一下. 1.IIS集成 如果通过IIS当宿主的话,那这些都不是事情,强大的IIS可以帮助我们对站点的 ...

  2. 服务端使用Zookeeper注册服务地址,客户端从Zookeeper获取可用的服务地址。

    一个轻量级分布式RPC框架--NettyRpc - 阿凡卢 - 博客园 http://www.cnblogs.com/luxiaoxun/p/5272384.html 这个RPC框架使用的一些技术所解 ...

  3. nodejs(一)

    nodejs第一章节 使用node来实现第一个http服务器 var http = require(‘http’); http.createServer(function (request, resp ...

  4. Python3中的urlencode和urldecode

    在Python3中,将中文进行urlencode编码使用函数 urllib.parse.quote(string, safe='/', encoding=None, errors=None) 而将编码 ...

  5. Guess Your Way Out! II---cf 558D (区间覆盖,c++STL map 的使用)

    题目链接:http://codeforces.com/contest/558/problem/D 题意就是有一个二叉树高度为 h ,人站在根节点上,现在要走出去,出口在叶子节点上,有 q 条信息,每条 ...

  6. nodejs实战《一起学 Node.js》 使用 Express + MongoDB 搭建多人博客

    GitHub: https://github.com/nswbmw/N-blog N-blog 使用 Express + MongoDB 搭建多人博客 开发环境 Node.js: 6.9.1 Mong ...

  7. POJ1269:Intersecting Lines(判断两条直线的关系)

    题目:POJ1269 题意:给你两条直线的坐标,判断两条直线是否共线.平行.相交,若相交,求出交点. 思路:直线相交判断.如果相交求交点. 首先先判断是否共线,之后判断是否平行,如果都不是就直接求交点 ...

  8. vim使用winmanager整合nerd tree和taglist

    winmanager插件安装 • 插件简介 winmanager is a plugin which implements a classical windows type IDE in Vim-6. ...

  9. 我与前端之间不得不说的三天两夜之javaScript

    前端基础之JavaScript   JavaScript概述   JavaScript的历史 1992年Nombas开发出C-minus-minus(C--)的嵌入式脚本语言(最初绑定在CEnvi软件 ...

  10. Python3 计算城市距离

    利用上一篇得到的城市经纬度算城市距离 import requests from math import radians, cos, sin, asin, sqrt def geocode(addres ...