windos下redis的启动与安装

1、启动redisgit

1.redis的安装github

1.1.先下载redis,到https://github.com/MicrosoftArchive/redis/releases,下载Redis-x64-3.2.100.msiredis

1.9.安装完成后,在刚才安装中所选择的目录,如上图: 进入此文件夹下可修改redis的相关配置,能够在文件“redis.windows.conf”中修改,使用记事本打开这个文件修改保存便可。shell

     注意:以井号(#)开头的行都是注释windows

 

 

 

【redis主机地址】默认绑定server本机,此时bind能够省略(bind 127.0.0.1)socket

 

 【redis连接密码】默认redis没有连接密码,能够经过如下命令设置(requirepass 123),密码设置为abcd2020ui

 

 

 

2.redis的启动

  1. 打开位置为:C:\skhbEnvironment\redis
  2. 点击cmd

输入:cd  C:\redisthis

输入:redis-server.exe    redis.windows.conf,即就是spa

C:\redis>redis-server.exe    redis.windows.conf命令行

  启动成功,以下图:

 

 

 

redis若是启动错误,报错以下:

10 Jun 11:37:13.018 # Creating Server TCP listening socket 127.0.0.1:6379: bind: No error

 

解决办法:

 

# for connections from all the network interfaces available on the server.

# It is possible to listen to just one or multiple selected interfaces using

# the "bind" configuration directive, followed by one or more IP addresses.

#

# Examples:

#

# bind 192.168.1.100 10.0.0.1

# bind 127.0.0.1 ::1

#

# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the

# internet, binding to all the interfaces is dangerous and will expose the

# instance to everybody on the internet. So by default we uncomment the

# following bind directive, that will force Redis to listen only into

# the IPv4 lookback interface address (this means Redis will be able to

# accept connections only from clients running into the same computer it

# is running).

#

# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES

# JUST COMMENT THE FOLLOWING LINE.

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bind 127.0.0.1                    //去掉#

 

 

# Protected mode is a layer of security protection, in order to avoid that

# Redis instances left open on the internet are accessed and exploited.

#

 

# When protected mode is on and if:

 

从新执行命令行

D:\redis>redis-server.exe redis.windows.conf

若仍报如下错误:

# Creating Server TCP listening socket 127.0.0.1:6379: bind: No error

按顺序输入以下命令就能够链接成功

1. redis-cli.exe

2. shutdown

3. exit

4. redis-server.exe redis.windows.conf

2、启动后台:

新的jar包   放在 C:/skhbsoft/ new

Java –jar s+Tab   回车(两次)

3、启动前台:

  1. Shift+鼠标右键,点击:在此处打开powershell

http-server

相关文章
相关标签/搜索