Installing Redis in the Windows environment

Source: Internet
Author: User
Tags download redis install redis redis server

1: First download Redis.
From the following address: https://github.com/MSOpenTech/redis/releases
2: Create the redis.conf file:
This is a configuration file that specifies the Redis listening port, timeout, and so on. Here are the following: Port 6379.

Changing the configuration of Redis requires modifying the redis.conf file, and here are some of its major configuration notes:

#是否作为守护进程运行daemonize No#redis Default Listener port 6379# client idle for how many seconds, disconnect timeout 300# log display level loglevel verbose# Specify the file name of the log output, can also be specified to the standard output port logfile redis.log# settingsThe number of databases, the default maximum is 16, the default connection to the database is 0, you can connect different databases by select N databases 32#dump persistence policy # when there is a keys data is changed is, 900 seconds flushed to disk once #save 900 # when there are 10 When the keys data is changed, 300 seconds to disk save 300 100# when the keys data is changed, 60 seconds is flushed to disk once save 6000 10000# when dump. RDB database is compressed data object Rdbc Ompression yes#dump persisted data Save file name Dbfilename dump.rdb########### Replication ##################### #Redis的主从配置, Configure the Slaveof instance as the #slaveof 192.168.0.105 6379# master server connection password from the server # Masterauth <master-password>##############Security ########### #设置连接密码 #requirepass <password>############### LIMITS ############## #最大Number of client connections # MaxClients 128# max Memory usage # max Memories<bytes>########## APPEND only MODE ######### #是否开启日志功能appendonly no# aof Persistence Policy # Appendfsync always#appendfsync everysec#appendfsync no################ VIRTUAL MEMORY ########### #是否开启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 the slaveof from the server configuration file, fill in the server IP and port, if the primary server set the connection password, after the Masterauth to specify the password on the line.

Persistence of

    • Redis provides two persistent copywriting, dump persistence, and aof log file persistence.
    • Dump persistence is the complete writing of in-memory data to a data file, which is triggered by a configuration policy, and if a failure occurs after the data has changed and the trigger condition is not met, it can result in partial data loss.
    • AOF persistence is log storage, is the form of increments, recording each data manipulation action, data recovery is based on these logs to generate.

3. Command-Line Operations

Use the cmd command prompt to open the REDIS-CLI connection 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

Once the connection is successful, you can change the Redis data additions and deletions, such as string manipulation:

Here are some common commands for server management:

Info   #查看服务器信息select <dbsize> #选择Database index  Select 1flushall #清空全部数据flushdb  #清空当前索引的数据库slaveof < Server > < ports >  #设置为从服务器slaveof no one #设置为主服务器shutdown  #关闭服务

Attach several bat batch scripts, flexibly configured as needed

service-install.batredis-server.exe--service-install redis.windows.conf--loglevel verbose  Uninstall-service.batredis-server--service-Uninstall  Startup.batredis- Server.exe redis.windows.conf  

Installing Redis under Windows environments

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.