Code Monkey home page Code Monkey logo

openshift-wildfly-cartridge's Introduction

Install cartridge with rhc app create wildfly https://raw.githubusercontent.com/desmax74/openshift-wildfly-custom-cartridge/master/manifest.yml

OpenShift WildFly Cartridge

These instructions will get you up and running with WildFly 8.2.0.Final. To run WildFly 9.0.0.CR1 instead, take a look at the documentation here. Alternatively, to run WildFly 10.0.0.Alpha2, take a look at the documentation here.

This cartridge is based on the JBoss AS cartridge found in OpenShift Origin here.

Pretty much everything seems to be working fine, but it can still use some testing.

If you find any issues, please log them in the issues section of the github project.

This cartridge will act very similarly to the jbossas-7 cartridge that you can create a gear with.
You should be able to modify the code in the /src directory of the git repository, and do a git add, git commit, and git push and have it deployed as ROOT.war.
You can also remove the pom.xml and /src directories and place a war file in the deployments directory and they should deploy like they do on JBoss AS 7

Create a new WildFly 8 app

There are a few ways to get started quickly on OpenShift. To create a new WildFly app using the OpenShift Web Console, click here. If you'd like to use the OpenShift command line tools instead, the following command can be used:

rhc app create <WILDFLY_APP> -s jboss-wildfly-8

It will take a few minutes to build, so be patient.

We recommend to create a scalable application since the WildFly cartridge might consume more storage on free plans. With a scalable application, any additional cartridges, such as a database cartridge, will be installed on separate gears.

Create a new WildFly 8 app based on an existing app

If you already have an existing WildFly 8 OpenShift application, you can create a new WildFly 8 app based on the existing one using the RHC --from-app command. First, make sure you have the latest version of the OpenShift command line tools:

gem update rhc

Then, create your new WildFly app:

rhc app create <NEW_WILDFLY_APP> --from-app <OLD_WILDFLY_APP>

This creates an application that's a clone of your existing one (i.e., same gear size, scaling configuration, environment variables, git repository, etc.). This means that your new WildFly application will have the same configuration and deployment(s) as your existing application.

Because the --from-app command relies on an application snapshot, it will take some time to complete (be patient!).

JBoss CLI

This cartridge provides an OpenShift compatible wrapper of the JBoss CLI tool on the gear PATH, located at $OPENSHIFT_WILDFLY_DIR/bin/tools/jboss-cli.sh. Use the following command to connect to the WildFly instance with the CLI tool:

    jboss-cli.sh -c --controller=$OPENSHIFT_WILDFLY_IP:$OPENSHIFT_WILDFLY_MANAGEMENT_HTTP_PORT

Super Secret Hint (Don't tell anyone)

If you run the rhc port-forward command, you can access the WildFly management interface on port 9990.
A username and password is created when you install this cartridge.
If you don't write it down, fear not, the following environment variables will contain them.
$OPENSHIFT_WILDFLY_USERNAME
$OPENSHIFT_WILDFLY_PASSWORD

corey$ rhc port-forward <WILDFLY_APP>
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.13.118.129:8080
java    127.0.0.1:9990  =>  127.13.118.129:9990
java    127.0.0.1:9999  =>  127.13.118.129:9999

In this example, you would visit 127.0.0.1:9990 to access the WildFly Admin Console from your local computer.

Markers

Adding marker files to .openshift/markers will have the following effects:

java8                Will run WildFly with Java 8 if present

java7                Will run WildFly with Java 7 if present

New WildFly apps will default to using Java 8.

Troubleshooting

Q: Can the following error that sometimes occurs on startup be ignored? My app deploys fine even when this error occurs in the server log file.

ERROR [org.jboss.as.controller.management-operation] 
(management-handler-thread - 4) JBAS014613: Operation ("read-resource") 
failed - address: ([("subsystem" => "deployment-scanner")]) - failure 
description: "JBAS014807: Management resource '[(\"subsystem\" => 
\"deployment-scanner\")]' not found"

A: Yes, this error can safely be ignored. It just indicates that the deployment scanner wasn't yet available when the cartridge attempted to check if your app was deployed. Your app will still get deployed successfully.

Thanks to the following:

Stian Thorgersen for this blog article that helped get this going! https://community.jboss.org/people/stianst/blog/2013/06/13/run-wildfly-on-openshift-using-the-diy-cartridge

Also thanks to the OpenShift team, and the users on the #wildfly channel on Freenode for helping answer questions and helping troubleshoot inter-gear management connection issues.

openshift-wildfly-cartridge's People

Contributors

bparees avatar coreydaley avatar desmax74 avatar developercorey avatar emag avatar fjuma avatar mfojtik avatar shekhargulati avatar smoyer64 avatar soltysh avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.