windows版本redis下载安装

官方网站:http://redis.io/

官方下载:http://redis.io/download 可以根据需要下载不同版本

 

在官方下载网页中有一个window版本的说明,说redis官方没有windows版本,但是Microsoft Open Tech group开发和维护了一个windows版本。点击后面的leanmore,可以去git网站下载最新的版本。

对应网址:https://github.com/MSOpenTech/redis/releases 

而下面的网址也可以下载到windows版本的,且有一些说明可以参考。

https://github.com/ServiceStack/redis-windows 

一些有用的摘抄如下:

Running Microsoft's native port of Redis

These 64-bit binary releases are created by building the Microsoft's native port of redis which have also been published on NuGet, but as it's more convenient we provide a zip of the 64-bit binaries here.

MS Open Announcements

Current Version: 3.0.503 (June 28, 2016)

1. Download the redis-latest.zip native 64bit Windows port of redis

wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip

2. Extract redis64-latest.zip in any folder, e.g. in c:\redis

3. Run the redis-server.exe using the local configuration

cd c:\redis
redis-server.exe redis.windows.conf

4. Run redis-cli.exe to connect to your redis instance

cd c:\redis
redis-cli.exe

5. Start playing with redis :)

redis 127.0.0.1:6379> SET foo bar
OK
redis 127.0.0.1:6379> KEYS *
1) "foo"
redis 127.0.0.1:6379> GET foo
"bar"
redis 127.0.0.1:6379>


The MSOpenTech of Redis adds some useful extensions for better integration with Windows:

Running Redis as a Service

If you installed Redis using the MSI package, then Redis was already installed as a Windows service. Nothing further to do. If you would like to change its settings, you can update the redis.windows-service.conf file and then restart the Redis service (Run -> services.msc -> Redis -> Restart).

During installation of the MSI you can either use the installer’s user interface to update the port that Redis listens at and the firewall exception or run it silently without a UI. The following examples show how to install from the command line:

default install (port 6379 and firewall exception ON):

msiexec /i Redis-Windows-x64.msi 

set port and turn OFF firewall exception:

msiexec /i Redis-Windows-x64.msi PORT=1234 ADD_FIREWALL_RULE=""

set port and turn ON firewall exception:

msiexec /i Redis-Windows-x64.msi PORT=1234 ADD_FIREWALL_RULE =1

install with no user interface:

msiexec /quiet /i Redis-Windows-x64.msi

If you did not install Redis using the MSI package, then you still run Redis as a Windows service by following these instructions:

In order to better integrate with the Windows Services model, new command line arguments have been introduced to Redis. These service arguments require an elevated user context in order to connect to the service control manager. If these commands are invoked from a non-elevated context, Redis will attempt to create an elevated context in which to execute these commands. This will cause a User Account Control dialog to be displayed by Windows and may require Administrative user credentials in order to proceed.

Installing the Service

--service-install

This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit.

This command does not start the service.

For instance:

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

Uninstalling the Service

--service-uninstall

This will remove the Redis service configuration information from the registry. Upon successful uninstallation a success message will be displayed and Redis will exit. This does command not stop the service.

For instance:

redis-server --service-uninstall

Starting the Service

--service-start

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

For instance:

redis-server --service-start

Stopping the Service

--service-stop

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

For instance:

redis-server --service-stop

Naming the Service

--service-name name

This optional argument may be used with any of the preceding commands to set the name of the installed service. This argument should follow the service-install, service-start, service-stop or service-uninstall commands, and precede any arguments to be passed to Redis via the service-install command. The following would install and start three separate instances of Redis as a service:

redis-server --service-install –service-name redisService1 –port 10001
redis-server --service-start –service-name redisService1
redis-server --service-install –service-name redisService2 –port 10002
redis-server --service-start –service-name redisService2
redis-server --service-install –service-name redisService3 –port 10003
redis-server --service-start –service-name redisService3


此外,设置为windows服务 卸载、启动、停止、改名及端口服务

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

redis-server --service-uninstall

redis-server --service-start

redis-server --service-stop

redis-server --service-install –service-name redisService1 –port 10001

redis-server --service-start –service-name redisService1

 

posted on 2017-04-25 16:21  傻瓜乐园  阅读(853)  评论(0编辑  收藏  举报

导航