webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 2 days ago

    Hi All,

    I am trying to run webMethods Microservices Runtime (MSR) using the image from containers.webmethods.io, which by default spins up with an embedded database.

    As expected, when I create schedulers, they are successfully created during runtime. However, upon container restart, the scheduler information disappears-this aligns with the default behavior since scheduler metadata is stored in the database.

    Now, I would like to configure MSR to use an external database instead, so that all JDBC pools are preloaded and persisted across restarts.

    Could someone guide me on:

    1. How to run the Database Configurator against the image from containers.webmethods.io?

    2. How to configure the container to connect to and use the external database for core functionality (e.g., scheduler persistence, JDBC pools)?

    3. when i add application.properties file in the Dockerfile i see the file is getting loaded as root user instead of sagadmin:root even after specifying below content
      1. From ibmimage:10.15
        ENV SAG_HOME /opt/softwareag
        ENV LANG C.utf8
        COPY --chown=sagadmin:root application.properties ${SAG_HOME}/IntegrationServer/application.properties
        USER sagadmin

    Appreciate your support.

    Regards,
    Abhijith



    ------------------------------
    Abhijith Parre
    ------------------------------


  • 2.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 2 days ago

    With such a requirement I would recommend to build your own container image that is customized to your needs.



    ------------------------------
    All the best,
    Christoph
    ------------------------------



  • 3.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 22 hours ago

    If you need WmMonitor, then you need to build a custom image using the webMethods installer. There's no way of installing WmMonitor using wpm and packages.webmethods.io

    As for the database configurator, a custom image can also be built using the installer (but it should be a dedicated image, it should be kept outside the MSR image.)



    ------------------------------
    Stephane Tailland
    ------------------------------



  • 4.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 2 days ago
    Edited by engin sarlak 2 days ago

    I recommend using configuration variables and Helm charts. Imo creating your own container for this purpose is an overkill. Here is the helm repo. 

    You can find the samples within the product you are planning to use. 

    To your other question, you don't need to run DBconfigurator from the server. You can install it anywhere (including your local) and run it from that location. 


    ------------------------------
    engin sarlak
    ------------------------------



  • 5.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 2 days ago

    Hi engin

    Yes i have used the configuration template and gave this 

    jdbc.ISInternalPool.dbURL=jdbc\:wm\:postgresql\://localhost\:5432;databaseName\=IS_1015
    jdbc.ISInternalPool.userid=postgres
    jdbc.ISInternalPool.password=*****
    jdbc.ISInternalPool.minConns=0
    jdbc.ISInternalPool.maxConns=10
    jdbc.ISInternalPool.poolThreshold=80
    jdbc.ISInternalPool.waitingThread=5
    jdbcfunc.ISInternal.connPoolAlias=ISInternalPool

    my dockerfile has this content

    FROM SAGIMage:10.15
    #RUN yum install -y wget && yum clean all
    #RUN yum install -y procps && yum clean all
    #RUN groupadd -g 1724 sagadmin; useradd -u 1724 -m -g 1724 -d ${SAG_HOME} sagadmin
    #COPY --chown=1724:1724 ./Licenses/ ${SAG_HOME}/Licenses/
    COPY --chown=sagadmin:root postgresql-42.7.3.jar /opt/softwareag/IntegrationServer/lib/jars
    COPY --chown=sagadmin:root application.properties /opt/softwareag/IntegrationServer/application.properties
    USER sagadmin

    while running docker i am giving it as

    docker run -d --name msrcontainer -p 8765:5555 -v C:\Users\AbhijithP\Desktop\application.properties:/opt/data/application.properties -e SAG_IS_CONFIG_PROPERTIES=/opt/data/application.properties SAGImage:10.15

    Even after this i see jar is not copied nor the external db is configured in the JDBC pools. 

    I want to know how in MSR the scheduler information is stored because in Embedded DB the data doesnt get stored anyway



    ------------------------------
    Abhijith Parre
    ------------------------------



  • 6.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 2 days ago
    Edited by engin sarlak 2 days ago

    If you are building your own container, then you should configure them on the container then create the image. I liked helm charts because you don't need to build your own image, and it will download it from webMethods repo directly and you can also get the most up to date fixes just by updating the container image in the helm chart, or with a parameter during cluster startup. If you don't follow this path, it might get extremely annoying and troublesome depending on your docker skills. 

    If you are not running MSR on kub8, it should persist any changes you make through Admin UI as long as you don't delete the persistent storage location. As a rule of thumb, I never customize unless I have to! Most of the changes you are doing to your container image are unnecessary. Check the persistent storage configurations. By default it should create them for you.

    If you are running MSR on kub8, give helm charts a chance to do it for you. I know yaml can be annoying and challenging, but if you keep committing frequently whenever you have a working version, its pretty easy. Helm charts will configure all of your containers, MSR, MWS, UM, Api GW and so on.

    FYI, its pretty straightforward in helm charts. This is where you place your configuration parameters. 

    And here is the link to the sample where it has a configured parameters for JDBC. When you build your own configuration template, you need to build it properly, meaning it should have the pool alias definition and then you need to map it to your functions. You might have a typo or syntax error in that file. Try downloading the sample from git, and then modify it. 


    ------------------------------
    engin sarlak
    ------------------------------



  • 7.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 22 hours ago

    Don't modify the internal pool ISInternalPool

    Don't copy inside the container image properties files that contain hard coded values, for it makes your image environment specific and it can also cause security issues since your secrets become visible to anyone who can pull the image.

    Use environment variables ($env{ENV_VARIABLE_NAME}) and and secrets ($secrets{SECRET_KEY_NAME})



    ------------------------------
    Stephane Tailland
    ------------------------------



  • 8.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 22 hours ago

    Here's a values.yaml file you can use with the Helm Charts, which mounts a properties file from a config map.

    # -- Number of replicates in Deployment
    replicaCount: 1
    
    statefulSet: false
    
    image:
      repository: "<your_image>"
      pullPolicy: Always
      tag:        "<your_tag>"
    
    imagePullSecrets: 
     - name: cr-regcred
    
    nameOverride: ""
    fullnameOverride: "event-producer"
    
    containerName: msr-event-producer
    
    extraEnvs: 
    - name: SERVER
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    
    
    secretMounts:
      - name: msr-secrets
        secretName: msr-secrets
        path: /etc/secrets
      - name: es-truststore-secret
        secretName: es-truststore-secret
        path: /opt/softwareag/common/conf/keys
    
    secretVolumes:
      - name: msr-secrets
        secretName: msr-secrets
      - name: es-truststore-secret
        secretName: es-truststore-secret
    
    startupProbe: 
      tcpSocket:
        port: http
      initialDelaySeconds: 20
      failureThreshold: 32
      periodSeconds: 5            
    
    livenessProbe: 
      httpGet:
        path: /health/liveness
        port: http
      initialDelaySeconds: 0
      periodSeconds: 15
      timeoutSeconds: 2
      successThreshold: 1
      failureThreshold: 3
    
    readinessProbe: 
      httpGet:
        path: /health/readiness
        port: http
      initialDelaySeconds: 0
      periodSeconds: 15
      timeoutSeconds: 2
      successThreshold: 1
      failureThreshold: 3
    
    microservicesruntime:
      httpsPort:                5543
      httpsPortScheme:          "HTTPS"
      httpPort:                 5555
      httpPortScheme:          "HTTP"
      diagnosticPort:           9999
    
      licenseKeyProvided: false
    
      memoryHeap:
        min:                    "512M"
        max:                    "1024M"
    
      installDir:      /opt/softwareag/IntegrationServer 
    
      propertiesFile: 
        content: |
          truststore.ES_TRUSTSTORE.ksLocation=/opt/softwareag/common/conf/keys/es-truststore.p12
          truststore.ES_TRUSTSTORE.ksPassword=$secret{ES_TRUSTSTORE_PASSWORD}
          truststore.ES_TRUSTSTORE.ksStoreProviderName=SUN
          truststore.ES_TRUSTSTORE.ksType=PKCS12
    
          jdbc.wmdb.dbURL=$secret{POOL_JDBC_URL}
          jdbc.wmdb.userid=$secret{POOL_DB_USERNAME}
          jdbc.wmdb.password=$secret{POOL_DB_PASSWORD}
          jdbc.wmdb.driverAlias=DataDirect Connect JDBC PostgreSQL Driver
          jdbcfunc.ISCoreAudit.connPoolAlias=wmdb
          jdbcfunc.ISInternal.connPoolAlias=wmdb
          jdbcfunc.ProcessAudit.connPoolAlias=wmdb
    
          jdbc.wmdb.maxConns=50
          jdbc.wmdb.minConns=1
    
          globalvariable.SERVER.value=$env{SERVER}
          globalvariable.ES_BOOTSTRAP_URL.value=$secret{ES_BOOTSTRAP_URL}
          globalvariable.ES_USERNAME.value=$secret{ES_USERNAME}
          globalvariable.ES_PASSWORD.value=$secret{ES_PASSWORD}
          globalvariable.ES_PASSWORD.isSecure=true
          globalvariable.ES_EVENT_PRODUCER_CLIENTID.value=event_producer_ocp
    
          user.Administrator.password=$secret{MSR_ADMIN_PASSWORD}
          remoteserver.local.password=$secret{MSR_ADMIN_PASSWORD}
    
    
    serviceAccount:
      create: true
      name: "event-producer"
    
    podSecurityContext: {}
    #  fsGroup: 0
    
    securityContext: 
      capabilities:
        drop:
        - ALL
      runAsNonRoot: true
      # runAsUser: 1000
    
    service:
      type: ClusterIP
      port: 5555
    
    ingress:
      enabled: false
    
    resources:
      msrContainer:
        limits:
          cpu: 1000m
          memory: 2048Mi
        requests:
          cpu: 500m
          memory: 512Mi
    
    autoscaling:
      enabled: false
      minReplicas: 1
      maxReplicas: 3
      targetCPUUtilizationPercentage: 80
      # targetMemoryUtilizationPercentage: 80
    
    # -- Define values for Prometheus Operator to scrap metrics via annotation or ServiceMonitor.
    prometheus:
      path:          "/metrics"
      port:          "5555"
      scheme:        "http"
      ## -- Only used on annotation 
      scrape:        "true"
      ## -- Only used on ServiceMonitor
      interval:      10s
      ## -- Only used on ServiceMonitor
      scrapeTimeout: 10s
    
    serviceMonitor:
      enabled: true
    
    metering:
      enabled: false

    And the secret template

    apiVersion: v1
    kind: Secret
    metadata:
      name: msr-secrets
    type: Opaque
    data:
      MSR_ADMIN_PASSWORD: <base64 encoded MSR Administrator password>
      DB_SERVER_NAME: <base64 encoded database server name>
      DB_PORT: <base64 encoded database server port>
      DB_DATABASE_NAME: <base64 encoded database name>
      DB_USERNAME: <base64 encoded database username>
      DB_PASSWORD: <base64 encoded database password>
      POOL_DB_USERNAME: <base64 encoded database username>
      POOL_DB_PASSWORD: <base64 encoded database password>
      POOL_JDBC_URL: <base64 encoded database JDBC url>
      ES_TRUSTSTORE_PASSWORD: <base64 encoded truststore password>



    ------------------------------
    Stephane Tailland
    ------------------------------



  • 9.  RE: How to start MSR with external JDBC pools as the MSR image containers.webmethods.io will come with plain vanilla image with emdeded db

    Posted 22 hours ago

    Here's an example that creates a Postgres JDBC pool named wmdb and binds it to the ISCoreAudit, ISInternal and ProcessAudit aliases. It also sets the pool to 50 connections max.

    jdbc.wmdb.dbURL is a JDBC connection string here, similar to the one you provide in the webMethods installer to configure the connection to databases.
    To point to another RDBMS vendor you can change jdbc.wmdb.driverAlias

    To bind you pool to other aliases, add more jdbcfunc.<funcpool>.connPoolAlias=wmdb lines

    jdbc.wmdb.dbURL=$secret{DB_JDBC_CONN_STRING}
    jdbc.wmdb.userid=$secret{DB_USERNAME}
    jdbc.wmdb.password=$secret{DB_PASSWORD}
    jdbc.wmdb.driverAlias=DataDirect Connect JDBC PostgreSQL Driver
    jdbcfunc.ISCoreAudit.connPoolAlias=wmdb
    jdbcfunc.ISInternal.connPoolAlias=wmdb
    jdbcfunc.ProcessAudit.connPoolAlias=wmdb
    
    jdbc.wmdb.maxConns=50


    ------------------------------
    Stephane Tailland
    ------------------------------