1.首先对于这种nosql来说目前我用到的功能很少,所以感觉没有必要去优化他跟不需要去编译安装。今天来介绍下一个yum安装redis

步骤1:安装扩展yum库

[root@localhost ~]# yum install epel-release
##在查看下yum源中是否有redis
[root@localhost ~]# yum search redis
[root@localhost ~]# yum -y install redis
##ok安装完成!

启动:

##CentOS7
[root@localhost ~]# systemctl start redis.service
##CentOS7以下
[root@localhost ~]# service redis start
##查看启动:
[root@localhost ~]# ps -ef | grep redis
redis 12683 1 0 23:19 ? 00:00:00 /usr/bin/redis-server 127.0.0.1:6379
root 12696 12454 0 23:20 pts/2 00:00:00 grep --color=auto redis

客户端连接:

[root@localhost ~]# redis-cli
127.0.0.1:>
127.0.0.1:> keys *
(empty list or set)
127.0.0.1:> set a
OK
127.0.0.1:> get a
""
127.0.0.1:> keys *
) "a"
127.0.0.1:> del a
(integer) 1
127.0.0.1:6379> keys *
(empty list or set)

开机自启动:两种方式

方法1: 启动命令写入 /etc/rc.d/rc.local 文件里面

[root@localhost ~]# echo 'systemctl start redis.service' >> /etc/rc.d/rc.local
[root@localhost ~]# cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local
memcached -u memcached -p -m -c &
systemctl start redis.service

方法2:加入系统服务 :我这里用yum安装本身就是加入了系统服务了只需要设置开机自启动就可以:

[root@localhost ~]# systemctl enable redis.service

[nosql之redis]yum安装redis的更多相关文章

  1. centos7 yum安装redis(转)

    正如我们所知的那样,Redis是一个开源的.基于BSD许可证的,基于内存的.键值存储NoSQL数据库.Redis经常被视为一个数据结构服务器,因为Redis支持字符串strings.哈希hashes. ...

  2. 在centos6.3用yum安装redis

    一.centos默认的安装源在官方centos.org上,而redis在第三方的yum源里,所以无法安装,非官方的yum推荐用fedora的epel仓库.当然也可通过配置 /etc/yum.repos ...

  3. 【Redis】yum安装redis

    1.yum直接安装就可以 yum install redis 2.Redis开启远程登录连接 redis默认只能localhost访问 .配置防火墙 开放端口6379 .在redis的配置文件/etc ...

  4. centos6.7用yum安装redis解决办法及IP限制配置

    在centos6.7用yum安装redis解决办法 - bluesky1 - 博客园 http://www.cnblogs.com/lanblogs/p/6104834.html yum instal ...

  5. [从零开始搭网站八]CentOS使用yum安装Redis的方法

    1.由于centOS官方yum源里面没有Redis,这里我们需要安装一个第三方的yum源,这里用了fedora的epel仓库 yum install epel-release 安装过程中会有让你确认的 ...

  6. CentOS yum安装redis(转)

    1.安装redis yum install redis 2.安装php-redis扩展 yum install php-redis 3.启动redis,并设定开机自动启动 service redis ...

  7. centos6.3下yum安装redis

    我得是centos 6.3,如果直接用yum安装redis,报错,如下: [root@CentOS6 etc]# yum install redis Loaded plugins: fastestmi ...

  8. yum 安装 redis php-redis

    yum 安装 redis php-redis   redis和php-redis在官方源上是没有的,需要安装其他的源,其他源的地址为 http://mirrors.ustc.edu.cn/fedora ...

  9. centos7下使用yum安装redis

    centos7下使用yum安装Redis 第一步:安装 yum –y install redis 第二步:启动 systemctl start redis.service 第三步:设置开机启动 sys ...

随机推荐

  1. 4412开发板学习笔记-NFS服务器的搭建

    转自iTOP-4412讨论群: http://www.topeetboard.com 先来介绍一下NFS: NFS 是Network File System的缩写,即网络文件系统.一种使用于分散式文件 ...

  2. gdb脚本

    一.简介 作为UNIX/Linux下使用广泛的调试器,gdb不仅提供了丰富的命令,还引入了对脚本的支持:一种是对已存在的脚本语言支持,比如python,用户可以直接书写python脚本,由gdb调用p ...

  3. WPF系列 自定控件

    引言 WPF中微软提供了一些基本的控件,但是工作中这些基础的控件往往不能满足我们的需求,这个时候我们就需要根据实际的需求去开发自己的控件,但要注意不是所有功能不满足的情况都需要通过自定义控件来实现.实 ...

  4. Neutron 理解(10):虚拟专用网(VPN)虚拟化 [How Neutron implements VPN Virtualization]

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  5. CF731C. Socks[DFS 贪心]

    C. Socks time limit per test 2 seconds memory limit per test 256 megabytes input standard input outp ...

  6. UVA 11859 Division Game[Nim游戏]

    题意:给定一个N*M的矩阵,每次可以选择同一行中的若干个数,把它们变成它们的质因子.问说先手的可否获胜. 同一行相当于1堆,数量就是所有数的质因子个数之和 #include <iostream& ...

  7. Winform布局方式

    一.默认布局 ★可以加panel,也可以不加: ★通过鼠标拖动控件的方式,根据自己的想法布局.拖动控件的过程中,会有对齐的线,方便操作: ★也可选中要布局的控件,在工具栏中有对齐工具可供选择,也有调整 ...

  8. MVC之前的那点事儿系列(8):UrlRouting的理解

    文章内容 根据对Http Runtime和Http Pipeline的分析,我们知道一个ASP.NET应用程序可以有多个HttpModuel,但是只能有一个HttpHandler,并且通过这个Http ...

  9. .NET和JAVA同等加密方法,MD5和DES对称加密记录

    C#版: using System; using System.Security.Cryptography; using System.Text; namespace ConsoleApplicati ...

  10. 传说中的inside番——“黄金圣衣”篇

    10月21日,在今天的课堂上拿到了我们软工实践课程的战斗圣衣,传说穿上它就能够在编码意志上+100,有着爆种.不死不休战斗等传奇属性——build to win.当然,这是我的追求与梦想.现在的我,还 ...