The Windows environment uses Redis

Source: Internet
Author: User
Tags allkeys redis version

Redis Default configuration is very simple, port, storage log and path, password settings, storage policies and so on, specific settings on the Internet a lot of reference;

Port 6379

Databases 16

#save 900 1

Save 300 10

#save 60 10000

Dbfilename Dump.rdb

Dir D:\redis

Requirepass [email protected]

MaxClients 10000: By default , it is a 10000 client. When you cannot set the process file handle limit,Redis is set to the current file handle limit value minus all, because Redis leaves some handles for its internal processing logic.

If this limit is reached,Redis rejects new connection requests and issues "max number of clients reached" to these connection requesters in response.

maxmemory <bytes>:

sets The amount of memory that Redis can use. Once the memory usage limit is reached,Redis will attempt to remove the internal data, and the removal rule can be specified by Maxmemory-policy .

if Redis cannot remove the in-memory data according to the removal rules, or if we set " do not allow removal ", redis returns an error message for those instructions that require memory. such as SET,Lpush and so on. However, for instructions that do not have a memory request, they will still respond normally, such as GET .


One thing to note is that if your Redis is a master Redis(which means that your Redis has a redis), then when you set the memory usage limit, You need to leave some memory space in the system for the synchronization queue cache, only if you set the " do not remove " situation, do not consider this factor.

for memory-removal rules,redis provides up to 6 removal rules. They are:

1.volatile-lru: Using LRU< Span style= "font-size:12px;font-family: ' The song Body '; > The algorithm removes the key
2.allkeys-lru: Use lru: Remove the random key
from the expired collection 4.allkeys-random: Remove the random key
5.volatile-ttl key
6.noeviction: no removal. For write operations, only error messages are returned.

regardless of which removal rule is used, Redis returns an error message for a write request if no appropriate key can be removed .

Most of the time this setting will leave a huge pit after a long time;

d:\redis>redis-cli.exe-h127.0.0.1-p6379

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

There are spaces behind-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 [email protected]

127.0.0.1:6379> keys *;

(empty list or set)

Search Password:

Config is rename display

# Rename-command CONFIG ""

Rename-command config display or Config command prohibits

Replace config with display below

127.0.0.1:6379> Config Get Requirepass

127.0.0.1:6379> Display Get Requirepass

1) "Requirepass"

2) "[Email protected]"

Configure Password:

127.0.0.1:6379> Display Set requirepassredis#123

Ok

127.0.0.1:6379> Display Get Requirepass

1) "Requirepass"

2) "Redis#123"

127.0.0.1:6379>display set [email protected]

Ok

127.0.0.1:6379> Display Get Requirepass

1) "Requirepass"

2) "[Email protected]"

127.0.0.1:6379>

To view the installation path:

127.0.0.1:6379> Display Get dir

1) "Dir"

2) "D:\\redis"

Registering Windows System services:

D:\redis\redis-server.exe--service-installd:\redis\redis.1.conf--service-name redis--loglevel verbose

To delete a service:

net stop Redis

Redis-server--service-uninstall

Go to Redis:

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

Normal startup will display the following message:

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

[2916] SEP 12:50:31.550 * The server Isnow ready to accept connections on port 6379

_._

_.-' __ '-._

_.-``    `. `_. "-._ Redis 2.8.2102 (00000000/0)

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

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

| '-._ '-...-' __...-. '-._| '     ' _.-' | port:6379

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

'-._ '-._ '-./_.-' _.-'

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

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

'-._ '-._ '-.__.-' _.-' _.-'

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

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

'-._ '-._ '-.__.-' _.-' _.-'

'-._ '-.__.-' _.-'

'-._ _.-'

'-.__.-'

sometimes adding windows System Services Redis will not be able to report 1067 errors, you can delete the re-registration service, the system restarts most will normally start;                   

This article is from the "Silent Years" blog, please be sure to keep this source http://xpu2001.blog.51cto.com/890980/1841398

The Windows environment uses Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.