redis基本安装判断、启动使用方法示例

所属分类: 数据库 / Redis 阅读数: 96
收藏 0 赞 0 分享

本文实例讲述了redis基本安装判断、启动使用方法。分享给大家供大家参考,具体如下:

1、Redis对否安装(安装好了会出现下面对应的代码)

[root]$ whereis redis-cli
redis-cli: /usr/local/bin/redis-cli
[root]$
[root]$ whereis redis-server
redis-server: /usr/local/bin/redis-server

2、启动Redis

输入代码

redis-server &
30733:C 09 Dec 14:45:30.876 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
30733:M 09 Dec 14:45:30.879 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
30733:M 09 Dec 14:45:30.879 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
30733:M 09 Dec 14:45:30.879 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
[root]$         _._
      _.-``__ ''-._
   _.-``  `. `_. ''-._      Redis 3.2.0 (00000000/0) 64 bit
 .-`` .-```. ```\/  _.,_ ''-._
 (  '   ,    .-` | `,  )   Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|   Port: 6379
 |  `-._  `._  /   _.-'  |   PID: 30733
 `-._  `-._ `-./ _.-'  _.-'
 |`-._`-._  `-.__.-'  _.-'_.-'|
 |  `-._`-._    _.-'_.-'  |      http://redis.io
 `-._  `-._`-.__.-'_.-'  _.-'
 |`-._`-._  `-.__.-'  _.-'_.-'|
 |  `-._`-._    _.-'_.-'  |
 `-._  `-._`-.__.-'_.-'  _.-'
   `-._  `-.__.-'  _.-'
     `-._    _.-'
       `-.__.-'

30733:M 09 Dec 14:45:30.900 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
30733:M 09 Dec 14:45:30.900 # Server started, Redis version 3.2.0
30733:M 09 Dec 14:45:30.901 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
30733:M 09 Dec 14:45:30.901 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
30733:M 09 Dec 14:45:30.902 * The server is now ready to accept connections on port 6379

3.判断Redis是否启动

[root]# redis-cli -p 6379
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>

希望本文所述对大家Redis数据库程序设计有所帮助。

更多精彩内容其他人还在看

在CentOS 7环境下安装Redis数据库详解

Redis是一个开源的、基于BSD许可证的,基于内存的、键值存储NoSQL数据本篇文章主要介绍了在CentOS 7环境下安装Redis数据库详解,有兴趣的可以了解一下。
收藏 0 赞 0 分享

利用yum安装Redis的方法详解

Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。这篇文章主要介绍的是利用yum安装Redis的方法,有需要的朋友们可以参考借
收藏 0 赞 0 分享

如何高效地向Redis插入大量的数据(推荐)

本篇文章主要介绍了如何高效地向Redis插入大量的数据,现在分享给大家,感兴趣的小伙伴们可以参考一下。
收藏 0 赞 0 分享

Redis实现分布式队列浅析

Redis将数据存储在内存中,使得读写速度非常快,经常被用来做缓存系统,这里我们将redis用来做一个分布式的消息队列。这篇文章主要介绍了使用redis来作为消息队列,并且进行分布式主从配置,有需要的朋友可以参考借鉴,下面来一起看看吧。
收藏 0 赞 0 分享

详解利用redis + lua解决抢红包高并发的问题

本篇文章主要介绍了利用redis + lua解决抢红包高并发的问题 ,详细的讲诉了需求分析和方案,有兴趣的可以了解一下。
收藏 0 赞 0 分享

Redis 对比 Memcached 并在 CentOS 下进行安装配置详解

Redis 是一个开源、支持网络、基于内存、键值对的 Key-Value 数据库,本篇文章主要介绍了Redis 对比 Memcached 并在 CentOS 下进行安装配置详解,有兴趣的可以了解一下。
收藏 0 赞 0 分享

详解Centos7下配置Redis并开机自启动

本篇文章主要介绍了Centos7下配置Redis并开机自启动,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
收藏 0 赞 0 分享

Windows下Redis安装配置简单教程

这篇文章主要为大家详细介绍了Windows下Redis安装配置简单教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

详解用Redis实现Session功能

本篇文章主要介绍了用Redis实现Session功能,具有一定的参考价值,小编觉得挺不错的,现在分享给大家,也给大家做个参考。
收藏 0 赞 0 分享

php结合redis实现高并发下的抢购、秒杀功能的实例

下面小编就为大家带来一篇php结合redis实现高并发下的抢购、秒杀功能的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享
查看更多