Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Running MAS Manage Locally on PC or Laptop

By Dharani Dharan Eswaran posted yesterday

  

Running MAS Manage on Local PC or Laptop

The official IBM documentation provides a high-level overview of the process. The objective of this guide is to deliver comprehensive, step-by-step instructions that elaborate on the official procedures in a more detailed manner.

I would like to express my gratitude to Mikhail PastushkovAndrzej Wieclaw Witold Wierzchowski whose foundational work and published insights regarding the local Manage setup were invaluable to this effort.

Prerequisites:

  • System Hardware: 
    • Processor: 8 cores (minimum)
    • RAM: 16 GB (minimum), 32 GB (recommended for optimal performance)
  • OpenShift Environment: Requires Cluster Admin privileges on the target OpenShift cluster where the Maximo Application Suite (MAS) is running.
  • Local Software: An installed container runtime (Podman or Docker Desktop).
Note: This guide's instructions are based on procedures tested with Docker Desktop for Windows 11 version 4.47.0 (206054). Docker Desktop uses Windows Subsystem for Linux - Ubuntu.

Initial Steps:

The initial phase of the configuration involves retrieving the required container images from the OpenShift Image Registry. A critical prerequisite for this action is the exposure of the registry's default route, thereby making it accessible for the image pull operations.

Exposing the Default Route in OpenShift Web Console

  • You can expose the default route by editing the configs.imageregistry.operator.openshift.io/cluster resource.
  • Log in to the OpenShift Web Console: Access your OpenShift cluster's web console using your credentials.
  • Navigate to Administration -> CustomResourceDefinitions: In the left-hand menu, click on "Administration" and then "CustomResourceDefinitions".
  • Find Config: In the search box, type "Config" and press Enter. Click on the "Config" CustomResourceDefinition with the name configs.imageregistry.operator.openshift.io.
  • Go to the Instances Tab: Click on the "Instances" tab.
  • Edit the cluster instance: Click on the three dots next to the cluster instance and select "Edit Config".
    Switch to YAML view: If you are not already in the YAML view, click on the "YAML" tab.
    Set defaultRoute to true: In the YAML editor, find the spec section and change defaultRoute: false to defaultRoute: true. If the defaultRoute field does not exist, you can add it under the spec section.
    Save the changes: Click the "Save" button.

Manage Docker Image :

Obtaining Authentication Credentials from the OpenShift Web Console

  • Log in to the OpenShift Web Console. Navigate to the user profile menu located in the top-right corner of the interface and click on your username.
    From the resulting dropdown menu, select the Copy login command option.
  • This will copy the full login command, including a short-lived authentication token, to your clipboard. Save this command for the next procedure.

Pulling and Tagging Base Images

  • Open a command-line shell like Windows Terminal (Run as Administrator) or Mac Terminal and login to your OpenShift cluster from Docker Desktop by using the following command. (Docker Desktop should be up and running already before this command)
    Syntax:
    docker login -u <username> -p <login token from whoami saved earlier> default-route-openshift-image-registry.<cluster hostname>
    Command:
    docker login -u kubeadmin -p ⁠sha256~HnN-************************** default-route-openshift-image-registry.apps.masdemo.certussolutions.com 
  • Pull the Manage Admin base image by using the docker pull command (Image contains SMP Folder).
    Syntax:
    docker pull default-route-openshift-image-registry.<cluster hostname>/<namespace>/<image name> 
    OpenShift Web Console contains information about Namespace and Image name which is highlighted in below image.
    Namespace or Project: mas-inst1-manage
    Image Name: inst1-masdev-admin 

    Command:
    docker pull default-route-openshift-image-registry.apps.masdemo.certussolutions.com/mas-inst1-manage/inst1-masdev-admin

  • Pull the Manage UI WLP image by using the docker pull command (Image contains Websphere Liberty Runtime)
    Syntax:
    docker pull default-route-openshift-image-registry.<cluster hostname>/<namespace>/<image name> 
    Namespace and Image name can be deduced from previous step.
    Command:
    docker pull default-route-openshift-image-registry.apps.masdemo.certussolutions.com/mas-inst1-manage/inst1-masdev-ui
    Namespace: mas-inst1-manage
    Image Name: inst1-masdev-ui 
  • Tag both Manage Admin Image and Manage UI WLP image using docker tag command.
    Syntax: 
    docker tag default-route-openshift-image-registry.<cluster hostname>/<namespace>/<imagename> <tag>
    Command:
    Admin Image (SMP Folder)
    docker tag default-route-openshift-image-registry.apps.masdemo.certussolutions.com/mas-inst1-manage/inst1-masdev-admin manageadmin
    UI WLP Image (Websphere Liberty Runtime)
    docker tag default-route-openshift-image-registry.apps.masdemo.certussolutions.com/mas-inst1-manage/inst1-masdev-ui managewlp
    After tagging it would look like below in Docker Desktop

