Run multiple Play applications in one VM - osgi

Whenever I run "play run" command, a new JVM is launched which has NettyServer running the play application on default port 9000.
But is any of the below things possible in play 2.0.4?
Run one netty server to run multiple play applications in one JVM
Run muliple netty server on different ports to run multiple play
applications in one JVM
I want to deploy multiple play applications in Karaf container (project requirement :) ) so want them to run in one Karaf VM.

Related

Spring Boot Port Issues

I have created a single web page application using Spring boot and i have configured the port number in application.properties file.
server.port=9991
When I right click my project and click as Spring Boot App it runs fine and when i run it for the second time its throwing that port is already in use.
I am using Spring Tool Suite.
Please let me know why I am getting error.
Error Message:
Description:
The Tomcat connector configured to listen on port 9991 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 9991, or configure this application to listen on another port.
The first application you started was probably still running when you started oh the second time. Kill the process manually. Look for java processes and kill them.
If I am not mistaken, you can just configure port 0 for your application to let the OS pick a port for you. So you could have multiple instances running on the same box at the same time. Porbably you will encounter more conflicting ports for management etcetera.
I think you are using eclipse IDE. when you run first time your program it will take your current port number. I think you are running your application without stop your old process. simply way in eclipse, there is your application running log. there is cross btn or red square btn click that btn and re run that.

cloudfoundry NoHostAvailableException while deploying app

I have deplyed my local cloudfoundry instance. When I try to deploy my application , my app requires cassandra to be up and running. I have cassandra host setup on independant server. Cloud foundry throws com.datastax.driver.core.exceptions.NoHostAvailableException
Whereas when I try to ping this host from the machine on which CF is installed , Ping is successful. Even this cassandra host is accessible from my local computer and works fine with my eclipse deployment.
How can I make cloudfoundry recognize this host?
You will need to make sure that (a) your application has access to the information about the address and credentials to access the cassandra server, and that (b) networking (and maybe DNS) are such that your application instances will actually be able to reach the cassandra server.
For (a), you will want to bind your application to a "user-provided service instance". For (b), you need to make sure your application's running security groups allow it to reach your cassandra server.

How to deploy sinatra application on myown private server?

i am new to sinatra application. i developed my first application with sinatra. Now, i want to deploy this application on my own private server. My own private server is Linux server and all required config (i.e., ruby, sinatra, passenger ) installed.
So, i would like to know how to deploy it?
Here's our company's basic setup for Ruby microservices APIs:
1) Put your Ruby apps in a special folder
We like /srv/applications/
2) Choose a port for your application
Don't use the default port. I prefer ones in the 2000 series (E.g., 2000, 2010, 2020, ...) for Ruby apps.
3) Setup a reverse proxy to access your application on that port
Depending on your server, there are lots of Tutorials for Apache or Nginx.
That way /user-api will redirect to your port. Ex. myserver.com/user-api goes to myserver.com:2020
4) Run your application
If you're not using bundler, use bundle to run the app. To run on a specific port, use "bundle exec rackup -p "
You should then be able to access the application. If you run into trouble, some common problems include 1) the port is being blocked to the outside world, 2) you tried to access it before the app was running and now you still get 503s even though the app is running (restart your webserver to fix it).
Bonus - running your app as a Unix service
This has enormous benefits. If you can run the Ruby app with another supervisor level app, then you can automatically start it on reboot, automatically restart the app on failures (which can lead to flapping when you have catastrophic problems).
Originally we used Monit which is typically used for service monitoring but can actually start/stop/restart (start on boot) for a service.
Now we use foreman and upstart. I highly recommend this pairing, as app supervision is the textbook use case for Upstart. You can skip using Foreman if you have a vanilla configuration, but it is incredibly useful if you need to start other services, set environment variables, etc.

Forwarding of Docker Container running GUI on a non-GUI host

I have a small cluster with docker nodes, I access it via a gateway server that I ssh into. What I would like to do, is to run e.g. Eclipse with a GUI on the cluster and access that GUI on my computer.
What I have found so far is this: http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
However, the problem I'm experiencing is that the host computer doesn't run any x-server, since it's only a node in a cluster, so I cannot mount the required directory into the container.
Is there a way to use GUI applications in a container with this setup?

How to change the port of websphere/glassfish?

I'm a websphere newbie and would like to change the port number. I read to manual about ports but it didn't say anything about port number 8080 and it says that glassfish is running on 8080. Am I running websphere or glassfish? When I installed websphere a browser started a window saying I'm running glassfish which I thought was another app server. Did I install both?
If you want to change glassfish port on the other hand go to http://localhost:4848 (default port for admin console) and on the menu on the left navigate to:
Configurations > server-config > Network Config > Network Listeners > http-listener-[1|2]
and there you can change the port.
WebSphere Application Server doesn't use Port 8080 by default. If port 8080 indicates that Glassfish is running, then you must have installed and started Glassfish. These are two completely different application servers / products.
The WAS console runs on port 9060 by default, so you may be able to see if you have also started WAS by going to http://localhost:9060/ibm/console. Also, you can check your running processes (via Windows Task Manager, for example) and installed programs (via Windows Programs and Features, or a simple Explorer search) to determine what might be running/installed.
If, after installing/starting WAS, you still want to change your port numbers, you can do this by going to "Servers > Server Types > WebSphere application servers > [appserver] > Ports" (for individual application servers; also these instructions are for WAS 7.0, but should be similar if you're using a different version). If you are using WebSphere Application Server ND, there are actually a number of different processes/application servers running at any given time (deployment manager, nodeagents, individual app servers) that open up ports as well. I wouldn't recommend changing any of the default port values unless you are sure that you have a conflict though.

Resources