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

所属分类: 数据库 / Redis 阅读数: 105
收藏 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数据库程序设计有所帮助。

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

基于Redis实现分布式锁以及任务队列

这篇文章主要介绍了基于Redis实现分布式锁以及任务队列,需要的朋友可以参考下
收藏 0 赞 0 分享

Redis上实现分布式锁以提高性能的方案研究

这篇文章主要介绍了Redis上实现分布式锁以提高性能的方案研究,其中重点需要理解异步算法与锁的自动释放,需要的朋友可以参考下
收藏 0 赞 0 分享

图文详解Windows下使用Redis缓存工具的方法

这篇文章以图文结合的方式详解Windows下使用Redis缓存工具的方法,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

CentOS下Redis数据库的基本安装与配置教程

这篇文章主要介绍了CentOS下Redis数据库的基本安装与配置教程,Redis一般被用作基于内存的缓存式数据存储,要的朋友可以参考下
收藏 0 赞 0 分享

Redis整合Spring结合使用缓存实例

这篇文章主要介绍了Redis整合Spring结合使用缓存实例,介绍了如何在Spring中配置redis,并通过Spring中AOP的思想,将缓存的方法切入到有需要进入缓存的类或方法前面。需要的朋友可以参考下
收藏 0 赞 0 分享

Linux下安装Redis并设置相关服务

这篇文章主要为大家介绍了Linux下安装Redis并设置相关服务,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

redis的hGetAll函数的性能问题(记Redis那坑人的HGETALL)

这篇文章主要介绍了redis的hGetAll函数的性能问题,需要的朋友可以参考下
收藏 0 赞 0 分享

浅谈Redis在分布式系统中的协调性运用

这篇文章主要介绍了Redis在分布式系统中的协调性运用,讲解了Redis在进程和线程的调度上以及消息队列中的作用,需要的朋友可以参考下
收藏 0 赞 0 分享

Redis实现信息已读未读状态提示

这篇文章主要介绍了Redis实现信息已读未读状态提示的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

windows环境下Redis+Spring缓存实例讲解

这篇文章主要为大家详细介绍了windows环境下Redis+Spring缓存实例教程,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享
查看更多