WildFly 8 CR1 on OpenShift (Tech Tip #7)

OpenShift-logo

OpenShift is Red Hat’s PaaS platform and comes in three flavors:

  • Origin is the Community PaaS offering. You can explore the community-driven open source upstream of OpenShift. Join the community.
  • Online is the Public PaaS offering. Host your applications in the public cloud with automated provisioning, management, and scaling of applications. Sign up for free.
  • Enterprise is the Private PaaS offering. Leverage PaaS in your own data centers and private cloud. Request evaluation.

With 1.5m+ total apps created, 2400 apps created each day, 2100 new users each week, OpenShift provides the best PaaS experience for Java with JBoss EAP, Tomcat, Jenkins, Maven, Eclipse, MongoDB, MySQL, and a whole variety of pluggable cartridges. OpenShift provides great velocity by providing support for devops, Node.js, Ruby, Mobile, NoSQL. In addition it also offers stability by offering multi-tenancy, security, auto-scaling, no lock-in, and Red Hat Enterprise Linux.

OpenShift was the first PaaS to offer support for WildFly, naturally! As WildFly CR1 was released recently with 100% Java EE 7 TCK passing, the developer cartridge has been updated as well.

Lets take a look at how to get started with WildFly CR1 using the CLI tools. Alternatively, Web Console or IDE can be used as explained in Getting Started Guide.

  1. Install the client: sudo gem install rhc
  2. Setup your environment: rhc setup
  3. Create your application as shown
    rhc app create mywildfly https://raw.github.com/developercorey/openshift-wildfly-cartridge/master/metadata/manifest.yml
    
    The cartridge 'https://raw.github.com/developercorey/openshift-wildfly-cartridge/master/metadata/manifest.yml' will be downloaded and installed
    
    Application Options
    -------------------
    
    Domain:     milestogo
    Cartridges: https://raw.github.com/developercorey/openshift-wildfly-cartridge/master/metadata/manifest.yml
    Gear Size:  default
    Scaling:    no
    
    Creating application 'mywildfly' ... Artifacts deployed: ./ROOT.war
    done
    
    Waiting for your DNS name to be available ... done
    
    Cloning into 'mywildfly'...
    
    The authenticity of host 'mywildfly-milestogo.rhcloud.com (54.224.212.243)' can't be established.
    
    RSA key fingerprint is XXXXXXXXXXXXXX.
    
    Are you sure you want to continue connecting (yes/no)? yes
    
    Warning: Permanently added 'mywildfly-javaee6.rhcloud.com,54.224.212.243' (RSA) to the list of known hosts.
    
    Checking connectivity... done
    
    Your application 'mywildfly' is now available.
    
     URL:   http://mywildfly-javaee6.rhcloud.com/
     SSH to:  [email protected]
     Git remote: ssh://[email protected]/~/git/mywildfly.git/
    
    Cloned to:  /Users/arungupta/mywildfly
    
    Run 'rhc show-app mywildfly' for more details about your app.

    And now you have your first application running on OpenShift and deployed on WildFly. Console should show the following output:

openshift-console-techtip7

The application is now accessible at:

http://mywildfly-milestogo.rhcloud.com and looks like:

wildfly-openshift-mainpage-techtip7

Port forwarding can be enabled by issuing the following command:

rhc port-forward mywildfly
Checking available ports ... done
Forwarding ports ...

To connect to a service running on OpenShift, use the Local address

Service Local               OpenShift
------- -------------- ---- ---------------
java    127.0.0.1:8080  =>  127.2.54.1:8080
java    127.0.0.1:9990  =>  127.2.54.1:9990
java    127.0.0.1:9999  =>  127.2.54.1:9999

Press CTRL-C to terminate port forwarding

Now WildFly’s wonderful admin console is accessible at http://localhost:9090 and is automatically redirected to your instance running on OpenShift.

You can also get some more details about the service at:

http://mywildfly-milestogo.rhcloud.com/snoop.jsp

Do you want to try deploying one of the Java EE 7 samples on this application now ? May be a WebSocket one ;-)

Be Sociable, Share!
  • Tweet
This entry was posted in techtip, wildfly and tagged , , . Bookmark the permalink.

One Response to WildFly 8 CR1 on OpenShift (Tech Tip #7)

  1. Maxime Gréau says:

    Nice post !
    In five minutes I created a wildfly8 cartridge and I deployed my Java EE 7 / WebSocket application thanks to the “rhc port-forward” command.

    It’s a Tennis Game Tournament app demo : http://wildfly8-mgreau.rhcloud.com/usopen/live.html

    Thanks.
    Maxime

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>