Our application is served by tomcat inside a cluster which contains a lot of windows 2008 servers. These servers are behind a Hardware Loader Balancer and Firewall. Usually one of the server can be exposed outside the Loader Balancer for system maintenance.
And we commit our source codes to a git repository, and then the application will be built by Jenkins which have the internet access.
Now I wonder if it is possible to update the application from Jenkins Server to the cluster?
Related
I have a docker swarm running multiple services. One of these services is a KIE server. I use Bamboo to deploy my services and I need to be able to do the same (automated deployment) for the kJar into my KIE server.
Also, I will have multiple replicas of this KIE server running so I need to be able to deploy to all of them. They will be running behind the Docker swarm load-balancer.
My question is how can I do this? The only methodology I've seen so far is to place the kJar into the .m2 directory of the server and then use a REST call to create the container.
This would work fine for a single server but not for many behind a load-balancer.
Has anyone else done this and, if so, how did you implement it?
I was able to create a JAVA Rest API Web Service using SpringBoot. How do I deploy it so not only my localhost can access it but other computers in the private LAN as well.
I dont want to officialy publish it outside. Is Glassfish the tool for this?
I want to have an endpoint like
https://privatewebservice.net/api/
in the private network that other people can use.
Thanks.
Deploy the rest on your tomcat server on port 80 and in other PCs in the private LANs update host file for privatewebservice.net to point to your PC's IP in the LAN
It needs to run an a servlet container(aka web server). There are many; Jetty, Tomcat, Glassfish etc. That servlet container will start and host your application and make it available via it's port(s).
You can run this process on any physical or virtual machine that is visible on your LAN. You could even use your own machine for this if it's visible to your LAN (barring firewall/network rules blocking the traffic).
To make it available to your LAN from your machine, find your machines internal LAN IP address (run ifconfig on Linux or ipconfig on Windows) and try accessing the app via that IP from your browser. If other machines on your LAN can see your machine, they should be able to access it too via that IP address (likely you will also have an internal DNS name for your machine which would be cleaner to use in case your IP address changes).
Obviously that's only good for development and testing. Generally for internal hosted applications for your company you would have a machine running somewhere that you could deploy the app to to make it accessible by others on your LAN.
It's worth noting that Spring Boot by default comes with an embedded server/servlet container. By default this is Tomcat, but can be changed to say Jetty, via configuration and changing default dependencies in your maven POM file or Gradle build file. The default will be fine unless you have some specific reason to change it.
To use this embedded server, use one of either Maven or Gradle Spring Boot plugins which will provide a set of tasks that can be used to build an executable Java jar file for the application that will run the application on the embedded server, and the application within it. This can then be run with something like java -jar myapp.jar
Technically speaking this would probably be the easiest way to deploy the application. With the only major requirement on the machine you are deploying to being a compatible version of Java. Although I'd recommend wrapping that app in a Docker image that already has Java on it and use Docker to run the docker image as a container. This means your applications' dependencies(including Java and it's specific version) are housed within the docker image/container and also means the machine that will run the app could host many different applications resource efficiently(RAM, CPU etc), with each managing their own dependencies. The machine hosting the app would then just need Docker installed on it, and doesn't get polluted with any other applications dependencies.
follow this step :
1- generate a war file of your Spring-boot project API - see here how to do
2- deploy it on tomcat server see here how to do
3- replace your localhost with your #adress ip (where the server is on and where the project is deployed)
I have coded a Spring MVC Hibernate application with RabbitMQ as a messaging server & a MySQL DB. I have also used Hazelcast an in-memory distributed cache to centralize the state of the application, moving the local tomcat session to a centralized session & implementing distributed locks.
The app right now is hosted on a single tomcat server in my local system.
I want to test my application on a multiple JVM node environment i'e app running on multiple tomcat servers.
What would be the best approach to test the app.
Few things that come to my mind
A. Install & configure a load balancer & set up a tomcat cluster in my local system. This I believe is a tedious task & requires much effort.
B. Host the application on a PAAS like OpenShift, cloudfoundry but I am not sure if I will be able to test my application on several nodes.
C. Any other way to simulate a clustered environment on my local windows system?
I would suggest first you should understand your application requirement. For the real production/live environment, are you going to use Infrastructure as a service or PAAS.
If Infrastructure as a service then
I would suggest create local cluster environment and use the tomcat and spring application sticky session concept. Persist the session in Hazelcast or redis server installed on different node. Configure load balancer for multiple nodes having tomcat server. 2-3 VMs for testing purpose would be suitable.
If requirement is PAAS then
Don't think about local environment. Test directly on OpenShift or AWS free account and trust me you would be able to test on PAAS if all setup is fine.
I am a Java developer and I am pretty new in web application development using Java and I have the following doubts.
We are developing web app deployed on Oracle WebLogic Server.
What exactly is the weblogic domains? From what I understand each application use a definied domain. But what it exactly does?
From Oracle documentation:
A domain is the basic administrative unit of WebLogic Server. It
consists of one or more WebLogic Server instances, and logically
related resources and services that are managed, collectively, as one
unit.
So it's an administrative container, you should think of the following: 1 domain equals 1 Administration Server.
The Administration Server:
A domain includes one WebLogic Server instance that is configured as
an administration server. All changes to configuration and deployment
of applications are done through the administration server.
The administration server provides a central point for managing the
domain and providing access to the WebLogic Server administration
tools. These tools include the following:
WebLogic Server Administration Console: Graphical user interface to the administration server.
WebLogic Server Node Manager: A Java program that enables you to start and stop server instances—both administration servers and
managed servers—remotely, and to monitor and automatically restart
them after an unexpected failure.
Note that the node manager is installed on all the machines that host any server instance – both administration server and managed
servers.
A WebLogic Domain is a concept that represents an environment.
A Domain includes an Administration Server, and 1 or more Managed Servers
Managed Servers are basically Java servers running on the physical machine or VM, which can each contain 1 or more Managed Servers.
Managed Servers can be organized into Clusters
A Domain also contains Resources, such as database connections pools, which can be used by Applications.
Applications and Resources are deployed on to specific Managed Servers or Cluster(s) (a Resource should be deployed on the same Managed Server or Cluster as the Application that needs it)
A Domain usually contains multiple applications.
Clusters abstract the Managed Servers as a group, so it's easy to scale an Application deployment by adding Managed Servers to a Cluster.
Multiple Clusters in the same Domain can help segregate Applications and Resources according to their usage requirements.
Dynamic Clusters include rules for scaling the number of Managed Servers in and out according to specific metrics.
Furthermore:
There is 1 Admin Server per Domain. Usually there is 1 Domain per group of machines running Managed Servers in the Domain.
While the Admin Server manages what is deployed where, another service, the Node Manager, runs on each physical machine or VM to manage the life-cycle of the Managed Server (start, stop, health check) and reports to the Admin Server.
This link from oracle docs has precisely defined weblogic domain.It has detailed the various ways of dividing your application may be logically,physically or based on size.Specifically below sections from the link might answer your question
What Is a Domain?
Organizing Domains
https://docs.oracle.com/cd/E13222_01/wls/docs103/domain_config/understand_domains.html
I found the below link useful as well:
http://middlewaremagic.com/weblogic/?p=1914
I am trying to configure clustering in glassfish 3.1.1 server. I have made clusters but it deploys application on different port number and different ip i want it shold be handled by the load balancer and application should be run on the ip of loadbalancer only that means if a machine is down the loadbalancer redirects that request on another machine configured in loadbalancer.
How to achieve it? does any one have idea about it? or provide link of tutorial and/or blogs for the same.
http://tiainen.sertik.net/2011/03/load-balancing-with-glassfish-31-and.html
To brief up:
Steps to configure a glassfish cluster with a Load Balancer:
Create a cluster
Create instances for the cluster
Start the cluster
Deploy the web application
Create a network listener to listen the requests coming from the load balancer
Install Apache Web Server and get the mod_jk module
Edit the httpd.conf file and workers.properties file in the conf directory of apache web server
Restart the cluster, glassfish domain and apache daemon
Note: You might need to keep you firewall off if using any Linux OS.