[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 ...
随机推荐
- python 多线程实例
#!/usr/bin/env python # -*- coding:utf-8 -*- import Queue import threading class ThreadPool(object): ...
- Linux yum如何下载rpm包到本地
下载前先安装一个小插件 [root@wang yum.repos.d]# yum install -y yum-plugin-downloadonly 安装一个包的同时 加上 yum install ...
- 记SQL SERVER一次诡异的优化
最近做的项目快上线了,在做了一次压力测试后发现了不少问题,基本都是因为数据量达到一定级别时(预测系统上线10年后的数据量)SQL查询超时,其中有些是因为索引缺失.有些是因为写法不好,这些在有经验的人眼 ...
- Android 第一行代码
::-/stuapplication.pla.edu.cn.fragmentbestpractice W/dalvikvm﹕ VFY: unable to find class referenced ...
- 【第一篇献给markdown】markdown入门
Markdown 是一种轻量级的「标记语言」,语法十分简单,常用的标记符号也不超过十个.虽然功能很强大,但是上手估计不用十分钟. 一些认识 Markdown 官方文档 这里可以看到官方的 Markdo ...
- SPOJ GSS1 Can you answer these queries I[线段树]
Description You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A q ...
- c++ const函数是什么意思
c++ const函数是什么意思 只读类型 const修饰在类的成员函数的尾部,表示这个函数不会修改类的成员.相当于this指针是const的.
- selenium自动化-java-IE启动
这是一个方法,直接在main调用就可以 private static void ie() { WebDriver Driver; // ie启动成功,files是启动ie驱动 ...
- MySql 存储过程、触发器和权限问题
存储过程 1.1 什么是存储过程 存储过程,带有逻辑的sql语句 之前的sql没有条件判断,没有循环 存储过程带上流程控制语句(if while) 1.2 存储过程特点 1)执行效率非常快!存储过程 ...
- iOS widget开发
链接: iOS Widget开发 iOS开发之构建Widget iOS开发Widget iOS开发-widget基础 ios8新特性widget开发 ios 10 开发-widget实现 Widget ...