https://blog.csdn.net/SpringCYB/article/details/90020564 参考地址
spring集成
#------------redis 锟斤拷始 # REDIS # Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09 spring.redis.database=0 # Redis\u670D\u52A1\u5668\u5730\u5740 #spring.redis.host=localhost # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 #spring.redis.port=6379 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 spring.redis.password= # \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 8 spring.redis.lettuce.pool.max-active=8 # \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 -1 spring.redis.lettuce.pool.max-wait=-1 # \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 8 spring.redis.lettuce.pool.max-idle=8 # \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 0
spring.redis.lettuce.pool.min-idle=0 spring.redis.sentinel.master=mymaster spring.redis.sentinel.nodes=192.168.0.109:26379,192.168.0.109:26380,192.168.0.109:26381 #------------redis 哨兵端口,配置几个哨兵链接几个端口
#接超时时间(毫秒)
spring.redis.timeout=5000
------------------------安装 可以开机可以重新启动的 redis
1.下载
wget http://download.redis.io/releases/redis-2.8.17.tar.gz
2解压
tar xzf redis-2.8.17.tar.gz 命令解压
解压完 redis目录 执行make
make PREFIX=/etc/redis install
vim /etc/profile
export REDIS_HOME=/etc/redis export PATH=$PATH:$REDIS_HOME/bin
让修改环境变量生效
source /etc/profile
测试是否生效
$PATH
cd redis/utils 目录 执行
./install_server.sh
ps -ef | grep redis 查看端口是否存活
redis 开机自动重启
service redis_6379.conf start 任意路径下可以启动