docker linux centos tomcat session 共享问题

19 篇文章 0 订阅
18 篇文章 0 订阅

docker linux centos tomcat session 共享问题

 

37.6 安装一个 session 共享的 tomcat

 

37.6.0  准备工作

需要一个 curiousby/centos-ssh-root-java-tomcat
需要 commons-pool2-2.2.jar jedis-2.5.2.jar   tomcat-redis-session-manage-tomcat.jar

 

37.6.1 编辑 tomcat  context.xml

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
    <Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" database="0" host="192.168.206.238" maxInactiveInterval="60"  port="6379"/>

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->
   <Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve"/>


</Context>

 

 

37.6.2 编辑 dockerfile

############################################
# version:apache-tomcat-7.0.75
# desc : 当前版本安装的7.0.75
############################################

# 设置继承自我们创建的 tools 镜像
FROM curiousby/centos-ssh-root-java-tomcat:original

# 下面是一些创建者的基本信息
MAINTAINER baoyou curiousby@163.com


COPY context.xml /usr/local/tomcat/conf/

COPY commons-pool2-2.2.jar /usr/local/tomcat/lib/

COPY jedis-2.5.2.jar  /usr/local/tomcat/lib/

COPY tomcat-redis-session-manage-tomcat.jar /usr/local/tomcat/lib/

 

37.6.3 执行命令

docker build -t  curiousby/centos-ssh-root-java-tomcat-session:original  .
docker run -d -v /home/baoyou/soft/centos-ssh-root-java-tomcat-session/jenkins/:/usr/local/tomcat/webapps/  -p 8080:8080 curiousby/centos-ssh-root-java-tomcat-session:original 
 

 

37.6.4 运行日志

Sending build context to Docker daemon  245.6MB
Step 1/6 : FROM curiousby/centos-ssh-root-java-tomcat:original
 ---> 7dd208c74262
Step 2/6 : MAINTAINER baoyou curiousby@163.com
 ---> Running in c3fa61a42d5d
 ---> 6d26863ed093
Removing intermediate container c3fa61a42d5d
Step 3/6 : COPY context.xml /usr/local/tomcat/conf/
 ---> 69fb214698f6
Removing intermediate container 5c2c3a14da7f
Step 4/6 : COPY commons-pool2-2.2.jar /usr/local/tomcat/lib/
 ---> 3a020dc6a710
Removing intermediate container df207dc60e6f
Step 5/6 : COPY jedis-2.5.2.jar /usr/local/tomcat/lib/
 ---> c88143473183
Removing intermediate container 34323368ef8a
Step 6/6 : COPY tomcat-redis-session-manage-tomcat.jar /usr/local/tomcat/lib/
 ---> fea957b8ad41
Removing intermediate container b715482e29ab
Successfully built fea957b8ad41
Successfully tagged curiousby/centos-ssh-root-java-tomcat-session:original

 

 

37.6.5 测试

http://192.168.206.238:8080/jenkins/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

捐助开发者 

在兴趣的驱动下,写一个免费的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信 以及扣扣群),没钱捧个人场,谢谢各位。

 

个人主页http://knight-black-bob.iteye.com/



 
 
 谢谢您的赞助,我会做的更好!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值