使用Docker创建一个WebSphere服务(创建失败 ⇒ 成功)

本文介绍了Docker命令,如获取镜像、查看镜像、启动WebSphere容器,并详细讲述了如何进入容器、查看密码、容器日志和端口配置。还讨论了遇到的问题,如容器访问和内核版本查询,以及Windows上安装Docker。
摘要由CSDN通过智能技术生成

目录

■前言:docker的各种参数

1.获取镜像

2.查看我拥有的镜像

3. 启动镜像 (使用镜像,生成容器,并启动容器)

4.查看密码(进入容器内部,访问容器)

5.网页执行

■.其它 (问题解决中。。。)

1.删除容器

2.Docker启动容器失败查看容器日志

3.查看启动Log

4.查看端口配置

5.查看使用帮助(此镜像对应的GitHub)

6.进入交互模式

​编辑

7.查看Docker的容器的Log

7.进入交互模式,发现容器内部可以访问

扩展,webSphere 目录结构

8.查看宿主机,docker,容器  内核版本

9.尝试更新Liunx内核  ?

10.在win10上,尝试安装Docker

■.成功


■前言:docker的各种参数

Docker命令_各种参数简介(run、v、rm、-w、-u、-e)_docker -e_sun0322的博客-CSDN博客

===

1.获取镜像

docker pull ibmcom/websphere-traditional

===

2.查看我拥有的镜像

docker images

3. 启动镜像 (使用镜像,生成容器,并启动容器)

docker run --name websphere \
       -h websphere \
             -e UPDATE_HOSTNAME=true \
       -p 9043:9043 \
       -p 9443:9443 \
       -p 443:443 \
       --restart=always \
       -v /bin/hostname:/bin/hostname \
       -v /var/run/docker.sock:/var/run/docker.sock \
       -v /usr/bin/python2:/usr/bin/python2 \
       -d ibmcom/websphere-traditional

===

4.查看密码(进入容器内部,访问容器)

docker exec ce531a58fcb4  cat /tmp/PASSWORD

fPBGmwhe

===

5.网页执行

https://IP:9043/ibm/console/login.do?action=secure

192.168.31.128https://192.168.31.128:9043/ibm/console/login.do?action=secure/ibm/console/login.do?action=secure   

进行登录,默认账号为wsadmin

wsadmin

但是访问不了。。。。。(已解决)

====

■.其它 (问题解决中。。。)

1.删除容器

docker rm id

2.Docker启动容器失败查看容器日志

https://www.cnblogs.com/lucktomato/p/16709088.html

docker inspect --format '{{.LogPath}}' cd995410052a

===

/var/lib/docker/containers/cd995410052a3c442d6fe984d9a217fd5156fd90f3b5399c3f2a0a9d5b1f39af/cd995410052a3c442d6fe984d9a217fd5156fd90f3b5399c3f2a0a9d5b1f39af-json.log

3.查看启动Log

 docker exec websphere cat /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log

4.查看端口配置

docker exec websphere cat /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/DefaultCell01/nodes/DefaultNode01/serverindex.xml

5.查看使用帮助(此镜像对应的GitHub)

GitHub - WASdev/ci.docker.websphere-traditional: Dockerfiles for WebSphere Application Server traditional

6.进入交互模式

docker exec -it 4ba0c3c5b83e bash

7.查看Docker的容器的Log

docker logs -f websphere

===

WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.

WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[/work/config-ibm/webContainer.props]"
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[DefaultNode01, websphere]"
WASX7017E: Exception received while running file "/work/updateHostName.py"; exception information: com.ibm.websphere.management.cmdframework.CommandException
com.ibm.websphere.management.cmdframework.CommandValidationException: Keystore file ${CONFIG_ROOT}/cells/DefaultCell01/nodes/DefaultNode01/key.p12 does not exist.

