tomcat8.5配置redis實現session共享(tomcat-redis-session-manager-master)


1.將下面幾個jar包依賴放到tomcat的lib目錄下:

 

2.修改tomcat/conf下context.xml文件,在<Context>節點添加如下代碼:

<Valve className="com.naritech.nicole.gump.RedisSessionHandlerValve" />
<Manager className="com.naritech.nicole.gump.RedisSessionManager"
  host="host"
  port="port"

  <!-- 必須有密碼 -->
  password="password"
  database="0"
  maxInactiveInterval="60"/>

 

3.重啟。有多少台tomcat,重復多少次上述操作。

 

4.自行驗證結果。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM