1.1. Redis下载安装(linux)

1.1.1. 下载:

下载地址:https://redis.io/download

选择合适的版本下载,如下图:

1.1.2. 安装:

(1)把下载好的redis安装包上传到要安装的服务器上

(2)解压:

[root@desktop-blv0c82 opt]# tar -zxvf redis-4.0.11.tar.gz

(3)对redis解压后的文件进行编译:

[root@desktop-blv0c82 opt]# cd redis-4.0.11

[root@desktop-blv0c82 redis-4.0.11]# ls

[root@desktop-blv0c82 redis-4.0.11]# make

注意此步可能会出现的问题:

---><1>如果时间错误

需要把服务器的时间修改正确即可

---><2>提示:...Hint: It's a good idea to run 'make test' ;)

[root@desktop-blv0c82 redis-4.0.11]# make test

有报错提示:

......

You need tcl 8.5 or newer in order to run the Redis test

make[1]: *** [test] Error 1

安装tcl:

[root@desktop-blv0c82 redis-4.0.11]# yum install tcl

(根据提示安装成功)

再make test一下:

[root@desktop-blv0c82 redis-4.0.11]# make test

(等待测试通过)

(4)安装:(安装到指定目录)

[root@desktop-blv0c82 redis-4.0.11]# make PREFIX=/usr/local/redis install

(5)查看安装目录下的文件:

[root@desktop-blv0c82 redis-4.0.11]# cd /usr/local/redis/

[root@desktop-blv0c82 redis]# ls

bin

[root@desktop-blv0c82 redis]# cd bin/

[root@desktop-blv0c82 bin]# ls

redis-benchmark  redis-check-rdb  redis-sentinel

redis-check-aof  redis-cli        redis-server

注:

redis-benchmark  #redis性能测试工具

redis-check-rdb   #检查rdb日志的工具

redis-sentinel

redis-check-aof   #检查aof日志的工具(比如断电造成日志损坏,可以检测并修复)

redis-cli         #连接用的客户端

redis-server      #redis服务进程

(6)把解压目录中的redis.cnf文件拷贝到安装目录redis中一份:

[root@desktop-blv0c82 bin]# cd ..

[root@desktop-blv0c82 redis]# cp /opt/redis-4.0.11/redis.conf ./

[root@desktop-blv0c82 redis]# ls

bin  redis.conf

(7)启动redis服务:

[root@desktop-blv0c82 redis]# ./bin/redis-server ./redis.conf

(以当前目录下的bin下的server服务;用当前目录下的配置文件(redis.conf))

启动成功如下图:

注:这个终端被占用了,不能关闭(关闭后就会自动退出)

(8)再打开一个终端窗口,连接客户端:

[root@desktop-blv0c82 redis-4.0.11]# cd /usr/local/redis/

[root@desktop-blv0c82 redis]# ./bin/redis-cli

127.0.0.1:6379>

#连接成功如下:

例:

127.0.0.1:6379> set site www.baidu.com

OK

127.0.0.1:6379> get site

"www.baidu.com"

127.0.0.1:6379>

(9)设置redis-server在后台运行:(让redis以后台进程的形式运行)

---<1>关闭(即出:ctrl+c)redis-server服务

---<2>修改redis安装目录(如:/usr/local/redis)下的redis.conf配置文件:

[root@desktop-blv0c82 redis]# vim redis.conf

找到: daemonize no

修改为:daemonize yes

保存退出

(10)再次启动redis-server服务,就可以看到redis在后台运行:

[root@desktop-blv0c82 redis]# ./bin/redis-server ./redis.conf

8846:C 14 Nov 23:20:51.920 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

8846:C 14 Nov 23:20:51.920 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=8846, just started

8846:C 14 Nov 23:20:51.920 # Configuration loaded

[root@desktop-blv0c82 redis]# ps aux|grep redis|grep -v grep

root      8847  0.1  0.7 145312  7592 ?        Ssl  23:20   0:00 ./bin/redis-server 127.0.0.1:6379

(11)连接客户端:

[root@desktop-blv0c82 redis]# ./bin/redis-cli

127.0.0.1:6379>

