服务器之家:专注于服务器技术及软件下载分享
分类导航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|数据库技术|

服务器之家 - 数据库 - Redis - redis基本安装判断、启动使用方法示例

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

2020-07-05 17:08Dawn__Z Redis

这篇文章主要介绍了redis基本安装判断、启动使用方法,结合实例形式分析了Redis针对是否安装的判断、启动等使用方法,需要的朋友可以参考下

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

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

?
1
2
3
4
5
[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

输入代码

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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是否启动

?
1
2
3
4
[root]# redis-cli -p 6379
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>

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

原文链接:https://blog.csdn.net/Dawn__Z/article/details/103457990

延伸 · 阅读

精彩推荐
  • Redisredis启动,停止,及端口占用处理方法

    redis启动,停止,及端口占用处理方法

    今天小编就为大家分享一篇redis启动,停止,及端口占用处理方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧 ...

    澄海单挑狂5152019-11-14
  • RedisRedis分布式锁升级版RedLock及SpringBoot实现方法

    Redis分布式锁升级版RedLock及SpringBoot实现方法

    这篇文章主要介绍了Redis分布式锁升级版RedLock及SpringBoot实现,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以...

    等不到的口琴7802021-07-25
  • RedisRedis数据结构之链表与字典的使用

    Redis数据结构之链表与字典的使用

    这篇文章主要介绍了Redis数据结构之链表与字典的使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友...

    白泽来了4052021-08-03
  • RedisLinux Redis 的安装步骤详解

    Linux Redis 的安装步骤详解

    这篇文章主要介绍了 Linux Redis 的安装步骤详解的相关资料,希望大家通过本文能掌握如何安装Redis,需要的朋友可以参考下 ...

    carl-zhao3822019-11-08
  • Redis就这?Redis持久化策略——AOF

    就这?Redis持久化策略——AOF

    今天为大家介绍Redis的另一种持久化策略——AOF。注意:AOF文件只会记录Redis的写操作命令,因为读命令对数据的恢复没有任何意义...

    头发茂密的刘叔4052021-12-14
  • Redis聊一聊Redis与MySQL双写一致性如何保证

    聊一聊Redis与MySQL双写一致性如何保证

    一致性就是数据保持一致,在分布式系统中,可以理解为多个节点中数据的值是一致的。本文给大家分享Redis与MySQL双写一致性该如何保证,感兴趣的朋友一...

    mind_programmonkey6432021-08-12
  • Redis在ssm项目中使用redis缓存查询数据的方法

    在ssm项目中使用redis缓存查询数据的方法

    本文主要简单的使用Java代码进行redis缓存,即在查询的时候先在service层从redis缓存中获取数据。如果大家对在ssm项目中使用redis缓存查询数据的相关知识感...

    caychen8962019-11-12
  • RedisRedis存取序列化与反序列化性能问题详解

    Redis存取序列化与反序列化性能问题详解

    这篇文章主要给大家介绍了关于Redis存取序列化与反序列化性能问题的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参...

    这名字已经存在9742021-02-24