WASX7341W: No "save" was performed before the interactive scripting session exited; configuration changes will not be saved.
HPEL is enabled
Starting logViewer ................
Starting server ...................
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log

ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
{"type":"was_message","host":"websphere","ibm_cellName":"DefaultCell01","ibm_nodeName":"DefaultNode01","ibm_serverName":"server1","ibm_datetime":"2023-04-09T13:24:01.224+0000","ibm_sequence":"1681046641224_0000000000001","message":"************ Start Display Current Environment ************\nWebSphere Platform 9.0.5.14 [BASE 9.0.5.14 f5142244.01] [JAVA8 8.0.7.20 pxa6480sr7fp20-20221020_01] running with process name DefaultCell01\\DefaultNode01\\server1 and process id 773\nFull server name is DefaultCell01\\DefaultNode01\\server1-773\nHost Operating System is Linux, version 5.4.0-90-generic\nJava version = 1.8.0_351, Java Runtime Version = 8.0.7.20 - pxa6480sr7fp20-20221020_01(SR7 FP20), Java Compiler = j9jit29, Java VM name = IBM J9 VM\nwas.install.root = \/opt\/IBM\/WebSphere\/AppServer\nuser.install.root = \/opt\/IBM\/WebSphere\/AppServer\/profiles\/AppSrv01\nJava Home = \/opt\/IBM\/WebSphere\/AppServer\/java\/8.0\/jre\nws.ext.dirs = \/opt\/IBM\/WebSphere\/AppServer\/java\/8.0\/lib:\/opt\/IBM\/WebSphere\/AppServer\/profiles\/AppSrv01\/classes:\/opt\/IBM\/WebSphere\/AppServer\/classes:\/opt\/IBM\/WebSphere\/AppServer\/lib:\/opt\/IBM\/WebSphere\/AppServer\/installedChannels:\/opt\/IBM\/WebSphere\/AppServer\/lib\/ext:\/opt\/IBM\/WebSphere\/AppServer\/web\/help:\/opt\/IBM\/WebSphere\/AppServer\/deploytool\/itp\/plugins\/com.ibm.etools.ejbdeploy\/runtime\nClasspath = \/opt\/IBM\/WebSphere\/AppServer\/profiles\/AppSrv01\/properties:\/opt\/IBM\/WebSphere\/AppServer\/properties:\/opt\/IBM\/WebSphere\/AppServer\/lib\/startup.jar:\/opt\/IBM\/WebSphere\/AppServer\/lib\/bootstrap.jar:\/opt\/IBM\/WebSphere\/AppServer\/lib\/lmproxy.jar:\/opt\/IBM\/WebSphere\/AppServer\/lib\/urlprotocols.jar:\/opt\/IBM\/WebSphere\/AppServer\/deploytool\/itp\/batchboot.jar:\/opt\/IBM\/WebSphere\/AppServer\/deploytool\/itp\/batch2.jar:\/opt\/IBM\/WebSphere\/AppServer\/java\/8.0\/lib\/tools.jar\nJava Library path = \/opt\/IBM\/WebSphere\/AppServer\/lib\/native\/linux\/x86_64\/:\/opt\/IBM\/WebSphere\/AppServer\/java\/8.0\/jre\/lib\/amd64\/compressedrefs:\/opt\/IBM\/WebSphere\/AppServer\/java\/8.0\/jre\/lib\/amd64:\/opt\/IBM\/WebSphere\/AppServer\/bin:\/opt\/IBM\/WebSphere\/AppServer\/nulldllsdir:\/usr\/lib64:\/usr\/lib:\nOrb Version = IBM Java ORB build orb80-20220902.00\nMax file descriptor count = 1048576\n************* End Display Current Environment *************"}

===

就这样吧,等以后有时间再弄...

===

7.进入交互模式,发现容器内部可以访问

docker exec -it websphere /bin/bash

在容器中执行下面的命令

curl -k https://localhost:9043/ibm/console/logon.jsp | grep pass

扩展,webSphere 目录结构

JPA、EJB、事物管理、WebSphere ---相关内容整理_sun0322的博客-CSDN博客

===

在容器外部直接访问时,报下面的错误

 

  curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to localhost:9043

 原因,虽然开启了9043端口(处于监听状态),但是容器内的9043端口没有映射出来。

8.查看宿主机,docker,容器  内核版本

宿主机

docker

容器

 

9.尝试更新Liunx内核  ?

升级 Ubuntu Linux 内核的几种不同方法 | Linux 中国_ubuntu升级内核_TYINY的博客-CSDN博客

暂时不弄,

感觉内核时5.4,也不是非常古老的内核版本啊!

10.在win10上,尝试安装Docker

win10安装docker(适用于windows家庭版)_docker安装win10_一起玩编程的博客-CSDN博客

■.成功

今天Docker坏了,重新启动docker后,问题解决

所有docker命令无效,解决办法_sun0322的博客-CSDN博客

wsadmin
fPBGmwhe

====

使用介绍

JPA、EJB、事物管理、WebSphere ---相关内容整理_ejb websphere_sun0322的博客-CSDN博客

====

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值