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

Some common commands used by redis collected on the Internet under windows

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Installation and service management of Redis under Windows Redis itself does not support windows, but a Microsoft team is maintaining a version under windows

1) the administrator opens the cmd command window

λ redis-server-- service-install redis.windows-service.conf-- service-name redis6379

The shortcut key Win+R runs services.msc to open service management, and you can see that Redis has been installed into the system service, and the service has not been started.

2) Uninstall the service:

Parameter:-- service-uninstall

This removes the Redis service configuration information from the registry. During a successful uninstall, a success message will be displayed and Redis will exit.

At the same time, this command will not stop the service.

D:\ Redis

λ redis-server-- service-uninstall-- service-name redis6379

[11752] 12 Nov 22:06:07.395 # Redis service successfully uninstalled.

3) start the service: net start redis

Stop service: net stop redis

4) redis.windows.conf configuration file

Bind binds ip address, production environment, and needs to be configured as native IP

Daemonize yes and redis do not support daemons under windows. You can install them as services.

Log folder: logfile ". / logs/server_log.txt" requires manual creation of logs folder

Data folder: dir. / datas/ requires manual datas folder. The default data file name is dump.rdb.

Protected mode: protected-mode yes. Change yes to no if you need access from other machines.

5) redis persistence configuration

1.snapshotting snapshot method (default) has been tested, and if the consistency requirement is not very high, the performance will be high if the snapshot method is adopted.

2.append-only file (aof mode)

Aof settings:

Appendonly yes / / start aof persistence mode

Appendfsync always / / persist as soon as you receive a disk write command, a recommended way

Appendfsync everysec / / write a compromise every second

Appendfsync no / / persistence guarantee based entirely on os performance

6) Master-slave configuration

Slaveof

2.masterauth

Redis client

Redis-cli-h 127.0.0.1-p 6379

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: 238

*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

Database

Wechat

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

12
Report