redis windows 綠色版 配置密碼, 啓動bat

1. 配置密碼,找到 redis.windows.conf 配置文件

# Require clients to issue AUTH <PASSWORD> before processing any other
# commands.  This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
# 
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#

#這裏配置密碼,密碼root(www.fhadmin.org)
requirepass root

# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.

2.製作啓動腳本。用寫字本編輯後,保存爲bat格式

redis-server.exe  redis.windows.conf

3. java springboot 鏈接 redis

#===========Redis配置====fhadmin.org=======
# Redis數據庫索引(默認爲0)  
spring.redis.database=0
# Redis服務器地址  
spring.redis.host=127.0.0.1
# Redis服務器連接端口  
spring.redis.port=6379
# Redis服務器連接密碼(默認爲空)  
spring.redis.password=root
# 連接池最大連接數(使用負值表示沒有限制)  
spring.redis.pool.max-active=200
# 連接池最大阻塞等待時間(使用負值表示沒有限制)  
spring.redis.pool.max-wait=-1
# 連接池中的最大空閒連接 
spring.redis.pool.max-idle=10
# 連接池中的最小空閒連接  
spring.redis.pool.min-idle=0
# 連接超時時間(毫秒)
spring.redis.timeout=2000ms
spring.redis.jedis.pool.max-wait=-1ms
#===========Redis配置====fhadmin.org=======

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章