1.安装Redis

1.下载、解压Redis
  1. [wch@localhost Redis]$ ll
  2. total 1248
  3. -rwxrwxr-x.1 wch wch 1276198Sep2023:31 redis-2.8.22.tar.gz
  4. [wch@localhost Redis]$ tar -zxvf redis-2.8.22.tar.gz
2.安装Redis
  1. [wch@localhost Redis]$ ll
  2. total 1252
  3. drwxrwxr-x.6 wch wch 4096Sep801:03 redis-2.8.22
  4. -rwxrwxr-x.1 wch wch 1276198Sep2023:31 redis-2.8.22.tar.gz
  5. [wch@localhost Redis]$ cd redis-2.8.22
  6. [wch@localhost redis-2.8.22]$ make PREFIX=/home/wch/InstallSoft/redis install
  7. cd src && make install
  8. make[1]:Entering directory `/home/wch/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/wch/SoftWare/Redis/redis-2.8.22/src'
  16. [wch@localhost redis-2.8.22]$
默认安装路径:/usr/local/bin,只需要使用命令:make install
指定安装路径:make PREFIX=/some/other/directory install,注意PREFIX大小写不能变!

2.启动Redis服务

1.启动服务端
进入安装路径,可以看到有一个bin目录,进入bin目录,启动Redis服务
  1. [wch@localhost bin]$ ll
  2. total 15208
  3. -rwxr-xr-x.1 wch wch 4574611Oct104:39 redis-benchmark
  4. -rwxr-xr-x.1 wch wch 22201Oct104:39 redis-check-aof
  5. -rwxr-xr-x.1 wch wch 45411Oct104:39 redis-check-dump
  6. -rwxr-xr-x.1 wch wch 4676357Oct104:39 redis-cli
  7. lrwxrwxrwx.1 wch wch 12Oct104:39 redis-sentinel -> redis-server
  8. -rwxr-xr-x.1 wch wch 6242453Oct104:39 redis-server
  9. [wch@localhost bin]$ ./redis-server
  10. [13745]01Oct04: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]01Oct04:45:05.890# You requested maxclients of 10000 requiring at least 10032 max file descriptors.
  12. [13745]01Oct04:45:05.890# Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
  13. [13745]01Oct04: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. _.-```. `_.''-._ Redis2.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]01Oct04:45:05.900# Server started, Redis version 2.8.22
  32. [13745]01Oct04: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]01Oct04: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]01Oct04:45:05.901*The server is now ready to accept connections on port 6379
2.使用客户端连接Redis服务
  1. [wch@localhost bin]$ ./redis-cli
  2. 127.0.0.1:6379> ping
  3. PONG
  4. 127.0.0.1:6379>set name wch
  5. OK
  6. 127.0.0.1:6379> get name
  7. "wch"
  8. 127.0.0.1:6379>
 
-------------------------------------------------------------------------------------------------------------------------------

01.Redis安装的更多相关文章

  1. Redis安装以及配置

    下载 http://redis.io/download 解压 tar zxvf redis-2.8.17.tar.gz 编译并安装 1 2 3 4 cd redis-2.8.17 make cd sr ...

  2. 01 redis特点及安装使用

    一:redis的特点 ()redis是一个开源,BSD许可高级的key-value存储系统.可以用来存储字符串,哈希结构,链表,集合,因此,常用来提供数据结构服务. 二:redis和memcached ...

  3. windows下和linux下 Redis 安装

    Redis 是一个高性能的key-value数据库, 使用内存作为主存储,数据访问速度非常快,当然它也提供了两种机制支持数据持久化存储.比较遗憾的是,Redis项目不直接支持Windows,Windo ...

  4. redis安装方法

    redis安装方法1.通过lnmp一键安装包,然后执行./addons.sh install redis2.yum -y install redis3.wget http://redis.google ...

  5. linux上redis安装配置及其防漏洞配置及其攻击方法

    Linux上redis安装: 需先在服务器上安装yum(虚拟机可使用挂载的方式安装) 安装配置所需要的环境运行指令:  yum -y install gcc 进入解压文件执行make 指令进行编译 执 ...

  6. redis安装、测试&集群的搭建&踩过的坑

    1 redis的安装 1.1   安装redis 版本说明 本教程使用redis3.0版本.3.0版本主要增加了redis集群功能. 安装的前提条件: 需要安装gcc:yum install gcc- ...

  7. Redis安装步骤 - linux系统下

    https://blog.csdn.net/lzj3462144/article/details/70973368 https://www.cnblogs.com/pyyu/p/9467279.htm ...

  8. redis安装及应用

    Redis安装及主从配置 server2,3,4. 安装 tar zxf redis-4.0.1.tar.gz cd redis-4.0.1 yum install -y gcc make make ...

  9. centos7.x下环境搭建(四)—redis安装

    redis介绍 redis是用C语言开发的一个开源的高性能键值对(key-value)数据库.它通过提供多种键值数据类型来适应不同场景下的存储需求,目前为止redis支持的键值数据类型如下字符串.列表 ...

随机推荐

  1. webservice简介以及简单使用

    本文主要是简单的介绍webservice是什么.webservice的由来.webservice的作用,以及后面会介绍webservice的使用. webservice是什么? 目前,Web serv ...

  2. mongodb基础用法

    安装部分 mongodb配置方法 mongodb的安装目录 C:\MongoDB\Server\3.2\bin 创建以下目录 c:\mongo\log c:\mongo\db 创建mongodb的配置 ...

  3. cassandra 之 jdbc 使用【java、scala】

    1.数据库创建 参考接上文cassandra入门 http://www.cnblogs.com/piaolingzxh/p/4197833.html 2.下载jdbc驱动源码,构建jar包 源码下载地 ...

  4. php使用base64加密解密图片

    php使用base64加密解密图片的实例代码. 例子: <?php //文件名:base64.php $data="/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAB ...

  5. mybatis使用笔记

    关于动态SQL里的条件查询(if test): 1.lombok插件和mybatis插件在有些变量名下会冲突,比如一个变量为rType的字段,lombok插件认为应该是getRType,但是mybat ...

  6. 代码重启SQL命令

    1.net stop mssqlserver --停止mssqlserver 2.net start mssqlserver  --开始mssqlserver

  7. CentOS 7上的redis搭建

    http://www.cnblogs.com/shanyou/archive/2012/07/14/2591881.html

  8. 下一代NoSQL:最终一致性的末日

    相比关系型数据库,NoSQL解决方案提供了shared-nothing.容错和可扩展的分布式架构等特性,同时也放弃了关系型数据库的强数据一致性和隔离性,美其名曰:"最终一致性". ...

  9. Java 第二天

    1.不带访问修饰符号的类成员变量默认是friendly(可以同一个包中访问) 2.protected的类成员可以在同一个包及其子类中访问 3.方法中可以定义内部类(如下面的代码),该类只能访问方法中的 ...

  10. Eclipse 4.6 Neon, could not create the java virtual machine

    下了eclipse 4.6,打开报错:could not create the java virtual machine. a fatal exception has occurred. 命令行用 e ...