In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to experience Redis in the Windows environment". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to experience Redis in the Windows environment".
Redis is a high-performance key-value database, using memory as the main storage, data access speed is very fast, of course, it also provides two mechanisms to support persistent data storage. Unfortunately, the Redis project does not directly support the Windows,Windows version of the project, which is an experimental project established and maintained by Microsoft's open technical team (which supports 32jue 64-bit), so it is not suitable for production environment, but can be used for development and testing in Windows environment.
1. Download and install
Poke here to the open source home page, download the source package, decompress the ZIP package and enter the msvs\ bin\ release folder. There are three files corresponding to 32 release 64 bits and three versions of windows service. Here we choose 64 bits as an example to extract redisbin64.zip to D:\ redis2.4, where redis-server.exe and redis-cli.exe are mainly used, redis-server is used to run Redis server, redis-cli is a command line client, and Redis server is connected through it. And use the Redis command to perform various operations.
two。 Service startup configuration
Copy redis.conf to D:\ redis2.4 under the root directory of the source package, open the CMD command prompt, and enter the following command to start the redis service.
Start:
Redis-server redis.conf
Thus, the redis service starts successfully.
Configuration:
Changing the configuration of redis requires modifying the redis.conf file, and here are some of its main configuration comments:
# whether to run daemonize no#Redis as a daemon, the default listening port port 637 is idle for how many seconds, disconnect timeout 30 log display level loglevel verbose# specifies the file name of log output, or you can specify the number of databases to be set to the standard output port logfile redis.log#. The default is 16, and the default connected database is 0. You can connect different database databases 32#Dump persistence policies through select N # when one piece of Keys data is changed # save 900 seconds is refreshed to disk, when 10 pieces of Keys data are changed, 300 seconds are refreshed to disk once save 300 10 bits when 1w pieces of keys data are changed 60 seconds refresh to disk once save 6000 1000 configuration of whether to compress data objects rdbcompression yes#dump persisted data saved file name dbfilename dump.rdb# Replication # # Redis when dump.rdb database Configure the slaveof instance as the slave server # slaveof 192.168.0.105 637 master server connection password # masterauth # security # set the connection password # requirepass # LIMITS # * * the number of client connections # maxclients 128 connections Storage utilization # maxmemory # APPEND ONLY MODE # whether to enable log function appendonly no# AOF persistence policy # appendfsync always#appendfsync everysec#appendfsync no# VIRTUAL MEMORY # whether to enable VM function # vm-enabled no# vm-enabled yes#vm-swap-file logs/redis.swap#vm-max-memory 0 # vm-page-size 32#vm-pages 134217728#vm-max-threads 4
Master-slave replication
Configure slaveof in the slave server configuration file and fill in the server IP and port. If the master server has set the connection password, specify the password after masterauth.
Persistence
Redis provides two types of persistent copy, Dump persistence and AOF log file persistence.
Dump persistence is to write all the data in memory to the data file, which is triggered by the configuration policy. If the trigger condition is not reached after the data change, part of the data will be lost due to failure.
AOF persistence is stored in logs and is in the form of increments, recording every action of data operations, and data recovery is generated based on these logs.
3. Command line operation
Use the CMD command prompt to open redis-cli to connect to the redis server, or you can use the telnet client
# redis-cli-h server-p port-a password
Redis-cli.exe-h 127.0.0.1-p 6379
After the connection is successful, you can add, delete, modify and query redis data, such as string operation:
Here are some common server management commands:
Info # View server information select # Select database index select 1flushall # clear all data flushdb # clear the database of the current index slaveof # set to slave server slaveof no one # set master server shutdown # shut down the service thank you for reading, this is the content of "how to experience Redis in Windows environment", after the study of this article I believe that you have a deeper understanding of how to experience Redis in the Windows environment, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.