[nosql之redis]yum安装redis
2016-08-24 23:30
399 查看
1.首先对于这种nosql来说目前我用到的功能很少,所以感觉没有必要去优化他跟不需要去编译安装。今天来介绍下一个yum安装redis
步骤1:安装扩展yum库
启动:
客户端连接:
开机自启动:两种方式
方法1: 启动命令写入 /etc/rc.d/rc.local 文件里面
方法2:加入系统服务 :我这里用yum安装本身就是加入了系统服务了只需要设置开机自启动就可以:
步骤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:6379> 127.0.0.1:6379> keys * (empty list or set) 127.0.0.1:6379> set a 1 OK 127.0.0.1:6379> get a "1" 127.0.0.1:6379> keys * 1) "a" 127.0.0.1:6379> 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 11211 -m 64 -c 512 & systemctl start redis.service
方法2:加入系统服务 :我这里用yum安装本身就是加入了系统服务了只需要设置开机自启动就可以:
[root@localhost ~]# systemctl enable redis.service
相关文章推荐
- 高性能NOSQL数据库redis结合谷歌开源tcmalloc库的安装笔记
- NoSQL数据库之Redis的介绍及安装
- 在centos6.3用yum安装redis
- (转)NoSQL——Redis在win7下安装配置的学习一
- NoSQL初探之人人都爱Redis:(1)Redis简介与简单安装
- 利用yum安装Redis的方法详解
- NoSQL和Redis简介及Redis在Windows下的安装和使用教程
- NoSQL之【Redis】学习(一):安装说明
- redis的yum和编译安装的对比(简单明了,清晰可见)
- Linux 下安装nosql¬-redis数据库安装
- NoSQL——Redis在win7下安装配置的学习一
- yum 安装 redis php-redis
- 在centos6.4用yum安装redis
- NoSQL之Redis的介绍与安装
- NoSQL-redis第一课之介绍和安装
- NoSQL之【Redis】学习(一):安装说明
- centos 下安装redis和python以及python-redis-nosql
- 笔记:在CentOS 5.8中通过yum安装Redis
- NoSQL之Redis - CentOS 6.5安装测试