史上最靠谱的Websphere Liberty 配置,完全可用的支持DB2应用
来源:互联网 发布:稳定性最好的单片机 编辑:程序博客网 时间:2024/06/03 19:53
为什么写这个,主要是最新的一个项目,用到了was liberty,但是整个网路上,相关配置信息较少,而且可实践得不多,查官方文档又太慢了,最后得力于N年前的项目实战,辛苦的找到了这个配置文件,记录下来,以便未来使用,WAS liberty的好处,主要可以归结为3点
1,配置简单;2, 更改配置不需要重新启动服务,tomcat是需要的。3, 多应用部署效率高,稳定性比Tomcat要好不少。
使用Docker,在docker资源库中,你能轻易的发现WAS Liberty 提供的仅用于开发环境的镜像,下载下来启动一个容器,命令如下:
$docker run -d -p 9080:9080 -p 9443:9443 <image id> /bin/bash
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
440817ee2598 websphere-liberty "/opt/ibm/docker/d..." 25 hours ago Up 21 hours 0.0.0.0:9080->9080/tcp, 0.0.0.0:9443->9443/tcp nostalgic_feynman
启动后的容器后,你需要做几件事情来完成部署:
1. 要做的是将你的应用war包上传到容器中的/opt/ibm/wlp/usr/servers/defaultServer/apps中
2. 拷贝DBMS Driver jars(db2jcc_license_cu.jar, db2jcc4.jar) 到 /opt/ibm/wlp/usr/shared/resources 目录中
3. 在440817ee2598:/opt/ibm/wlp/usr/servers/defaultServer 下有个server.xml文件,你需要的是通过docker cp 命令将其下载到本地进行编辑,编辑如下:<?xml version="1.0" encoding="UTF-8"?>
<server description="Default server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
<feature>jndi-1.0</feature>
</featureManager>
<!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. -->
<!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an
encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element.
Then uncomment the keyStore element. -->
<!--
<keyStore password=""/>
-->
<!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the
basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password,
generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element.
Then uncomment the user element. -->
<basicRegistry id="basic" realm="BasicRealm">
<!-- <user name="yourUserName" password="" /> -->
</basicRegistry>
<!-- To allow access to this server from a remote client host="*" has been added to the following element -->
<httpEndpoint id="defaultHttpEndpoint"
host="*"
httpPort="9080"
httpsPort="9443" />
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor dropins="dropins" updateTrigger="mbean"/>
<application context-root="/iba" location="iba-web.war" id="iba" name="iba" type="war">
<classloader commonLibraryRef="DB2DriverLib"/>
</application>
<application context-root="/ibaid" location="iba-prelogin.war" id="ibaid" name="ibaid" type="war"/>
<library id="DB2DriverLib">
<fileset dir="${shared.resource.dir}" includes="db2jcc_license_cu.jar, db2jcc.jar"/>
</library>
<dataSource id="jdbc/iba_dev" jndiName="jdbc/iba_dev" type="javax.sql.DataSource" transactional="true">
<jdbcDriver libraryRef="DB2DriverLib"/>
<connectionManager maxPoolSize="50" minPoolSize="5" connectionTimeout="10s"/>
<properties databaseName="IBADB"
driverType="4"
serverName="127.0.0.1"
portNumber="50000"
user="wbaadmin"
password="wbaadmin"/>
</dataSource>
</server>
编辑完成后,保存,并用docker cp 命令上传到容器中,这时候,你可能需要重启Liberty 服务:
切换到/opt/ibm/docker/目录下,你能够看到docker-server的一个服务
./docker-server stop 后,你需要重新启动这个容器,通过使用docker start <容器 id>后,WAS Liberty 其实也自动启动了。可以通过ps -ef 命令来看进程。
这样就完成了部署应用。最后访问 http://localhost:9080/iba 或者https://localhost:9443/iba来尝试。
- 史上最靠谱的Websphere Liberty 配置,完全可用的支持DB2应用
- WebSphere V5.1的配置(DB2)
- WebSphere连接AS400的DB2
- OpenStack Liberty版本对容器支持的详解
- WebSphere和DB2调优的建议
- weblogic websphere 和 liberty profile 在使用struts2中遇到的URLClassLoader [struts2CleanupFilter]未装入
- websphere 的SSL配置
- websphere-JConsole的配置
- WebSphere DataStage Enterprise Edition 实践 并行访问多节点 DB2 的配置与实现
- websphere liberty 装配 部署
- WebSphere Liberty 一瞥
- Websphere liberty cluster installation
- WebSphere 多个应用间的单点登录配置,SSO
- AIX通过HACMP实现 WebSphere Message Broker V6.1 的高可用配置
- 关于 WebSphere 的应用部署
- 关于 WebSphere 的应用部署
- 关于 WebSphere 的应用部署
- WebSphere Application Server V7 支持OSGi 应用 and JPA2.0 的特性包
- [leetcode]Container With Most Water
- 【LeetCode】63. Unique Paths II
- Redis的安装(单机|集群)
- linux ftp 上传文件命令
- VC++使用CImage在内存中Bmp转换Jpeg图片
- 史上最靠谱的Websphere Liberty 配置,完全可用的支持DB2应用
- unix 文件系统
- 欢迎使用CSDN-markdown编辑器
- linux下tomcat指定jdk和配置运行参数
- 读书笔记--机器学习第一章
- 数独的简单实现
- 读书笔记--机器学习第二章
- ShareSDK入门指南:Android 10分钟快速集成
- overflow滚动条消失小技巧