Building Manage Image (Both SMP and WebSphere Liberty Runtime)

  • IBM had already provided a Docker file for building these images locally, but I incorporated steps from other articles and enhanced it to make it more convenient for developers.
    Docker File
    ARG BUNDLE=default
    ## Use Admin image from previous as the builder
    FROM manageadmin:latest AS admin

    ARG BUNDLE
    USER root

    ## Copy maximo.properties file from Local PC to SMP Folder. Helps for EAR Build.
    COPY serverconfig/maximo.properties /opt/IBM/SMP/maximo/applications/maximo/properties/
    ## Add customizations - Optional Steps to add Custom Java Classes to SMP Applications Folder
    ## ADD applications /opt/IBM/SMP/maximo/applications

    WORKDIR /opt/IBM/SMP/maximo/applications/maximo
    RUN ls -l
    RUN echo $BUNDLE
    ## Below steps help us to make work MAS Manage to work without MAS Core Authentication
    ##Replace server.xml
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/deployment/maximo-$BUNDLE/maximo-$BUNDLE-server/
    RUN mv server.xml server-oidc.xml || echo "server.xml not found"
    RUN mv server-dev.xml server.xml || echo "server-dev.xml not found"
    ## Replace web.xml for maximo-all maximouiweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-all/maximouiweb/webmodule/WEB-INF/
    RUN ls -la
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-all maxrestweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-all/maxrestweb/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-all mboweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-all/mboweb/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-all meaweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-all/meaweb/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-cron
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-cron/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-mea maxrestweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-mea/maxrestweb/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-mea meaweb
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-mea/meaweb/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-report
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-report/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml
    ## Replace web.xml for maximo-ui
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/config-deployment-descriptors/maximo-ui/webmodule/WEB-INF/
    RUN mv web.xml web-oidc.xml
    RUN mv web-dev.xml web.xml

    ## create the EAR file
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default
    RUN ./maximo-$BUNDLE.sh
    WORKDIR /opt/IBM/SMP/maximo/deployment/was-liberty-default/deployment/maximo-$BUNDLE/maximo-$BUNDLE-server/apps/
    RUN ls -l

    ## Build the final image
    ## Remove “localhost/“ if working locally
    FROM managewlp:latest
    ARG BUNDLE
    RUN ls -l config/apps

    ## Copy the new EAR file from the admin builder
    COPY --from=admin /opt/IBM/SMP/maximo/deployment/was-liberty-default/deployment/maximo-$BUNDLE/maximo-$BUNDLE-server/apps/*.ear /config/apps/
    RUN ls -l /config/apps
    # Important Steps for making Manage Work Locally from Container. Copy the custom server.xml into the standard Liberty config location
    COPY serverconfig/server.xml /config
    COPY serverconfig/server-custom.xml /config
    #COPY SMP Folder to WLP Image - Helps us to Build EAR Next time directly from this Image.
    COPY --from=admin /opt/IBM/SMP/ /opt/IBM/SMP
    USER root
    WORKDIR /opt
    RUN mkdir -p mx-files
    RUN mkdir -p /mx-files/doclinks
    RUN mkdir -p /mx-files/mif
    # Set the env vars - Important Steps
    ENV DB_SSL_ENABLED=nossl
    ENV MXE_DB_URL='jdbc:db2://managedb2:50000/MAXDB9'
    ENV MXE_DB_SCHEMAOWNER=maximo
    ENV MXE_DB_DRIVER='com.ibm.db2.jcc.DB2Driver'
    ENV MXE_SECURITY_OLD_CRYPTO_KEY=tXwBJJjEfGwsMpmLJTKfwPki
    ENV MXE_SECURITY_CRYPTO_KEY=tXwBJJjEfGwsMpmLJTKfwPki
    ENV MXE_SECURITY_OLD_CRYPTOX_KEY=WJlJEUDzAreXkkaGCTluiufM
    ENV MXE_SECURITY_CRYPTOX_KEY=WJlJEUDzAreXkkaGCTluiufM
    ENV MXE_DB_USER=maximo
    ENV MXE_DB_PASSWORD=maximo
    ENV MXE_MASDEPLOYED=0
    ENV LC_ALL=en_US.UTF-8

    USER 1001
  • Now we will create folder named ManageLocal of our choice , under that create folder called managewlppod and save the Docker File (from previous step) to this folder.
  • Add maximo.propertiesserver.xml and server-custom.xml to above folder under serverconfig. This files has configuration to run the Manage Locally with JMS Working properly.
    server.xml (2.81 kB)
    maximo.properties (387 B)
    server-custom.xml (1.91 kB)
  • Open a command-line shell like Windows Terminal (Run as Administrator) and change the current working directory to the above folder.
  • Build the final image using below command
    Command:
    docker build --build-arg BUNDLE=all --tag manage91:latest .
    --build-arg - Passing arguments to Docker Build, here we are passing BUNDLE=all (case sensitive), this will help us to Build EAR which contains All UI,CRON,RPT in Single EAR.
    --tag : Name of the Final Image - manage91 (Any Name of our choice, it will be used in Next Step).
    .  : This is very important to denote the command to look for Docker file in current directory.

    Now Manage image is ready to run locally.

Database Docker Image (Optional):

This step is optional if you are connecting to your company development database. Just alter the maximo.properties used in previous step to point it to your development db.
if you want to setup Maximo Demo database, continue following steps below.

Prepare and Building Database Docker Image - Db2

  • Create folder named db2pod in the same ManageLocal Directory.
  • Add 2 files init-db2.sh and setup_db2_instance.sh to db2pod directory.
    init-db2.sh (1.76 kB)- This contains custom steps needed for Maximo Database, like Schema creation , database user creation.
    setup_db2_instance.sh (6.4 kB)- this is modified file DB2 setup file. Fixed permission issue for db2iadm1 user - related to DB2 container not starting properly after initial execution.
  • Create Docker file for Db2 image

    Docker file
    FROM icr.io/db2_community/db2

    COPY ./setup_db2_instance.sh /var/db2_setup/lib/setup_db2_instance.sh
    COPY ./init-db2.sh /var/custom/init-db2.sh
    RUN chmod +x /var/custom/init-db2.sh
  • Open a command-line shell like Windows Terminal (Run as Administrator) and change the current working directory to the above folder (db2pod).
    Now build db2 image using below command
    docker build --tag db2mng91:latest .

Running Manage in Docker Desktop

we now have manage91 image and db2mng91 image ready for running in docker desktop. we will use docker-compose command to run and maintain our Local Manage containers.

Running Manage and Db2 for Manage in Docker Desktop

  • Create a new docker-compose file called docker-compose-manage91.yaml in the root folder of our project - ManageLocal

    docker-compose-manag91.yaml
    services:
    # --- Manage DB2 Server V912 DB Demo Data---
    mxdb2pod:
    image: db2mng91:latest #Our Image name from previous step
    hostname: managedb2
    container_name: mng-db2-v912
    restart: always
    privileged: true
    mem_limit: 4096m # Limit to 4 GB RAM
    cpus: 1.5
    ports:
    - "50000:50000"
    environment:
    - LICENSE=accept
    - DB2INSTANCE=db2inst1
    - DB2INST1_PASSWORD=maximo
    - DBNAME=MAXDB9
    volumes:
    - mngdb2data:/database
    networks:
    - managelan
    # --- Manage v912 Installed and WLP App Server---
    mxwlppod:
    build:
    context: ./managewlppod
    args:
    BUNDLE: "all"
    image: manage91:latest #Our Image name from previous step
    container_name: mngsmp-wlp-v912
    hostname: manage91
    restart: always
    depends_on:
    - mxdb2pod
    ports:
    - "9080:9080"
    - "9443:9443"
    - "7777:7777"
    volumes:
    - ./managewlppod/logs:/logs/
    - ./managewlppod/mif:/opt/mx-files/mif
    - ./managewlppod/doclinks:/opt/mx-files/doclinks
    environment:
    - TZ=Pacific/Auckland
    - LC_ALL=en_US.UTF-8
    # - JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:7777
    # command: ["server", "debug", "defaultServer"]
    mem_limit: 8192m # Limit to 8 GB RAM
    cpus: 2.0 # Limit to 2 CPUs
    networks:
    - managelan
    volumes:
    mngdb2data:
    driver: local
    networks:
    managelan:
    driver: bridge
  if you don’t wan to run db2 locally, remove the  mxdb2pod section completely and update maximo.properties file in ear to point to database you wanted to connect.
  • Open a command-line shell like Windows Terminal (Run as Administrator) and change the current working directory to the above folder (ManageLocal).
    Execute below command to run the docker images as container.
    Command:
    docker compose -p mx-db2-v912 -f .\docker-compose-manage91.yaml up -d
    -p : Project Name in Docker
    -f: To Specify docker compose File to the command.
    up -d : Instruct the docker to start the containers listed in docker compose file. (-d signifies detached mode)

  • Db2 Container - mng-db2-v912 will take few minutes to get started. Custom init-db2.sh will create required db user, schema for maximo demo database.
    Now we have to install demo data using maxinst command. to do that first we need to connect to mngsmp-wlp-v912 container using docker exec command.
    Command:
    docker exec -u root -it mngsmp-wlp-v912 bash
  • Now we have to execute the MAXINST command as below
    Command:
    cd /opt/IBM/SMP/maximo/tools/maximo
    ./maxinst.sh -sMAXDATA -tMAXDATA -imaxdemo

    This installs Demo Database to Db2 Container and ready for connections.
  • Before accessing Maximo ensure the mngsmp-wlp-v912 container is restarted after MAXINST and wlp is connecting to db2 properly. monitor the logs in Docker Desktop UI.

Access Manage and Db2

  • Accessing the Manage Locally in browser using below URL
    http://localhost:9080/maximo or https://localhost:9443/maximo
    Use Default Demo Credentials for maxadmin / maxadmin
  • Accessing DB2 from DBeaver or SQL Developer using below Details
    Hostname: localhost
    Port: 50000
    Database: MAXDB9
    Username: maximo
    Password: maximo
  • Logs can be found in our Project folder as shown

    Folders for doclinks and MIF Files are stored under same path as shown


0 comments
15 views

Permalink