How to install redis server on CentOS 7 / RHEL 7
在本教程中,我们将学习如何在CentOS 7 / RHEL 7上安装Redis服务器。 redis的缩写是REmote DIctionary Server。
它是最流行的开源,高级键值缓存和存储之一。
reids的官方网站地址: http://redis.io/
如果你的服务器没有安装wget下载程序的话,需要先安装wget,
Install wget command:
yum install wget
Install redis server
Now use yum command to install redis server
yum install redis
Two important redis server configuration file’s path1. /etc/redis.conf
2. /etc/redis-sentinel.conf
Now start the redis server after this.
systemctl start redis.service
Check the running status of redis server
systemctl status redis.service
To test the installation of Redis, use below given command
If the response output is PONG, it means installation is completed successfully.
[root@localhost ~]# redis-cli ping
PONG
[root@localhost ~]#
Start/Stop/Restart/Status and Enable redis server
To start redis server
systemctl start redis.service
To stop redis server
systemctl stop redis.service
To restart redis server
systemctl restart redis.service
To get running status of redis server
systemctl status redis.service
To enable redis server at system’s booting time.
systemctl enable redis.service
To disable redis server at system’s booting time.
systemctl disable redis.service
查看redis是否启动:
reids-server

打开redis终端:
redis-cli

首次在php中使用redis时,我遇到了class 'Redis' not found的错误,
$redis = new Redis();
最后再网上发现需要再Redis前面加上\,
$redis = new \Redis();
访问远程Redis服务。Connect to Remote Redis Server
使用客户端远程连接redis
通常来说,生产环境下的Redis服务器只设置为仅本机访问(Redis默认也只允许本机访问)。有时候我们也许需要使Redi能被远程访问。
配置
修改Redis配置文件/etc/redis/redis.conf,找到bind那行配置:
# bind 127.0.0.1
去掉#注释并改为:
bind 0.0.0.0
指定配置文件然后重启Redis服务即可:
sudo redis-server /etc/redis/redis.conf
关于bind配置的含义,配置文件里的注释是这样说的:
# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# interfaces using the "bind" configuration directive, followed by one or
# more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1
远程连接
配置好Redis服务并重启服务后。就可以使用客户端远程连接Redis服务了。命令格式如下:
$ redis-cli -h {redis_host} -p {redis_port}
其中{redis_host}就是远程的Redis服务所在服务器地址,{redis_port}就是Redis服务端口(Redis默认端口是6379)。例如:
$ redis-cli -h 120.120.10.10 -p
redis>ping
PONG

How to install redis server on CentOS 7 / RHEL 7的更多相关文章
- Install RabbitMQ server in CentOS 7
About RabbitMQ RabbitMQ is an open source message broker software, also sometimes known as message-o ...
- Official online document, install svn server in centOS
http://www.krizna.com/centos/install-svn-server-on-centos-6/
- Install Jetty web server on CentOS 7 / RHEL 7
http://www.eclipse.org/jetty/download.html http://www.eclipse.org/jetty/documentation/current/startu ...
- Install Tomcat 6 on CentOS or RHEL --转载
source:http://www.davidghedini.com/pg/entry/install_tomcat_6_on_centos This post will cover installa ...
- Install EPEL repo on CentOS 7 / RHEL 7
On CentOS 7, we have found without downloading the epel-release RPM package(as we used to do on prev ...
- 虚拟机centOS中安装Redis,主机Redis Destop Manager不能访问虚拟机Redis server的解决方案
今天在学些redis的时候碰到个问题,发现主机Redis Destop Manager不能访问虚拟机Redis server的解决方案,找了一些网上的资料,原因可能有两个,整理记录下来: 1. Red ...
- How to install Redis 3.2 on CentOS 6 and 7
What is Redis? Redis is a flexible open-source, key value data store, used as a database, cache and ...
- Install Redis on CentOS 6.4--转
Install Redis on CentOS 6.4 source:http://thoughts.z-dev.org/2013/05/27/install-redis-on-centos-6-4/ ...
- Install TightVNC Server in RHEL/CentOS and Fedora to Access Remote Desktops
Virtual Networking Computing (VNC) is a Kind of remote sharing system that makes it possible to take ...
随机推荐
- 移动端rem单位和px单位换算
rem单位是根据html元素的单位在页面根据不同的手机屏幕分辨率动态整体的按比例缩小或放大字体. 假如html{font-size: 14px;},那么1rem=14px; 一个div宽度48px,那 ...
- 浅谈BFC与高度塌陷
这个概念我大概是去年时候接触到的吧,略略记录了一下,没有深入研究,恰逢最近秋招,在这里写一写,顺便加深自己的印象. 什么是BFC? 页面中的元素都隐含一个属性Block Formatting Cont ...
- Ubuntu 修改host并重启网络
Ubuntu系统的Hosts只需修改/etc/hosts文件,在目录中还有一个hosts.conf文件,刚开始还以为只需要修改这个就可以了,结果发现是需要修改hosts.修改完之后要重启网络.具体过程 ...
- JavaScript_9_循环
1. JavaScript for/in 语句循环遍历对象的属性: 可以遍历数组,也可以遍历一个对象的所有属性 <body> <p>点击按钮,循环遍历对象“person”的属性 ...
- windows网络和共享中心“查看基本网络信息并设置连接”为“未知”的解决方案
存在问题“查看基本网络信息并设置连接”为“未知”.如图所示: 解决步骤 运行services.msc 启动Network List Service 若无法启动,打开其属性,选择“登录”选项卡,将启动类 ...
- BCB:Windows消息处理
Windows消息处理 BCB 本文研究了BCB中的消息处理机制,在此基础上提出了处理Windows消息和自定义消息响应的方法和建立动态和静态消息映射的技巧. C++ Builder作为一种RAD方式 ...
- 《队长说得队》【Alpha】Scrum meeting 1
项目 内容 这个作业属于哪个课程 >>2016级计算机科学与工程学院软件工程(西北师范大学) 这个作业的要求在哪里 >>实验十二 团队作业8:软件测试与ALPHA冲刺 团队名称 ...
- tomcat - 自带日志的区分
在tomcat 中,logs文件夹下会存放着一些tomcat自带的日志文件,其中有三种文件: 1 > localhost_access_log.2017-12-28 文件,它用来记录tomcat ...
- Spring3中好用的工具类收集
1) 请求工具类 org.springframework.web.bind.ServletRequestUtils //取请求参数的整数值: public static Integer getIntP ...
- Objective-C实现一个简单的栈
栈作为一种数据结构,是一种只能在一端进行插入和删除操作的特殊线性表.它按照先进后出的原则存储数据,先进入的数据被压入栈底,最后的数据在栈顶,需要读数据的时候从栈顶开始弹出数据(最后一个数据被第一个读出 ...