The third step of Redis practice how to install Redis on a Windows system

Source: Internet
Author: User
Tags redis download install redis

Original: Redis Advanced Practice How to install Redis on a Windows system

I. Introduction to Redis

Redis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.

Redis is a high-performance Key-value database. The emergence of Redis, to a large extent, compensates for the lack of memcached such key/value storage, in some cases can be a good complement to the relational database. It provides clients such as Java,c/c++,c#,php,javascript,perl,object-c,python,ruby,erlang, which is convenient to use.

Redis supports master-slave synchronization. Data can be synchronized from the primary server to any number of slave servers, from the server to the primary server that is associated with other slave servers. This enables Redis to perform single-layer tree replication. You can write to the data intentionally or unintentionally. Because of the full implementation of the publish/subscribe mechanism, you can subscribe to a channel and receive a complete message release record from the master server when the tree is synchronized anywhere from the database. Synchronization is helpful for the scalability and data redundancy of read operations.

Redis's official address, very good remember, is Redis.io. (specifically checked, the domain name suffix io belongs to the national domain name, is British Indian ocean Territory, namely British Indian Ocean Territory)

Currently, VMware is funding the development and maintenance of REDIS projects.

Ii. Installing the Redis package on a Windows system

(1), we open the following Web site on the Redis website: https://redis.io/download, open the Redis download page, which is a description of the Redis download version. If you do not see information about the "Windows" version of Redis, continue to the right scroll bar and you will immediately see the following information:

Windows

The Redis project does not officially support Windows. However, the Microsoft Open Tech Group develops and maintains this Windows port targeting Win64. (Learn more) here is a link that can be opened.

The Redis project does not officially support windows. However, the Microsoft Open Technology team developed and maintained a Windows interface program for Win64.



(2), then click on the "Lean more" connection to open Microsoft's Web site for the GitHub project file for the Windows 64bit port developed by Redis.



(3), then click on the "37releases" connection, open the Microsoft Team release, for Redis development Program download page. Currently the latest version is 3.2.100, of course, there are other versions, each version has two files, one is the MSI installation files, one is a zip compressed file. We click on the desired file connection, direct download, I am now the zip compressed file.



(4), save the downloaded file to any directory, of course, compressed files can also be extracted to any directory, but this directory must remember. The contents of the folder are as follows:



(5), Redis is divided into the server side and the client, so we must install the server side, or Redis will not be able to provide services for us. First open the Cmd window, it is best to run as an administrator, of course, first to switch the address of the command to Redis unzipped directory, and then run the command, Redis-server.exe Redis.Windows.Conf, enter, see the following page, indicating that the server side of Redis started successfully. To illustrate, this CMD window does not close, so the Redis started is a one-time, shut down will not be able to provide services for us.

// go to the Unzip directory and execute the following command to open the Redis service redis-server    redis.windows.conf





(6), Redis server-side boot up, and then we need to start the Redis client, The name of this program is: Redis-cli.exe, we need to open a CMD window, switch directories to the Redis compression package decompression directory, and then directly run the program on the line, appear in slices, that the Redis client has successfully connected to the Redis server, can now write some commands to try.

// go to unzip folder, execute command Redis 192.168. 127.1 6379




(7), need to explain a little, if we start Redis server side and client, we have to switch the address of cmd command, that is, the address of the current command is switched to the directory of the decompression address of the Redis compressed package, in order to execute the corresponding files, a little trouble, We can put the address of the Redis compress package into "environment variable", and we will not have to switch the address after each use.

Action: In theMy Computericon, right-click, and then tapProperties"Menu, open"system"Page, then, on the left, click on the"Advanced system Settings"Menu, open"System Propertieswindow, and then continue to click on the "Environment Variables"Menu, open"Environment Variableswindow, and then in theSystem Variables"Inside, find"variables"The name is calledpath Field, and then tapEdit"Menu, open"Editing Environment Variableswindow, and then continue tappingNewmenu, add the uncompressed address of the Redis package to this window.



(8), to this, the installation of Redis on the Windows system is complete. However, such an installation, as long as the Redis-server server window is closed, the REDIS-CLI client can not be connected. You need to open the server side of the redis-server before each use, and then use the REDIS-CLI client connection, this is too much trouble, below we install Redis as a Windows service.

Iii. installing Redis in the form of a Windows service

1. If you installed Redis with the MSI package, Redis is already installed as a Windows service. There's nothing left to do. If you want to change its settings, you can update the * redis.windows.conf * file and then restart the Redis service (run-\> services.msc-\> redis-\> reboot).

During the installation of the MSI, you can use the installer's user interface to update the port and firewall exceptions for Redis snooping, or to run without a UI interface. The following example shows how to install from the command line:

1 //**default Install (port 6379 and firewall exception on):* *2 3*msiexec/i Redis-x64.msi *4 5 //**set port and turn OFF firewall exception:**6 7*msiexec/i Redis-x64.msi port=1234firewall\_on=""*8 9 //**set port and turn on firewall exception:**Ten  One*msiexec/i Redis-x64.msi port=1234firewall\_on=1* A  - //**install with no user interface:** -  the*msiexec/quiet/i redis-x64.msi*


2. If you are not using the MSI package to install Redis, you can still run Redis as a Windows service by following these instructions:

To better integrate with the Windows Service model, Redis introduces new command-line parameters. These service parameters require an elevated user context to connect to the Service Control Manager. If these commands are called from a non-upgraded context, Redis will attempt to create an elevated context to execute the commands. This causes the Windows User Account Control dialog box to appear and may require administrative user accounts to continue.

2.1. Installation Services

Redis-server This command must be the first parameter on the command line. The parameters after this are passed to Redis in the order in which they were started. The service will be configured to start automatically and will be started as "NT authority \ NetworkService". After the installation is successful, a success message will be displayed and Redis will exit.

The command does not start the service

For example:

Redis-server--service-install redis.windows.conf--loglevel verbose


2.2. Uninstall Service

This removes the Redis service configuration information from the registry. After the uninstallation succeeds, a success message will be displayed and Redis will exit.

This command does not stop the service

For example:

Redis-server--service-uninstall


2.3. Start Service

This will start the Redis service. Upon successful startup, a success message will be displayed and Redis will start running.

For example:

Redis-server--service-start


2.4. Stop the Service

This will stop the Redis service. Upon successful termination, a success message will be displayed and Redis will exit.

For example:

Redis-server--service-stop


2.5. Naming Service

This optional parameter can be used with any previous command to set the name of the installed service. This parameter should follow the Service-install,service-start,service-stop or Service-uninstall command and precede the parameters passed to Redis by the Service-install command.

The following will install and launch three separate Redis instances as a service:

1Redis-server--service-install--service-name RedisService1--port100012 3Redis-server--service-start--service-name RedisService14 5Redis-server--service-install--service-name RedisService2--port100026 7Redis-server--service-start--service-name RedisService28 9Redis-server--service-install--service-name RedisService3--port10003Ten  OneRedis-server--service-start--service-name RedisService3


Iv. End of

to this end, the installation of the REDIS environment and the installation of its own system are complete. Next, we want to formally enter the REDIS system itself learning, next article, we first look at the data type of Redis, to learn redis, it must be the data type of learning good. Try it.!!!

The third step of Redis practice how to install Redis on a Windows system

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.