October 29, 2020

Out Here In The Fields

…of musings and ramblings

Installing Kie Server & Drools Workbench Part 2: installing kie-server & Drools Workbench

4 min read

Yes. yes, I admit that the title is ridiculous. Anyhow, you should now have WildFly up and running, so let’s move on. To accommodate the kie-server and specifically the Drools Worbench, we need to modify the JVM Heap Size of our WildFly server. Open up the standalone.conf:

[root@devdm ~]# vi /opt/wildfly11/bin/standalone.conf

Update the following line, from:

JAVA_OPTS="-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"

to

JAVA_OPTS="-Xms128m -Xmx2048m -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=1024m -Djava.net.preferIPv4Stack=true"

Next, download kie-server and drools workbench:

[root@devdm ~]# wget https://download.jboss.org/drools/release/7.12.0.Final/kie-server-distribution-7.12.0.Final.zip
[root@devdm ~]# wget https://download.jboss.org/drools/release/7.12.0.Final/kie-drools-wb-7.12.0.Final-wildfly11.war
Configuring kie-server

Let’s do the kie-server first. Unzip and copy the ee7 kie-server to the deployment directory:

[root@devdm ~]# unzip kie-server-distribution-7.12.0.Final.zip
[root@devdm ~]# cp kie-server-7.12.0.Final-ee7.war /opt/wildfly11/standalone/deployments/kie-server.war

Create a service user for kie-server:

[root@devdm ~]# cd /opt/wildfly11/bin/
[root@devdm bin]# ./add-user.sh -a -u kieserver -p kieserver1! -ro admin,kie-server
Added user 'kieserver' to file '/opt/wildfly11/standalone/configuration/application-users.properties'
Added user 'kieserver' to file '/opt/wildfly11/domain/configuration/application-users.properties'
Added user 'kieserver' with groups admin,kie-server to file '/opt/wildfly11/standalone/configuration/application-roles.properties'
Added user 'kieserver' with groups admin,kie-server to file '/opt/wildfly11/domain/configuration/application-roles.properties'

Create another one for our admin use:

[root@devdm bin]# ./add-user.sh -a -u kieadmin -p kieserver1!! -ro admin,kie-server
./add-user.sh -a -u kieadmin -p kieserver1./add-user.sh -a -u kieserver -p kieserver1! -ro admin,kie-server -ro admin,kie-server
Updated user 'kieserver' to file '/opt/wildfly11/standalone/configuration/application-users.properties'
Updated user 'kieserver' to file '/opt/wildfly11/domain/configuration/application-users.properties'
Updated user 'kieserver' with groups admin,kie-server to file '/opt/wildfly11/standalone/configuration/application-roles.properties'
Updated user 'kieserver' with groups admin,kie-server to file '/opt/wildfly11/domain/configuration/application-roles.properties'

kie-server requires the standalone-full configuration, so let’s configure those:

[root@devdm bin]# vi /opt/wildfly11/standalone/configuration/standalone-full.xml

Change all instance of “127.0.0.1 ” to “0.0.0.0”, and then save

<wsdl-host>${jboss.bind.address:0.0.0.0}</wsdl-host>

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:0.0.0.0}"/>
        </interface>
        <interface name="unsecure">
            <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}"/>
        </interface>
    </interfaces>

If WildFly is currently running, shut it down:

[root@devdm ~]# cd /opt/wildfly11/bin/
[root@devdm bin]# ./jboss-cli.sh 
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] shutdown
[disconnected /] exit

Let’s try starting up the kie-server:

nohup ./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.location=http://your.server.ip.address:8080/kie-server/services/rest/server -Dorg.kie.server.id=wildfly-kieserver &

Point your browser to http://your.server.ip.address:8080/kie-server/services/rest/server to see if it’s up:

Configuring Drools Workbench

Now for the Drools Workbench. Rename and move the the Drools Workbench file to the deployment directory:

[root@devdm ~]# cp kie-drools-wb-7.12.0.Final-wildfly11.war /opt/wildfly11/standalone/deployments/kie-drools-wb.war

Point the URL configuration to each of servers on the startup command:

[root@devdm bin]# nohup ./standalone.sh --server-config=standalone-full.xml -Dorg.kie.server.user=kieserver -Dorg.kie.server.pwd=kieserver1! -Dorg.kie.server.controller.user=kieserver -Dorg.kie.server.controller.pwd=kieserver1! -Dorg.kie.server.location=http://your.server.ip.address:8080/kie-server/services/rest/server -Dorg.kie.server.controller=http://your.server.ip.address:8080/kie-drools-wb/rest/controller -Dorg.kie.server.id=wildfly-kieserver &

A couple explanation for the parameters:

  • –server-config=standalone-full.xml tells the startup process to use standalone-full configuration which is required for the kie-server
  • -Dorg.kie.server.user=kieserver -Dorg.kie.server.pwd=kieserver1! tell startup script to use these credentials for remote communication between the kie-server and the workbench
  • -Dorg.kie.server.controller.user=kieserver -Dorg.kie.server.controller.pwd=kieserver1! is the same as the above
  • -Dorg.kie.server.location=http://your.server.ip.address:8080/kie-server/services/rest/server configures the URL for kie-server
  • -Dorg.kie.server.controller=http://your.server.ip.address:8080/kie-drools-wb/rest/controller configures the URL for the Drools Workbench
  • -Dorg.kie.server.id=wildfly-kieserver configuresĀ  the name of automatically generated default server configuration

Additionally, kie-server and kie-drools-wb are the names of the war files for kie-server and the workbench respectively, that we put into the deployment directory on the previous step. If you rename your war files differently, then you should modify the url accordingly.

Open the workbench by pointing your browser to http://your.server.ip.address:8080/kie-drools-wb

Log into the Workbench using the admin user we created earlier, click on “Menu”, and on “Deploy” section, click on “Execution Servers”

If we got it correctly, a remote server and default configuration named “wildfly-kieserver should be automatically configured and listed on the web console:

The kie-server and Drools Workbench are now ready to use.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © All rights reserved. | Newsphere by AF themes.