共計 2467 個字符,預計需要花費 7 分鐘才能閱讀完成。
自動寫代碼機器人,免費開通
這篇文章給大家分享的是有關 redis 基本安裝判斷、啟動使用方法示例的內容。丸趣 TV 小編覺得挺實用的,因此分享給大家做個參考,一起跟隨丸趣 TV 小編過來看看吧。
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
127.0.0.1:6379
感謝各位的閱讀!關于“redis 基本安裝判斷、啟動使用方法示例”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
向 AI 問一下細節
正文完