Openshift: share MySQL cartrige between applications - java

I have Java EE web application on RedHat Openshift PaaS, which consists of JBoss EWS, MySQL and phpMyAdmin cartriges. My question is, whether it is possible to share the MySQL cartrige from application one (let's say app1-myname.rhcloud.com) with my second application running under the same OpenShift account (like app2-myname.rhcloud.com)?
Thanks.

From this KB: https://www.openshift.com/kb/kb-e1051-how-do-i-connect-multiple-applications-to-one-database#comment-form
OpenShift does not support direct connectivity to an embedded database on non-scalable applications. Having said that, there are 2 workarounds today:
Connecting to a scalable application's database using the
hardcoded values since you won't have $OPENSHIFT_DB_* env vars (for
scalable apps, see
https://openshift.redhat.com/community/kb/kb-e1049-how-does-scaling-work-in-openshift)
ssh port forwarding (see
https://openshift.redhat.com/community/forums/openshift/accessing-an-server-port-running-in-openshift-from-another-openshift-image)

Related

Access one database from two sping boot applications

I have two separate spring boot projects that share one database (MySQL).
Is there a way I can host these two applications on a VPS and make them share the same database the way I make them share it on a local server?
Thank you
MySQL supports multiple client connections. Assuming your 2 apps and MySQL are running ok locally, they should all work the same if deployed to the same VPS. If you are deploying across multiple VPS instances then you would need to consider configuring network routes between the instances and firewall rules to allow traffic to flow between them.

Deploying a Java web application to Amazon

I am sure this question has been asked and answered before multiple times. But unfortunately, I am still not clear. Here is my issue.
I have a JSP, Servlet application which uses MySQL as the database. I have built the WAR file as well. Now I am in need of deploying this so it can be accessed online by anyone.
I looked into lot of areas including normal web hosting. However even though the services like DailyReazor are highly secured, they provide little for MySQL, around 250 MB for the package I selected.
Now I am looking into Amazon AWS. In AWS I am expecting to deploy my aplication and make it available online.The MySQL server should not contain limits like 250MB.
But I have never ever used this service AWS before. By reading various posts, I know that Elastic Beanstalk is the easiest way to go, but still not convinced about how to deploy it properly with database access and all. And in the other hand, will they give me a web address like "www.example.com" or will they simply provide an IP address?? I am also familiar with tomcat so I need to use it.
We will not upload files (images etc) at the moment, so I believe we can manage with around 20$ per month?
I really appreciate if someone can provide a clear guidance on deploying java web applications in Amazon, with the requirements I mentioned about MySQL, Global access and so on.
Amazon RDS for MySQL is a Database-as-a-service offerring from AWS. It is scaleable up to 3TB, and has scaleable IO as well. Of course it also depends on how much you prepared to pay. they manage the DB for you (backup etc). You get a URL to connect, credentials and you are set to go.
Amazon Elastic Beanstalk uses Tomcat. So you should be familiar with that. You upload your WAR file and specify what EC2 flavor you want (CPU/MEM etc). They launch a VM that is configured with Jva and Tomcat and deploy the WAR for you. You get an IP address.
Amazon Route 53 is the DNS service, where you can assign the IP address to your domain (assuming you have one)

How to host online a java web dynamic project created using jpa toplink, tomcat7 mysql and primefaces

I have managed to create my first JEE application. Now I am trying to publish it online, I tried openshift and Amazon EC2 tutorials but none of them worked.
So is there another way to deploy it ?
folder's tree
If it's working locally then you're almost there.
Check this out. Will's answer should answer your question.
If you work for a company and have a server set-up there, you could reroute your domain to the company’s server and do the same. In this case, you can deploy your webapp on a virtual machine at port 80. This VM's IP address will be the one which your domain reroutes to.
The procedure is pretty much the same in both cases.

convert weblogic admin server into managed server

I'm currently having 2 Weblogic admin servers in 2 different domains created on the same machine.
I want to convert one of the admin server to a managed server and then use them together to deploy a Java application. Is this feasible? If yes, how?
I'm currently using Weblogic Server 10.3.
PS: I'm quite new to Weblogic domain creation and administration. Please revert for any more details needed.
The simple answer is no, however, adding a managed server to a domain is extremely simple. See the documentation here. When deploying your application you'll need to target both servers or create a cluster (also very easy), add both machines to it and give the cluster name as the target.
Note, it is generally not concidered best practice to target applications to the Admin server (although it's fine when you're developing on your local machine). If you have the resources available on your environment, you could create two managed servers and put them in a cluster. Depending on the configuration of your Admin server, you may be able to reduce it's size if memory is tight.

How to host JSPs on a web server?

Hi I'm sorry for the naivety of this problem but I need some guidance as I have confused myself greatly.
I have been tasked with creating a database(mysql) and creating a web interface for i to be interacted with. I have experience with web design and database development. Previously I have used java to interact with a DB and was hoping I could use JSP for the web interface. This is where my problem is, how I would I deploy/host this website?
I have 2 theories which are misguided:
(A). Use a cms which has a web server for me to place the jsps in?
or
(B). Use a domian/web hosting site that has a server for me to place the jsps in?
I'm totally lost and any guidance would be greatly appreciated.
Simple answer is you will require a Java Application Server to host your JSPs.
You can use Apache Tomcat, GlassFish, or some other application server to do this.
You will also need a database e.g MySQL running on your host or some other host accessible by the machine running the Java application server.
You can choose to host all of this locally or farm it out to a web host provider depending on your resources.
A CMS seems like overkill. See this link for a description of CMS and its functionality. I don't believe this is what you are looking.
I don't know exactly what you're looking for, but I think you need (B)
You need a MySQL instance running your database and a servlet container (e.g. Tomcat) to host your JSPs.
Running a CMS which is just used to use the DB that it works with is a little bit heavy for that usecase.
As suggested by Mr #cmd , yes there is no need to go for an outsourced server just to host your website, unless you need it to be visible to the world.
Else for your testing purpose, you can use Any of the Apache Tomcat, Glassfish servers for hosting the applications designed in JSP or in other web interface language.
And Inside of the JSP coding itself you may write the interaction coding with your database.
your database also can be installed in the same server.
And actually instead of a server, you may even use your PC to install the Apache Tomcat and the database and start using it.

Categories