博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在 Docker容器中安装WebSphere 8.5
阅读量:6496 次
发布时间:2019-06-24

本文共 9508 字,大约阅读时间需要 31 分钟。

hot3.png

Cyper的笔记:
All the files downloaded to `/home/cyper/Downloads/java/bluemix_luna_liberty_cf`
Steps:
1. 下载Eclipse JEE Luna
2. 安装IBM WDT插件(IBM WebSphere Application Server Developer Tools)(通过wasdev.net可以下载updatesite离线包)
3. 安装Liberty runtime(通过wasdev.net可以下载runtime离线包,这里有视频教程:https://www.youtube.com/watch?v=A6pwGuBgiEI)
4. 安装完整的WAS8.5.5(unzip and sudo ./install) (这是个配置好Installation Manager包1.8.x,大概100多M,可以在http://www.ibm.com/developerworks/downloads/ws/wasdevelopers/下载, 使用Http的方式会比较靠谱)
3和4选任意一个都行。
最终我安装的位置:
    Package Group Name: IBM WebSphere Application Server V8.5
    Installation Dir: /opt/IBM/WebSphere/AppServer
    Shared Resources Dir: /opt/IBM/IMShared
我把/opt/IBM/WebSphere/AppServer设置为了$washome
这个过程需要下载1015.65 MB的文件。好在不需要翻墙。速度还不错。
read here: `http://stackoverflow.com/questions/15516741/websphere-application-server-developer-tools-for-eclipse-how-to?rq=1`
and here
`http://veithen.github.io/2014/11/02/running-was-in-docker.html`

for some ideas.

补充4:

解压然后运行sudo ./install
安装组件选择
    1. WAS8.5.5.5 for developers
    2. WAS Liberty for developers
    3. IBM JDK 1.7 for WAS
    4. IBM JDK 1.7 for Liberty
后3个组件我开始没选。WAS8.5默认会装IBM JDK6. 重新运行上面的sudo ./install命令可以修改安装内容。重新选择后3个包.
这里有篇文章,如何升级WAS8.5默认JDK到JDK7:
http://stackoverflow.com/questions/25223122/java-7-1-in-ibm-websphere/25223414#25223414
两个有用的命令:
    $washome/bin/managesdk.sh -listAvailable
    $washome/managesdk.sh -enableProfile -profileName AppSrv02 -sdkname 1.7_64

以下是原文(其中的安装全部使用shell命令完成,值得学习, 推荐Beginning.Linux.Programming4th.pdf,Shell一章讲得非常好):
转载自:http://veithen.github.io/2014/11/02/running-was-in-docker.html
November 2, 2014(updatedFebruary 24, 2015)

Introduction

This article describes how to run WebSphere Application Server in a Docker container. We are going to use the of WAS 8.5.5 to create a full profile, but the instructions can easily be adapted to a regular WebSphere version (provided you have an appropriate license) or a different WebSphere 8.x version. Note however that the solution will not work with WAS 7.0 because the installation procedure is completely different.

Creating the Docker image

To create the Docker image, for Linux x86_64 and use the following Dockerfile, after replacing the-userNameand-userPasswordarguments with your IBM ID:

FROM centos:centos6RUN yum install -q -y unzipADD agent.installer.linux.gtk.x86_64_*.zip /tmp/RUN \ unzip -qd /tmp/im /tmp/agent.installer.linux.gtk.x86_64_*.zip && \ /tmp/im/installc \   -acceptLicense \   -showProgress \   -installationDirectory /usr/lib/im \   -dataLocation /var/im && \ rm -rf /tmp/agent.installer.linux.gtk.x86_64_*.zip /tmp/imRUN \ REPO=http://www.ibm.com/software/repositorymanager/V85WASDeveloperILAN && \ /usr/lib/im/eclipse/tools/imutilsc saveCredential \   -url $REPO \   -userName my.ibm.id@mydomain.com \   -userPassword mypassword \   -secureStorageFile /root/credentials && \ /usr/lib/im/eclipse/tools/imcl install \   com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5003.20140730_1249 \   -repositories $REPO \   -acceptLicense \   -showProgress \   -secureStorageFile /root/credentials \   -sharedResourcesDirectory /var/cache/im \   -preferences com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false \   -installationDirectory /usr/lib/was && \ rm /root/credentialsRUN useradd --system -s /sbin/nologin -d /var/was wasRUN \ hostname=$(hostname) && \ /usr/lib/was/bin/manageprofiles.sh -create \   -templatePath /usr/lib/was/profileTemplates/default \   -profileName default \   -profilePath /var/was \   -cellName test -nodeName node1 -serverName server1 \   -hostName $hostname && \ echo -n $hostname > /var/was/.hostname && \ chown -R was:was /var/wasUSER wasRUN echo -en '#!/bin/bash\n\set -e\n\node_dir=/var/was/config/cells/test/nodes/node1\n\launch_script=/var/was/bin/start_server1.sh\n\old_hostname=$(cat /var/was/.hostname)\n\hostname=$(hostname)\n\if [ $old_hostname != $hostname ]; then\n\  echo "Updating configuration with new hostname..."\n\  sed -i -e "s/\"$old_hostname\"/\"$hostname\"/" $node_dir/serverindex.xml\n\  echo $hostname > /var/was/.hostname\n\fi\n\if [ ! -e $launch_script ] ||\n\   [ $node_dir/servers/server1/server.xml -nt $launch_script ]; then\n\  echo "Generating launch script..."\n\  /var/was/bin/startServer.sh server1 -script $launch_script\n\fi\n\' > /var/was/bin/updateConfig.sh && chmod a+x /var/was/bin/updateConfig.sh# Speed up the first start of a new containerRUN /var/was/bin/updateConfig.shRUN echo -en '#!/bin/bash\n\set -e\n\/var/was/bin/updateConfig.sh\n\echo "Starting server..."\n\exec /var/was/bin/start_server1.sh\n\' > /var/was/bin/start.sh && chmod a+x /var/was/bin/start.shCMD ["/var/was/bin/start.sh"]

Note that by executing this Dockerfile you accept the license agreement for IBM Installation Manager and WebSphere Application Server for Developers.

Known issues

The execution of theimutilscmay fail with the following error, even though you have specified a valid user name and password:

Cannot connect to the URL.  - Verify that the URL is correct.  - Verify that the user name and password are correct.  - Verify that you can access the network.

The root cause for that is IBM inability to correctly configure its CDN:

$ curl -i http://www.ibm.com/software/repositorymanager/V85WASDeveloperILAN/HTTP/1.1 302 Moved TemporarilyCache-Control: max-age=301Expires: Tue, 24 Feb 2015 23:14:44 GMTContent-Type: text/htmlLocation: https://www-912.ibm.com/software/repositorymanager/V85WASDeveloperILAN/Content-Length: 255epKe-Alive: timeout=10, max=7Date: Tue, 24 Feb 2015 23:09:43 GMTConnection: keep-alive302 Found

Found

The document has moved here.

$ curl -I http://www.ibm.com/software/repositorymanager/V85WASDeveloperILAN/HTTP/1.1 503 Service UnavailableServer: AkamaiGHostMime-Version: 1.0Content-Type: text/htmlContent-Length: 177Expires: Tue, 24 Feb 2015 23:09:52 GMTDate: Tue, 24 Feb 2015 23:09:52 GMTConnection: keep-alive$

The output of these two commands show that a GET request to the repository URL gets redirected with HTTP status 302, while a HEAD request for the same URL results in a 503 error. The problem is thatimutilscuses a HEAD request and therefore fails. The work around this issue, replace the value of theREPOvariable with the location obtained from the 302 response. In the example shown above, this would behttps://www-912.ibm.com/software/repositorymanager/V85WASDeveloperILAN/.

How it works

Here are some more details about the Dockerfile:

  • Only IBM Installation Manager needs to be downloaded before creating the image. The product itself (WebSphere Application Server for Developers 8.5.5) is downloaded by Installation Manager during image creation. Note that this may take a while. ThepreserveDownloadedArtifacts=falsepreference instructs Installation Manager to remove the downloaded packages. This reduces the size of the image.

  • The Dockerfile creates a default application server profile that is configured to run as a non-root user. The HTTP port is 9080 and the URL of the admin console ishttp://...:9060/ibm/console. New containers should typically be created with the following options:-p 9060:9060 -p 9080:9080. Refer to the page in the Knowledge Center for a complete list of ports used by WAS. Note that this page doesn’t mention the default port used for remote debugging, which is 7777.

  • To see the WebSphere server logs, use the following command (requires Docker 1.3):

    docker exec 
    tail -F /var/was/logs/server1/SystemOut.log
  • Docker assigns a new hostname to every newly created container. This is a problem because theserverindex.xmlfile in the configuration of the WebSphere profile contains the hostname. That is to say that WebSphere implicitly assumes that the hostname is static and not expected to change after the profile has been created. To overcome this problem the Dockerfile adds a script calledupdateConfig.shto the image. That script is executed before the server is started and (among other things) updates the hostnames inserverindex.xmlwhen necessary.

  • Docker expects the RUN command to run the server process in the foreground (instead of allowing it to detach) and to gracefully stop the server when receiving a TERM signal. WebSphere’sstartServer.shcommand doesn’t meet these requirements. This issue is solved by using the-scriptoption, which tellsstartServer.shto generate a launch script instead of starting the server. This launch script has the desired properties and is used by the RUN command. This has an additional benefit: thestartServer.shcommand itself takes a significant amount of time (it’s a Java process that reads the configuration and then starts a separate process for the actual WebSphere server) and skipping it reduces the startup time.

    There is however a problem with this approach. The content of the launch script generated bystartServer.shdepends on the server configuration, in particular the JVM settings specified inserver.xml. When they change, the launch script needs to be regenerated. This can be easily detected and theupdateConfig.shscript added by the Dockerfile is designed to take care of this.

  • The RUN command is a script that first runsupdateConfig.shand then executes the launch script. In addition to that,updateConfig.shis also executed once during the image creation. This will speed up the first start of a new container created from that image, not only because the launch script will already exist, but also because the very first execution of thestartServer.shscript typically takes much longer to complete.

转载于:https://my.oschina.net/uniquejava/blog/464150

你可能感兴趣的文章
Android UI SurfaceView的使用-绘制组合图型,并使其移动
查看>>
C# 属性、索引
查看>>
(转)Java多线程之Lock的使用 (待整理)
查看>>
Java中Filter、Servlet、Listener的学习
查看>>
Java Code Examples for javax.servlet.http.Part
查看>>
为什么使用模块?
查看>>
【转】让Chrome化身成为摸鱼神器,利用Chorme运行布卡漫画以及其他安卓APK应用教程...
查看>>
细说Debug和Release区别
查看>>
Oracle分页
查看>>
WPF学习拾遗(二)TextBlock换行
查看>>
ADSL自动更换IP地址源代码
查看>>
关于第三方IOS的checkBox框架的使用
查看>>
-bash: /bin/rm: Argument list too long的解决办法
查看>>
7.10 数据注解特性--NotMapped
查看>>
Oracle 12C -- 清空audit记录
查看>>
centos7 install mysql
查看>>
ReferenceQueue的使用
查看>>
【设计模式】享元模式
查看>>
Angular - - $sce 和 $sceDelegate
查看>>
判断圆和矩形是否相交
查看>>