[nosql之redis]yum安装redis
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的更多相关文章
- centos7 yum安装redis(转)
正如我们所知的那样,Redis是一个开源的.基于BSD许可证的,基于内存的.键值存储NoSQL数据库.Redis经常被视为一个数据结构服务器,因为Redis支持字符串strings.哈希hashes. ...
- 在centos6.3用yum安装redis
一.centos默认的安装源在官方centos.org上,而redis在第三方的yum源里,所以无法安装,非官方的yum推荐用fedora的epel仓库.当然也可通过配置 /etc/yum.repos ...
- 【Redis】yum安装redis
1.yum直接安装就可以 yum install redis 2.Redis开启远程登录连接 redis默认只能localhost访问 .配置防火墙 开放端口6379 .在redis的配置文件/etc ...
- centos6.7用yum安装redis解决办法及IP限制配置
在centos6.7用yum安装redis解决办法 - bluesky1 - 博客园 http://www.cnblogs.com/lanblogs/p/6104834.html yum instal ...
- [从零开始搭网站八]CentOS使用yum安装Redis的方法
1.由于centOS官方yum源里面没有Redis,这里我们需要安装一个第三方的yum源,这里用了fedora的epel仓库 yum install epel-release 安装过程中会有让你确认的 ...
- CentOS yum安装redis(转)
1.安装redis yum install redis 2.安装php-redis扩展 yum install php-redis 3.启动redis,并设定开机自动启动 service redis ...
- centos6.3下yum安装redis
我得是centos 6.3,如果直接用yum安装redis,报错,如下: [root@CentOS6 etc]# yum install redis Loaded plugins: fastestmi ...
- yum 安装 redis php-redis
yum 安装 redis php-redis redis和php-redis在官方源上是没有的,需要安装其他的源,其他源的地址为 http://mirrors.ustc.edu.cn/fedora ...
- centos7下使用yum安装redis
centos7下使用yum安装Redis 第一步:安装 yum –y install redis 第二步:启动 systemctl start redis.service 第三步:设置开机启动 sys ...
随机推荐
- C#按位操作,直接操作INT数据类型的某一位
/// <summary> /// 根据Int类型的值,返回用1或0(对应True或Flase)填充的数组 /// <remarks>从右侧开始向左索引(0~31)</r ...
- Markdown:让书写更美好
http://www.jianshu.com/p/17fdcf17bbb4 http://sdutlinux.org/t/218 文档整体解决方案 在自己的服务器上安装GitBook markdo ...
- css div中内容绝对居中(多行内容)
div中的内容绝对居中(不适合IE6哦,IE6我已经不考虑了),直接看代码吧. <!DOCTYPE HTML> <html> <head> <title> ...
- RubyMine优化设置
RubyMine和IntelliJ默认的JVM -xmx参数太低了,占用的内存满了一GC,程序就假死了,把-xmx改大点就不容易假死了,配合SSD效果更好. [RUBYMINE_DIRECTORY]/ ...
- Xamarin Error cannot find ‘aapt.exe’
Problem: solution: A workaround is to copy your files to the old directory. Just copy the aapt ...
- Windows Live Writer测试
第一次使用Windows Live Writer,一堆问题,不知道是中国强大的局域网防火墙问题还是咋的,弄了半天. 1.C++的测试代码: int _tmain(int argc, _TCHAR* a ...
- 树莓派搭建ActiveMQ
树莓派上安装ActiveMQ和在其它Linux发行版基本相同,只是在开防火墙端口时有区别. 硬件信息: 树莓派3B型,Raspbian系统 安装 //下载ActiveMQ安装包 http:// ...
- DFA 最小化
NDFA.εNDFA 确定化的细节这里就不总结了,这里说一说DFA最小化的算法. 关于DFA最小化,
- [No000086]C#foreach集合被改变,报错处理方案
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; ...
- python基础之循环结构以及列表
python基础之编译器选择,循环结构,列表 本节内容 python IDE的选择 字符串的格式化输出 数据类型 循环结构 列表 简单购物车的编写 1.python IDE的选择 IDE的全称叫做集成 ...