Can I run my Tomcat app on Bluemix?

前端 未结 4 1508
忘掉有多难
忘掉有多难 2020-12-11 20:56

We have a simple app that runs on tomcat7 and has been working for about a year. We\'re planning to kick the tires on Bluemix and we would like to know if there\'s any info

相关标签:
4条回答
  • 2020-12-11 21:24

    Yes, you can run your application on Bluemix, however, due to config information spread out in a few different xml files (server, content & web come to mind) on Tomcat, I suggest you take a staggered approach to moving your app. You first need to get your app working on the WebSphere Application Server V8.5.5 Liberty Profile, then you can push a server package to Bluemix.

    Essentially, you want to do the following:

    1) Migrate your Tomcat application and server config to the Liberty profile using the WebSphere Application Server Migration Toolkit - Competitive Migration. The article below provides details on the usage of this tool:

    http://www.ibm.com/developerworks/websphere/downloads/migtoolkit/compmig.html

    2) Test your app on the Liberty Profile

    3) Push the Liberty Server package to bluemix. I've found the article below useful for pushing server packages:

    https://developer.ibm.com/bluemix/2015/01/06/modify-liberty-server-xml-configurations-ibm-bluemix/#

    0 讨论(0)
  • 2020-12-11 21:25

    Yup. You can use the community Java buildpack to use Tomcat as your Java runtime.

    cf push -b https://github.com/cloudfoundry/java-buildpack.git

    Edit:

    cf push <appname> -b java_buildpack
    

    Doc for Tomcat buildpack: https://github.com/cloudfoundry/java-buildpack

    The pre-installed buildpack name or external url after -b option is the open source java Tomcat buildpack. When pushing a Java application, if you don't specify a buildpack name or url, the default Java buildpack will be chosen. In Bluemix, the default buildpack is the WebSphere Liberty buildpack.

    Doc for Liberty buildpack: https://www.ng.bluemix.net/docs/#starters/liberty/index.html#optionsforpushinglibertyapplications

    0 讨论(0)
  • 2020-12-11 21:34

    As others have explained, Bluemix includes the java_buildpack buildpack, which includes Tomcat. To use it to create a runtime in Bluemix using this buildpack, run this command:

    cf push <appname> -b java_buildpack -p <apparchive>
    

    You might wonder: What is this buildpack and what is it doing?

    You can see the list of buildpacks avaiable in Bluemix. Run this command:

    cf buildpacks
    

    The output (as of today) is:

    Getting buildpacks...
    
    buildpack                              position   enabled   locked   filename
    liberty-for-java                       1          true      false    buildpack_liberty-for-java_v1.18-20150519-1642-yp.zip
    sdk-for-nodejs                         2          true      false    buildpack_sdk-for-nodejs_v1.18-20150519-1759-yp.zip
    noop-buildpack                         3          true      false    noop-buildpack-20140311-1519.zip
    java_buildpack                         4          true      false    java-buildpack-v2.7.1.zip
    ruby_buildpack                         5          true      false    ruby_buildpack-cached-v1.3.0.zip
    nodejs_buildpack                       6          true      false    nodejs_buildpack-cached-v1.2.0.zip
    go_buildpack                           7          true      false    go_buildpack-cached-v1.2.0.zip
    python_buildpack                       8          true      false    python_buildpack-cached-v1.2.0.zip
    php_buildpack                          9          true      false    php_buildpack-offline-v3.1.0.zip
    aspnet5-experimental                   10         true      false    buildpack_aspnet5-experimental_v0.1.5-20150508-1205.zip
    liberty-for-java_v1-17-20150501-1729   11         true      false    buildpack_liberty-for-java_v1.17-20150501-1729-yp.zip
    sdk-for-nodejs_v1-17-1-20150519-0951   12         true      false    buildpack_sdk-for-nodejs_v1.17.1-20150519-0951-yp.zip
    

    As you can see, the java_buildpack buildpack is implemented by java-buildpack-v2.7.1.zip. That is documented in Java Buildpack v2.7.1. As the docs show, the buildpack includes Tomcat v8.0.20.

    You can also see that the liberty-for-java buildpack, which creates the Liberty for Java runtime in Bluemix, is implemented by buildpack_liberty-for-java_v1.18-20150519-1642-yp.zip, which is v1.18 of the buildpack. If you need the previous release, you can use the liberty-for-java_v1-17-20150501-1729 buildpack, which is v1.17 of the buildpack. Options for pushing Liberty applications explains how to use the buildpack.

    You can also see the buildpacks for Node.js (nodejs_buildpack), PHP (php_buildpack), and so on. There's even a buildpack for ASP.NET 5 (aspnet5-experimental).

    0 讨论(0)
  • 2020-12-11 21:50

    I would recommend the below command:

    cf push <appname> -b java_buildpack
    

    This will use the built-in Java buildpack in Bluemix. The benefit of this approach is that you always get the version of the java buildpack that matches the current CloudFoundry level in Bluemix. If you use the external git master, it may or may not work.

    0 讨论(0)
提交回复
热议问题