Version 6

    This guide will walk you through how to configure and use in your localhost machine dtgov using jon/rhq as targed deployment. The guide uses docker to create a jon container and uses the project-requirements dtgov demo as the base deployment.

     

    JON/RHQ server

     

    1. Install docker: http://docs.docker.com/installation/fedora/
    2. Give permissions to all users for use docker:
      1. sudo chmod 666 /var/run/docker.sock
      2. sudo service docker restart
    3. Download the packages of the containers:
      1. docker pull vnguyen/rhq-psql
      2. docker pull docker-registry.usersys.redhat.com/jon_qe/jon32-nodb
    4. Disable Selinux:
      1. vi /etc/selinux/config and set the value of SELINUX as disabled
      2. Restart the computer for letting the changes take effect.
    5. Run the posgresql container:
      1. docker run -it --name jon32-psql vnguyen/rhq-psql
    6. Run the jon server container on the port 7080:
      1. docker run -Pit -p 7080:7080 --link jon32-psql:db --name jon32-server docker-registry.usersys.redhat.com/jon_qe/jon32-nodb
    7. Additionally maybe you need some useful docker commands:
      1. docker ps -qa --> List all the containers
      2. docker ps --> List all the running containers
      3. docker rm -f {id_container} --> Remove a container
      4. docker inspect {id_container} --> Give information about a container
      5. docker images --> List all the downloaded images
    8. Access the jon console:
      1. http://localhost:7080   user: rhqadmin password:rhqadmin

     

    Install SwitchYard

     

    This container is going to be the server managed by JON. It will be used as target for dtgov deployments.

    1. Donwload Jboss 6.1 and unzip the distribution
    2. Set JBOSS_HOME environment variable (export)
    3. Download switchyard-installer-2.0 and execute the ant task. It will ask about the jboss instance which will be used for the switchyard installation.
    4. Add a management user for jboss. {JBOSS_HOME}/bin/add-user.sh
    5. Start the jboss server : {JBOSS_HOME}/bin/stanalone.sh -c standalone-full.xml

     

    Install the JON Agent

     

    The JON agent is the bridge between the JON server and the JBoss resources located in your Localhost machine. Steps:

     

    1. Download the agent from your jon server:
      1. http://localhost:7080/agentupdate/download
    2. Execute the agent:
      1. java -jar <agent-update-binary.jar> --install
    3. Disable the firewall
      1. sudo service firewalld stop
    4. It generates a rhq-agent folder.
      1. cd rhq-agent/bin
      2. Obtain the ip of your jon server:
        1. docker ps -qa  --> Get the containerId
        2. docker inspect [jon-server-32 container id]
        3. You can check the ip of the container
      3. ./rhq-agent.sh --clean
        1. Agent Hostname or IP Address [!*] :    Put here your ip (do not put localhost)
        2. Agent Port [16163] : press enter
        3. RHQ Server Hostname or IP Address : put the jon32-ip obtained in the previous step
        4. RHQ Server Port [7080] : Press enter
    5. Go to the jon server console: http://localhost:7080 User:rhqadmin Password: rhqadmin--> Administration tab --> Agents . You can see that jon server detects the installed agent

     

     

    Associate JON Server with the SwitchYard server

     

    Now the jon server can detect the resources provided by the Jon Agent. All the steps would be done in the jon console::

    1. Go to Inventory tab and then in the menu press on Discovery Queue.
    2. You can see your agent, and the resources of it. If you expand the agent you can see the Jboss AS. Press on it and click Import on the bottom.
    3. Go to Compatible Groups (for example) and create a new group. The button create is on the bottom of the page (difficult to see).
      1. Group name --> write the group name that later you will put in the DTGOV Target
      2. Resources --> in the search input, write eap and select the only item.
    4. You can see that the server introduced seems not to be right, because appears a red symbol when it is listed (inventory/servers or in the groups view). You need to included the admin console credentials. For doing that click on the server/inventory tab/ConnectionSettings and then put the username and password of the switchyard installation server.

     

    Dtgov installation

    Now there are 3 java instances started:

    • Jon Server --> port 7080
    • Jon Agent --> port 16163
    • JBoss SwitchYard server --> port 8080

    We are going to install dtgov in an apache-tomcat using the port 9080 (for example). Steps:

    1. Download s-ramp, overlord-commons and dtgov source code:
      1. Governance/overlord-commons
      2. Governance/s-ramp
      3. Governance/dtgov
    2. mvn clean install -Dmaven.test.skip=true
    3. cd [S-RAMP-HOME]/s-ramp-installer
    4. mvn clean install -Ptest-install-tomcat7  --> it generates the tomcat installation in the target folder
    5. cd [DTVGOV_HOME]/dtgov-distro/assembly/target and unzip dtgov-{VERSION}.zip
    6. execute the ant task and install in the previous tomcat installation that contains s-ramp
    7. cd [TOMCAT_HOME]/conf and modify the port 8080 in the server.xml to 9080.
    8. Modify the overlord.properties with the new port 9080
    9. start the tomcat server: [TOMCAT_HOME]/bin/startup.sh
    10. Go to http:/localhost:9080/dtgov-ui
    11. cd [DTVGOV_HOME]/dtgov-distro/assembly/target/dtgov and execute:
      1. ant seed -Ds-ramp.shell.password=admin -Ds-ramp.shell.password={ADMIN-PASSWORD} -Ds-ramp.endpoint=http://localhost:9080/s-ramp-server/

     

    Dtgov Usage for deploy in the JON Server

     

    We are going to use the /dtgov/dtgov-demos/dtgov-demos-project/ as example for testing the deployment of a SwitchYard dtgov artifact in a JON server. By default all the targets installed by the seed task are for a JBoss AS instance, using the COPY target. Steps:

    1. Go to http://localhost:9080/dtgov-ui . Click on the Admin Targets section.
    2. Edit the Dev target. In the type combo box, select RHQ and in the text inputs put:
      1. RHQ Host: http://localhost:7080
      2. RHQ User: rhqadmin
      3. RHQ Password: rhqadmin
      4. RHQ Plugin: JBossAS7
      5. RHQ Group: the group name defined in jon
    3. Click on save.
    4. Go to /dtgov/dtgov-demos/dtgov-demos-project/
    5. Edit the pom.xml and in the distribution tag modify the default port 8080 by 9080
    6. cd project-requirements and mvn clean deploy -Pdemo . Then go to the dtgov ui console and in the task section claim/start/pass
    7. cd project-service-api and mvn clean deploy -Pdemo . Then go to the dtgov ui console and in the task section claim/start/pass
    8. cd project-service-impl and mvn clean deploy -Pdemo. In this moment the rqh deployer will deploy in the group "dev" of the jon server.