I have the following requirements:
1. Implement the load balancing for two same processes(Mirth3.0.1) available on two different LINUX machine.
2. The two processes(Mirth) capable to receiving the requests.
3. If a process over UNIX server taking lots of CPU usage then switch to other process running on different LINUX sever.
Let me know how this can be achieved using JMX. OR let me know if this can be achieved using different programming technique.
Thanks!
You'd generally need a 3rd process that acts a "reverse proxy". All the requests go to that process and it will route the request and response to whichever server is the active one.
This 3rd process would also be looking at the machines to measure CPU (using JMX or whatever tools you'd like), and use some logic to change the active server.
Related
We have multiple java web applications and processes that are deployed on a server. we would like to find a mean to easily monitor these applications and check their status remotely. by motoring we mean the following :
Check if the websites are up, send notifications by email otherwise.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
? not sure if there are other ideas about monitoring
My question is that is there any application that is already available that provide such functionalities or some of them? if not do you know what API can be used to build such applications (in JAVA).
UPDATE:
The tool should be free
Thanks in advance for any help!
For monitoring Java applications as well as website availability, issuing custom commands in your servers and in general, monitor applications go for a general-purpose monitoring solution, like Pandora FMS. I'll try to answer your questions in order:
Check if the websites are up, send notifications by email otherwise.
Doing a network check to TCP port 80 and parsing a 200 OK response.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Easy thing to do with the log retrieval feature. Check it out in the wiki.
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
I'd suggest using Pandora Agents in this case. Quite powerful, yet very low resource consumption. They allow to do post-actions if your app is down, your CPU is high, or in general terms, anything you can measure happens. Check out the server monitoring more deeply: http://pandorafms.com/monitoring-solutions/server-monitoring/
On Linux, you an use monit. You can use it to any monitor services such as apache as well as wildfly running behind apache. It is actually easy to configure and it also gives all that you have requested.
If you want to monitor java processes, there is nothing better than MoSKito: http://www.moskito.org.
The only problem is that it covers much more, than you stated as your requirements, you will also get:
health thresholds and notifications
detailed performance metrics of your java code
dashboards with most important information about your app
mobile applications to monitor your app on the run
detection of slow transactions in your application
and more more more ;-)
http://www.moskito.org
http://newest.moskito.org/moskito/ (nightly build of the UI)
Step by Step guide: http://blog.anotheria.net/msk/the-complete-moskito-integration-guide-step-1/
Similar to How to have 2 JVMs talk to one another, but with the added requirement that there be per-user authentication between the 2 JVMs. I have one Windows machine that multiple users will utilize, each using 2 java applications (essentially a client process and server process). The communication should be isolated, such that no user can see or access the data moving between another user's client/server.
I'm looking at named pipes and Netty as of now, but not sure of how each supports the above requirement, or which is more reliable / easier to set up.
We have a typical Flash+J2EE application that makes multiple requests from client to server (over Flex remoting), which is taking quite a long time on some client systems (and hence results in poor application performance on such systems).
Now, suspecting issues with network connectivity (latency) on such client system(s), we need to identify how far does it contribute to the slow response of the application (rather than performance issues in the application itself).
So, what are the best way(s) to diagnose this on a client system (Windows)?
Note that we have tried profiling our application, which does not indicate bottlenecks there, so we just need to clearly identify the possible network issues.
Thanks.
Consider the use of a network impairment solution to model these uncontrolled network characteristics for the user(s) who are complaining. The industry defacto solution set is from Shunra (http://www.shunra.com), but if all you want is single session to look at the behavior of one user, then you might consider an open source solution such as WanEm, (http://wanem.sourceforge.net).
This should allow you to model the network characteristics between a single client and the server over a congested network link to observe how the single user application performance changes with different network conditions. With WanEm you get to model one logical link between the two. With Shunra you could model your whole network if you so desired. Don't accept the default installation of WanEm on a virtual machine, timing is critical to network impairment and the clock will "float" inside of a virtual machine - Go ahead and stand up a single host for this.
I am developing a java based application; its pertinent requirements are listed below
Large datasets exist on several machines on network. my program needs to (remotely) execute a java program to process these data sets and fetch the results
A user on a windows desktop will need to process datasets (several gigs) on machine A. My program can reside on the user's machine. He will execute my program from his machine and initiate the dataset processing on remote machine(s)
Instead of getting the dataset over the network from the remote machine to his machine, he will execute the program on the remote machine and fetch results
The user may have open access to the other machines but ftp is the requirement
Data should not be brought through network to the user's machine.
Users have windows OS
My question(s)
How can I perform this kind of remote process execution ? Any ideas?
I am looking at hadoop; I am working on Windows XP. I was unable to get hadoop working for a single node cluster; I am unable to find good documentation. I therefore haven't quite tested hadoop. Any comments on if I am on the right track?
Any links any of you has found useful for installation of hadoop and trouble shooting?
Thanks in advance for any responses. Do please let me know if I should provide any more/specific details.
-jv
Java has a RMI API that you could use, assuming that you can have a JAVA VM running on your remote machines. That's the lightest weight solution. The next lightest weight would be straight socket communication. After that you're getting into EJB servers or Web Servers, which is probably overkill.
Have a look at how to write web services with Java 6. That allows you to publish a method as a web service with an annotation. A web service client is small and does not require additional software. I found the Idea IntelliJ IDE easy to use, and generated a pure Java 6 client.
Then it essentially boils down to making a "normal" method call, and processing the result.
Keep it simple. Grid software is most likely not what you want.
We have a string processing service (c++, uses stdin/out for in/output) that has different layouts, each layout runs separately (eventually will run on separate machines), each layout takes time to load, thats why it must keep running after first run.
I must implement a system with client that will ask the master server to connect it to a relevant slave server which actually runs the relevant layout service. The slave server will communicate the data passed from the client to the service, and when finished will become available on the master server for other clients.
The question is what is the best way to go about implementing the servers? Should I keep an open connection between slave/master until the process is complete to notify the master that the connection is over or keep some sort of var in a synchronized function to check that?
Any other important inputs (or other designs) I have overlooked are also very welcomed, Thanx!
Assuming you can't replace the C++ stuff, here is how I would do it off the top of my head.
I would setup one master server. That server would run a process that accepts requests (probably by HTTP, so it'd be a webservice) and I would have it read the request, parse out what it is, and then call the correct slave. Basically it acts as a proxy. Once it receives the response from the slave it forwards it back to the caller. The simplicity here means that if you start getting more of one type of request, you can set up additional servers for that and round-robin requests to them.
The slaves would be webservices that open the C++ program and forward input and retrieve output. That's all it would do.
I wouldn't bother keeping open connections (except between the slave and the C++ program based on your description). Just using a web request for this stuff will keep the connection between the master and the slave open during the process, but it shouldn't be a problem. This way you don't need to worry about this detail.
Now if I were you I would seriously look at reimplementing the C++ code in Java or calling it via JNI or something. If you can avoid it, I think avoiding the Java wrapper around C++ thing would be a good design goal. The Java could do whatever expensive process it is during start up once, and then hold things ready in memory like the C++ code does.
I hope this helps.
Depending on your scalability needs, you may want to take a look at the Java NIO package. This will give you a starting point to build a scalable, non-blocking server implementation.