01.Redis安装

1.安装Redis

1.下载、解压Redis

  1. [[email protected] Redis]$ ll
  2. total 1248
  3. -rwxrwxr-x. 1 lizhiwei lizhiwei 1276198 Sep 20 23:31 redis-2.8.22.tar.gz
  4. [[email protected] Redis]$ tar -zxvf redis-2.8.22.tar.gz

2.安装Redis

  1. [[email protected] Redis]$ ll
  2. total 1252
  3. drwxrwxr-x. 6 lizhiwei lizhiwei 4096 Sep 8 01:03 redis-2.8.22
  4. -rwxrwxr-x. 1 lizhiwei lizhiwei 1276198 Sep 20 23:31 redis-2.8.22.tar.gz
  5. [[email protected] Redis]$ cd redis-2.8.22
  6. [[email protected] redis-2.8.22]$ make PREFIX=/home/lizhiwei/InstallSoft/redis install
  7. cd src && make install
  8. make[1]: Entering directory `/home/lizhiwei/SoftWare/Redis/redis-2.8.22/src‘
  9. Hint: It‘s a good idea to run ‘make test‘ ;)
  10. INSTALL install
  11. INSTALL install
  12. INSTALL install
  13. INSTALL install
  14. INSTALL install
  15. make[1]: Leaving directory `/home/lizhiwei/SoftWare/Redis/redis-2.8.22/src‘
  16. [[email protected] redis-2.8.22]$

默认安装路径:/usr/local/bin,只需要使用命令:make install

指定安装路径:make PREFIX=/some/other/directory install,注意PREFIX大小写不能变!

2.启动Redis服务

1.启动服务端

