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

相關文章
相關標籤/搜索