Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Windows environment uses redis

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Redis default configuration is very simple, port, storage log and path, password setting, storage policy and so on. There are many references for specific settings on the Internet.

Port 6379

Databases 16

# save 900 1

Save 300 10

# save 60 10000

Dbfilename dump.rdb

Dir d:\ redis

Requirepass redis@123

Maxclients 10000: 10000 clients by default. When you cannot set the process file handle limit, redis will be set to the current file handle limit minus 32, because redis will leave some handles for its internal processing logic.

If this limit is reached, redis rejects new connection requests and sends a "max number of clients reached" to those connection requesters in response.

Maxmemory:

Sets the amount of memory that redis can use. Once the memory usage limit is reached, redis will attempt to remove internal data, and removal rules can be specified through maxmemory-policy.

If redis cannot remove data from memory according to the removal rule, or if we set "do not allow removal", then redis will return an error message for instructions that need to request memory, such as SET, LPUSH, and so on. However, instructions with no memory requests will still respond normally, such as GET, etc.

It is important to note that if your redis is the master redis (indicating that your redis has a slave redis), then when setting the upper limit of memory usage, you need to set some memory space in the system for the synchronization queue cache, and only if you set it to "do not remove", do not consider this factor.

For memory removal rules, redis provides up to six removal rules. They are:

1.volatile-lru: use the LRU algorithm to remove key from expired collections

2.allkeys-lru: remove key using the LRU algorithm

3.volatile-random: removes random key from expired collections

4.allkeys-random: remove random key

5.volatile-ttl: remove the key with the lowest TTL value, that is, the key that has only recently expired.

6.noeviction: no removal. For write operations, only error messages are returned.

Whichever of the above removal rules is used, redis returns an error message for the write request if there is no appropriate key to remove.

Many times this setting will leave a huge hole after a long time.

D:\ redis > redis-cli.exe-h227.0.0.1-p6379

Unrecognized option or bad number of argsfor:'- h227.0.0.1'

There is a space after-h ~

D:\ redis > redis-cli.exe-h 127.0.0.1-p6379

127.0.0.1 6379 > keys *

(error) NOAUTH Authentication required.

Redis-cli.exe-h host ip-p port-a password

D:\ redis > redis-cli.exe-h 127.0.0.1-p6379-a redis@123

127.0.0.1 6379 > keys *

(empty list or set)

Query password:

Config was rename display

Rename-command CONFIG ""

The rename-command CONFIG display or config command prohibits

Replace config with display below

127.0.0.1 purl 6379 > config get requirepass

127.0.0.1 purl 6379 > display get requirepass

1) "requirepass"

2) "redis@123"

Configure password:

127.0.0.1 purl 6379 > display set requirepa***edis#123

OK

127.0.0.1 purl 6379 > display get requirepass

1) "requirepass"

2) "redis#123"

127.0.0.1 purl 6379 > display set requirepa***edis@123

OK

127.0.0.1 purl 6379 > display get requirepass

1) "requirepass"

2) "redis@123"

127.0.0.1purl 6379 >

View the installation path:

127.0.0.1 purl 6379 > display get dir

1) "dir"

2) "D:\ Redis"

Register for windows system services:

Delete the service:

Net stop Redis

Redis-server-service-uninstall

Enter redis:

D:\ Redis\ redis-cli.exe-h 192.168.10.1-p6379

A normal startup displays the following message:

[2916] 07 Sep 12:50:31.550 # Serverstarted, Redis version 2.8.2102

[2916] 07 Sep 12 50 15 15 * The server isnow ready to accept connections on port 6379

_. _.-`. `_. '' -. _ Redis 2.8.2102 (000000Zet0) 64 bit

.-``.\ /.,'-. _

(',.-|,) Running in stand alone mode

| | -. _...-_.-.`` -. _ |'_. -'| Port: 6379 |

| -. _. /. -'| PID: 2644

-. _. `-. -'_. -'

| | -. _. _ `. _. -'. -'_. -'|

| -. _ -. . -'_. -'| http://redis.io

-. _. _ `-. -'. -'_. -'

| | -. _. _ `. _. -'. -'_. -'|

| -. _ -. . -'_. -'|

-. _. _ `-. -'. -'_. -'

`-. _`. _ _. -'_. -'`-. _. -` -.

Sometimes a 1067 error will be reported when the windows system service redis is added, and the re-registration service can be deleted. Most of the system will start normally after the system restart.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report