进入安装路径,可以看到有一个bin目录,进入bin目录,启动Redis服务

  1. [[email protected] bin]$ ll
  2. total 15208
  3. -rwxr-xr-x. 1 lizhiwei lizhiwei 4574611 Oct 1 04:39 redis-benchmark
  4. -rwxr-xr-x. 1 lizhiwei lizhiwei 22201 Oct 1 04:39 redis-check-aof
  5. -rwxr-xr-x. 1 lizhiwei lizhiwei 45411 Oct 1 04:39 redis-check-dump
  6. -rwxr-xr-x. 1 lizhiwei lizhiwei 4676357 Oct 1 04:39 redis-cli
  7. lrwxrwxrwx. 1 lizhiwei lizhiwei 12 Oct 1 04:39 redis-sentinel -> redis-server
  8. -rwxr-xr-x. 1 lizhiwei lizhiwei 6242453 Oct 1 04:39 redis-server
  9. [[email protected] bin]$ ./redis-server
  10. [13745] 01 Oct 04:45:05.889 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
  11. [13745] 01 Oct 04:45:05.890 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
  12. [13745] 01 Oct 04:45:05.890 # Redis can‘t set maximum open files to 10032 because of OS error: Operation not permitted.
  13. [13745] 01 Oct 04:45:05.890 # Current maximum open files is 1024. maxclients has been reduced to 992 to compensate for low ulimit. If you need higher maxclients increase ‘ulimit -n‘.
  14. _._
  15. _.-``__ ‘‘-._
  16. _.-`` `. `_. ‘‘-._ Redis 2.8.22 (00000000/0) 64 bit
  17. .-`` .-```. ```\/ _.,_ ‘‘-._
  18. ( ‘ , .-` | `, ) Running in stand alone mode
  19. |`-._`-...-` __...-.``-._|‘` _.-‘| Port: 6379
  20. | `-._ `._ / _.-‘ | PID: 13745
  21. `-._ `-._ `-./ _.-‘ _.-‘
  22. |`-._`-._ `-.__.-‘ _.-‘_.-‘|
  23. | `-._`-._ _.-‘_.-‘ | http://redis.io
  24. `-._ `-._`-.__.-‘_.-‘ _.-‘
  25. |`-._`-._ `-.__.-‘ _.-‘_.-‘|
  26. | `-._`-._ _.-‘_.-‘ |
  27. `-._ `-._`-.__.-‘_.-‘ _.-‘
  28. `-._ `-.__.-‘ _.-‘
  29. `-._ _.-‘
  30. `-.__.-‘
  31. [13745] 01 Oct 04:45:05.900 # Server started, Redis version 2.8.22
  32. [13745] 01 Oct 04:45:05.900 # 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.
  33. [13745] 01 Oct 04:45:05.901 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
  34. [13745] 01 Oct 04:45:05.901 * The server is now ready to accept connections on port 6379

2.使用客户端连接Redis服务

  1. [[email protected] bin]$ ./redis-cli
  2. 127.0.0.1:6379> ping
  3. PONG
  4. 127.0.0.1:6379> set name lizhiwei
  5. OK
  6. 127.0.0.1:6379> get name
  7. "lizhiwei"
  8. 127.0.0.1:6379>

-------------------------------------------------------------------------------------------------------------------------------

来自为知笔记(Wiz)

时间: 2024-08-09 10:30:47

01.Redis安装的相关文章

01 redis特点及安装使用

一:redis的特点 (1)redis是一个开源,BSD许可高级的key-value存储系统.可以用来存储字符串,哈希结构,链表,集合,因此,常用来提供数据结构服务. 二:redis和memcached相比的独特之处(1)redis可以用来做存储(storge),而memcached是用来做缓存(cache).redis这个特点要因为其“持久化”的功能.(2)redis存储数据有“结构”,对于memcached来说,存储的数据只有一种类型[字符串类型],而redis则可以存字符串,哈希链表,哈希

01 : redis 介绍和安装

Redis简介 Redis是一款开源的,ANSI C语言编写的,高级键值(key-value)缓存和支持永久存储NoSQL数据库产品. Redis采用内存(In-Memory)数据集(DataSet) . 支持多种数据类型. 运行于大多数POSIX系统,如Linux.*BSD.OS X等. 1 . Redis功能介绍 高速读写 数据类型丰富 支持持久化 多种内存分配及回收策略 支持事务 消息队列.消息订阅 支持高可用 支持分布式分片集群 缓存穿透(这个需要了解一下,百度有很多解释) 2 . 企业

[Redis]windows下redis安装

官方的下载地址是: http://redis.io/download 在win64一栏中可以看到redis原本是没有windows版本的,windows版本是Microsoft Open Tech团队开的 给出了一个github的链接地址: https://github.com/MSOpenTech/redis 下载: 在https://github.com/MSOpenTech/redis  页面的右下角有  Download Zip的字样,点击之后就可以下载源码的zip包了. 然后就是解压:

redis安装与使用

Redis是一个基于内存的数据库,其不仅读写速度快,每秒可以执行大约110000的写操作,81000的读取操作,而且其支持存储字符串,哈希结构,链表,集合丰富的数据类型.所以得到很多开发者的青睐.加之其支持主从.持久化等功能,3.0版本开始正式提供分片技术.让其在大型互联网应用中大显身手,本文通过实际操作和理论相配合,对redis进行详细地阐述. 一.redis安装 1.redis的安装与使用 下载直接去redis的官网http://redis.io/进行不同操作系统对应的版本.本文中采用的re

Redis安装及主从复制实战

Redis 是一款开源的,使用C语言编写的.支持网络交互的.可基于内存也可持久化的高性能Key-Value存储系统(cache and store).它通常被称为数据结构服务器,因为值(value)可以是 字符串(String), 哈希(hashes), 列表(list), 集合(sets) 和 有序集合(sorted        sets)等类型. Redis作者谈Redis应用场景:http://blog.nosqlfan.com/html/2235.html 1.redis安装部署:wg

redis 安装和链接

1.redis安装(建议linux下):https://www.cnblogs.com/uncleyong/p/9882843.html参考https://www.cnblogs.com/shawhe/p/9548620.html 2.运行redis 注释配置文件127.0.01  关闭防火墙 测试链接 import redis r = redis.Redis(host='IP',port=6379,password='密码',db=0) # 建立连接 r.set('name','root')

redis安装部署

1.下载安装包 http://download.redis.io/releases/redis-3.2.6.tar.gz http://download.redis.io/releases/ 2.更新现有linux环境 sudo yum –y update; sudo yum -y install telnet curl nmap vim gcc gcc-c++ tcl ruby; 3.安装 1 tar -xvf redis-3.2.6.tar.gz 2 cd redis-3.2.6 3 mak

Windows下redis 安装与PHP使用

http://alfred-long.iteye.com/blog/1684545 一. 安装redis及启用服务 1 下载redis客户端 http://code.google.com/p/servicestack/wiki/RedisWindowsDownload#Download_32bit_Cygwin_builds_for_Windows 2 解压到你所需要的目录中 3 创建redis.conf文件 Redis.conf代码   # Redis configuration file e

Redis安装及简单測试

摘要: Redis是眼下业界很受到欢迎的一个内存数据库,一般用作系统的中间缓存系统,用以提升总体商业系统的吞吐量和响应速度.本文将简要介绍安装的主要过程以及给出一个简要的測试代码. 1.  系统环境和版本号说明 操作系统选用Ubuntu 14.04, Redis的版本号选取眼下的最新稳定版本号2.8.9. client选用了Redis的Java版本号jedis 2.4.2. 2.  Redis的安装步骤 a. 下载Redis的安装包 wget http://download.redis.io/r