WebSphere Application Server traditional in Containers
Recipe
- Review the Java in Containers recipes
- Execute
/work/configure.sh
as the last step in your Containerfile - Review the WAS traditional recipes
- Review the Java recipe
- Review the Operating System Recipes
Container Images
- WebSphere
Application Server traditional images:
- 9.0.5:
FROM icr.io/appcafe/websphere-traditional
- 8.5.5:
FROM icr.io/appcafe/websphere-traditional:8.5.5.26
- See all tags:
curl -s https://icr.io/v2/appcafe/websphere-traditional/tags/list | jq .tags
- 9.0.5:
Resources
- https://github.com/WASdev/ci.docker.tutorials
- https://github.com/WASdev/ci.docker.websphere-traditional/blob/master/docker-build/9.0.5.x/Dockerfile
- https://github.com/WASdev/ci.docker.ibm-http-server/blob/master/production/Dockerfile.install
Log Analysis Dashboards
WAS traditional provides a Kibana dashboard example.
Build Example
- Create
Containerfile
:FROM icr.io/appcafe/websphere-traditional COPY --chown=was:root twasdiag.ear /work/app/ COPY --chown=was:root trace.jy /work/config/ RUN /work/configure.sh
twasdiag.ear
taken from https://github.com/IBM/twasdiag/releases/latesttrace.jy
:AdminControl.setAttribute(AdminControl.queryNames('type=HPELLogDataService,process=server1,*'), "purgeMaxSize", "1024")
- Build:
podman build --platform linux/amd64 -t twas .
- Run:
podman run --rm --platform linux/amd64 -p 9043:9043 -p 9443:9443 twas
- Access:
- Administrative Console: https://localhost:9043/ibm/console
twasdiag
: https://localhost:9443/twasdiag
Run Examples
With a custom password
Create a file in the current directory named PASSWORD with an administrative password as its contents. For example:
wsadmin
Then run:
podman run --rm --platform linux/amd64 -p 9043:9043 -p 9443:9443 -v $(pwd)/PASSWORD:/tmp/PASSWORD -e ENABLE_BASIC_LOGGING=true icr.io/appcafe/websphere-traditional
With an auto-generated password
With an auto-generated password:
podman run --rm --platform linux/amd64 -p 9043:9043 -p 9443:9443 -e ENABLE_BASIC_LOGGING=true icr.io/appcafe/websphere-traditional
After you see "open for e-business", access the administrative console with the user name wsadmin and the password from the PASSWORD file at https://localhost:9043/ibm/console/login.do?action=secure
To find the password, first find the container; for example:
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3c7a57912f96 icr.io/appcafe/websphere-traditional:latest env JVM_EXTRA_CMD... 47 seconds ago Up 47 seconds 0.0.0.0:9043->9043/tcp, 0.0.0.0:9443->9443/tcp vigilant_knuth
Then cat
the file in the container; for example:
podman exec -it 3c7a57912f96 cat /tmp/PASSWORD
Common Actions
Dynamically Set Diagnostic Trace
- Exec into the container
- Start wsadmin:
/opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -lang jython
- Set trace:
AdminControl.invoke(AdminControl.completeObjectName("type=TraceService,process=server1,*"), "setTraceSpecification", "*=info:com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement=all:com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement=all:com.ibm.ws.rsadapter.jdbc.WSJdbcStatement=all")
- Exit wsadmin:
exit
wsadmin examples
Copy *.py
files into /work/config/
.
- Print static HPEL configuration:
print AdminConfig.showall(AdminConfig.list("HPELLog", AdminConfig.getid("/Cell:DefaultCell01/Node:DefaultNode01/Server:server1/HighPerformanceExtensibleLogging:/")))
- Print dynamic HPEL configuration:
print AdminControl.getAttribute(AdminControl.queryNames('type=HPELLogDataService,process=server1,*'), "purgeMaxSize")
- Update HPEL
log and trace settings to a max disk usage of 1GB each:
print "Updating trace settings" AdminConfig.modify(AdminConfig.list("HPELLog", AdminConfig.getid("/Cell:DefaultCell01/Node:DefaultNode01/Server:server1/HighPerformanceExtensibleLogging:/")), "[[purgeMaxSize 1000]]") AdminConfig.modify(AdminConfig.list("HPELTrace", AdminConfig.getid("/Cell:DefaultCell01/Node:DefaultNode01/Server:server1/HighPerformanceExtensibleLogging:/")), "[[purgeMaxSize 1000]]") AdminConfig.save()