在Windows上以服务方式运行 MSOPenTech/Redis

时间:2023-03-09 23:58:19
在Windows上以服务方式运行 MSOPenTech/Redis

ServiceStack.Redis 使用教程里 提到Redis最好还是部署到Linux下去,Windows只是用来做开发环境,现在这个命题发生改变了,在Windows上也可以部署生产环境的 Redis,这都要感谢微软的开放,把Redis在Windows上的环境给我们搞定了,最新的版本已经支持64位了。那么Redis在32位上的存储能 力受限于可用的地址空间,也就是3GB。 要在Windows上运行64位Redis ,可以从https://github.com/MSOpenTech/redis 获取一份Redis代码,然后用Visual Studio 2010 打开\msvs\RedisServer.sln并进行编译。Redis是使用C++写的,所以你安装c++的编译器。

编译好后在msvs\bin\release

在Windows上以服务方式运行 MSOPenTech/Redis

把它拷到你想安装的目录,然后把\msvs\RedisWAInst\Samples\ redis.conf 拷过来,具体可参考http://redis.io/topics/config

在Windows上以服务方式运行 MSOPenTech/Redis

启动服务,可以看到每隔5秒的心跳包输出。

服务端已经运行起来了,现在我们另外起一个命令行终端切换到c:\redis目录下:

在Windows上以服务方式运行 MSOPenTech/Redis

说明我们成功运行起来了Redis。备注,你还可以到http://redistogo.com/ 去申请一个免费的Redis实例做测试。

在编译的目录下你可以看到另外一个工具RedisWatcher ,这是一个Windows服务,用来启动和监控一个或者多个Redis实例,用上这个工具就可以把Redis作为一个Windows服务来运行。

运行InstallWatcher.msi默认安装在C:\Program Files\RedisWatcher,修改watcher.conf

在Windows上以服务方式运行 MSOPenTech/Redis

把服务启动起来

在Windows上以服务方式运行 MSOPenTech/Redis

通过Powershell,你可以查到RedisWatcherSvc已经安装了

在Windows上以服务方式运行 MSOPenTech/Redis

SignalR with Redis Running on a Windows Azure Virtual Machine

How to deploy Redis to Windows Azure using the command line tool

来源 http://www.cnblogs.com/shanyou/archive/2013/01/17/redis-on-windows.html