系统城装机大师 - 固镇县祥瑞电脑科技销售部宣传站!

当前位置:首页 > 数据库 > Redis > 详细页面

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

时间:2020-02-02来源:系统城作者:电脑系统城

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

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


 
  1. [root]$ whereis redis-cli
  2. redis-cli: /usr/local/bin/redis-cli
  3. [root]$
  4. [root]$ whereis redis-server
  5. redis-server: /usr/local/bin/redis-server

2、启动Redis

输入代码


 
  1. redis-server &
  2. 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
  3. 30733:M 09 Dec 14:45:30.879 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
  4. 30733:M 09 Dec 14:45:30.879 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
  5. 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'.
  6. [root]$ _._
  7. _.-``__ ''-._
  8. _.-`` `. `_. ''-._ Redis 3.2.0 (00000000/0) 64 bit
  9. .-`` .-```. ```\/ _.,_ ''-._
  10. ( ' , .-` | `, ) Running in standalone mode
  11. |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
  12. | `-._ `._ / _.-' | PID: 30733
  13. `-._ `-._ `-./ _.-' _.-'
  14. |`-._`-._ `-.__.-' _.-'_.-'|
  15. | `-._`-._ _.-'_.-' | http://redis.io
  16. `-._ `-._`-.__.-'_.-' _.-'
  17. |`-._`-._ `-.__.-' _.-'_.-'|
  18. | `-._`-._ _.-'_.-' |
  19. `-._ `-._`-.__.-'_.-' _.-'
  20. `-._ `-.__.-' _.-'
  21. `-._ _.-'
  22. `-.__.-'
  23.  
  24. 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.
  25. 30733:M 09 Dec 14:45:30.900 # Server started, Redis version 3.2.0
  26. 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.
  27. 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.
  28. 30733:M 09 Dec 14:45:30.902 * The server is now ready to accept connections on port 6379
  29.  

3.判断Redis是否启动


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

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

分享到:

相关信息

  • redis分布式ID解决方案示例详解

    常用的分布式ID解决方案 UUID Snowflake Snowflake算法的Java代码: Leaf Leaf算法的Java代码: 基于数据库自增ID生成 基于UUID生成 基于Redis生成 基于ZooKeeper生成...

    2023-03-09

  • Redis并发访问问题详细讲解

    什么场景需要控制并发访问 并发访问的控制方法 1、加入锁机制 2、操作原子化...

    2022-12-06

系统教程栏目

栏目热门教程

人气教程排行

站长推荐

热门系统下载