centos7下安装配置redis的更多相关文章

  1. Linux centos7下安装配置redis及Redis desktop Manager工具连接注意事项

    基本工具:VMware12.CentOS-7-x86_64-Everything-1611.iso.redis-desktop-manager-0.8.0.3841 废话不多说,首先,关于什么是Red ...

  2. Centos7下安装配置Redsocks

    Redsocks是一个开源的网络程序,代码依赖开源的libevent网络库.Redsocks允许你将所有TCP连接重定向到SOCKS或HTTPS代理,比如Shadowsocks(Centos7下安装配 ...

  3. centos7 yum安装配置redis 并设置密码

    原文:https://www.cnblogs.com/fanlinglong/p/6635828.html centos7 yum安装配置redis 并设置密码 1.设置Redis的仓库地址 yum ...

  4. linux下安装 配置 redis数据库

    通过终端命令安装(推荐): 1 确保更新源服务器能正常使用 如果没有更换更新源服务器,那么可能一直都下不了软件.欢迎参考我之前的博文来更换成国内的镜像服务器http://www.cnblogs.com ...

  5. Centos7 下安装配置tomcat7

    首先下载压缩包 wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7. ...

  6. centos下安装&&配置redis

    一.Redis介绍 Redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcache类似,但很大程度补偿了Memcache的不足,它支持存储的value类型相对更多 ...

  7. centos7下安装配置redis3.0.4

    安装redis 1.进入redis官网(redis.io)下载redis稳定版安装包,目前稳定版本为3.0.4 2.在linux  /usr文件夹下新建redis文件夹,拷贝安装包redis-3.0. ...

  8. Ubuntu下安装配置redis

    安装redis apt-get install redis-server 查看是否启动 ps -aux|grep redis 客户端连接 注: 安装Redis服务器,会自动地一起安装Redis命令行客 ...

  9. CentOS7 yum安装配置 +redis主从配置

    一.安装必要包 yum install gcc 二.linux下安装 #下载 wget http://download.redis.io/releases/redis-3.0.0.tar.gz tar ...

随机推荐

  1. 一脸懵逼学习HBase的搭建(注意HBase的版本)

    1:Hdfs分布式文件系统存的文件,文件存储. 2:Hbase是存储的数据,海量数据存储,作用是缓存的数据,将缓存的数据满后写入到Hdfs中. 3:hbase集群中的角色: ().一个或者多个主节点, ...

  2. mysql如何添加一个表的外键

    1:创建一个父表,主键作为子表的外键: create table province( pId int primary key auto_increment, pName varchar() ); 2: ...

  3. [转] mongoose学习笔记(超详细)

    名词解释 Schema: 一种以文件形式存储的数据库模型骨架,不具备数据库的操作能力 Model: 由Schema编译而成的假想(fancy)构造器,具有抽象属性和行为.Model的每一个实例(ins ...

  4. [转] Node.js使用MongoDB3.4+Access control is not enabled for the database解决方案

    今天使用MongoDB时遇到了一些问题 建立数据库连接时出现了warnings 出现这个警告的原因是新版本的MongDB为了让我们创建一个安全的数据库 必须要进行验证 后来在外网找到了答案 解决方案如 ...

  5. 关于文件I/o的原子操作

    [摘自<Linux/Unix系统编程手册>] 所有系统调用都是以原子操作方式执行的.这里是指内核保证了某系统调用中的所有步骤会作为独立操作而一次性执行,其间不会为其它进程或线程所中断. 原 ...

  6. alpha冲刺1/10

    目录 摘要 团队部分 个人部分 摘要 队名:小白吃 组长博客:hjj 作业博客:来自双十一的爱 团队部分 后敬甲(组长) 过去两天完成了哪些任务 文字描述 Alpha版本的任务细分安排 leangoo ...

  7. .net core2.1 - ef core数据库迁移,初始化种子数据

    起因:早上偶然看见一篇文章说是ef core(2.x)使用种子数据,主表子表迁移时候,正常情况下说是无法迁移成功,索性就试试,结果是和ef6的一样,没感觉有什么大的区别.一切OK,见下面内容. 1.首 ...

  8. day8.登陆注册简单实现

    username = input('请输入注册的用户名:') password = input('请输入注册名的密码:') with open('list_of_info',mode='w',enco ...

  9. Codeforces Gym100783H 最短路 其他

    原文链接https://www.cnblogs.com/zhouzhendong/p/CF-Gym100783H.html 题目传送门 - CF-Gym100783H 题意 给定一个 $n$ 个节点 ...

  10. TF之RNN:TF的RNN中的常用的两种定义scope的方式get_variable和Variable—Jason niu

    # tensorflow中的两种定义scope(命名变量)的方式tf.get_variable和tf.Variable.Tensorflow当中有两种途径生成变量 variable import te ...