windows安装绿色版Redis

前言: 项目使用到了Redis,服务器的Redis总是挂,难受,于是有了接下来的这篇windows端安装绿色版Redis的教程

1.欢迎来到世界上最大的同性交友圈gayhup(错了,错了,是githup),直接放上链接

https://github.com/MicrosoftArchive/redis

2.已经有个正式版本啦,点击进去,我一般选择的都是最新的releases版本,目前为止最新的是

Redis版本
Redis最新的版本

3.下载下来的Redis-x64-3.2.100.zip解压到一个路径为英文且名字中间不能有空格的文件夹下(虽然有中文,有空格大多数情况下不会出问题,以防一些莫名奇妙的错误发生),最好分个类(安装),我的如下:

4.呀!自带文档呀!可惜全是英文,大致的我们还是都能看的懂得,本人英语也是个渣,后悔当初没有好好学英语啊,ε=(´ο`*)))唉!

没事,咱们慢慢来!

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-service.conf --loglevel verbose

大致翻译一下:

安装Redis服务

安装指令:

--service-install

这必须是redis-server命令行上的第一个参数。 之后的参数按照它们在启动服务时发生的顺序传递给Redis。 该服务将配置为自动启动,并将作为“NT AUTHORITY \ NetworkService”启动。 成功安装后,将显示成功消息,Redis将退出。

该命令只负责安装Redis服务,不启动Redis服务.

(不安装服务,怎么启动服务,执行程序啊,所以安装服务就是第一步,基础)

例子:

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

大致解释下各个参数的意思:

(1)redis-server对应zip文件下的redis-server.exe程序

(2)--service-install 安装服务

(3)redis.windows-service.conf对应zip文件下的redis.windows-service.conf文件(该文件负责配置Redis的相关信息,比如端口号,密码等等)

(4)--loglevel verbose :日志等级-详细(安装Redis服务时,显示安装的信息)

实战一下,打开cmd窗口

D:\DevInstall\DataBase\Redis\Redis-x64-3.2.100为redis-server.exe所在程序的路径(取决于你把下载的zip文件解压到哪)

进入redis-server.exe程序所在的文件夹下执行上述的安装服务的命令

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

没有报错信息的话应该就是安装成功了,我们可以windows+R键,输入services.msc指令查看一下Redis服务有没有安装成功,如下图:

如果是上图这样,表示Redis服务已经安装成功了!

启动服务

2种启动方式:

(1)鼠标选中"Redis"服务,右键-->启动,启动成功后的Redis服务如下图

(2)指令启动:

文档中是这样描述的:

Starting the Service

--service-start

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

For instance:

redis-server --service-start

翻译一下:

启动服务

--service-start

这将启动Redis服务。 成功启动后,将显示成功消息,Redis将开始运行。

例子:

redis-server --service-start

dos操作如下:

3.停止服务(同启动服务,也有2种方式)

(1)选中"Redis"服务,鼠标右键-->停止,成功如下图,状态为空

(2)通过指令停止Redis服务 

文档是这样描述的

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

翻译一下:

停止服务

--service-stop

这将停止Redis服务。 成功终止后,将显示成功消息,Redis将退出。

例子:

redis-server --service-stop

dos操作:

剩下的修改Redis的配置,配置多个Redis服务,等有空了再给补上!哈哈哈哈哈

猜你喜欢

转载自blog.csdn.net/ml863606/article/details/87456239