GlassFish 4.0 as a windows 7 service - service

I am using GlassFish 4.0 in a cluster configuration with two nodes and each node has one instance. The DAS and two instances are setup as Window 7 services that use a logon account that has administrator privileges. Upon starting the machine the service starts and the DAS is up along with the instances. From Windows Task Manager this appears as two java.exe processes per service for a total of 6 java.exe's. The problem is that if I use the asadmin restart-domain command two new java.exe processes spawn and the two old ones do not die. The application that is deployed works fine, but with enough restarts using asadmin, the memory starts to fill up from zombie java.exe's. Oddly enough running asadmin stop-domain will stop the two DAS java.exe processes but then running asadmin start-domain starts Glassfish as a non-service. The only way to start the DAS back as a service is to run "sc start domain1" or restart the machine. Also, the only way to stop the DAS java.exe processes is with asadmin; stopping the service using "sc stop domain1" stalls and does not work. It is also odd that each service (DAS, instance 1 and 2) starts two java.exe's, vs starting only one each when running as a non-service.
Is there any additional service wrapper configuration that needs to be done, or asadmin options that need to be passed in when running asadmin commands on GlassFish 4.0 running as a service?

These may be helpful. The implementation for 4 is the same as 3.1
https://blogs.oracle.com/foo/entry/automatic_starting_of_servers_in
https://blogs.oracle.com/foo/entry/automatic_starting_implementation_details_for

Related

How to setup High available active-passive postgresql which has scheduled job running on server

I am new to postgresql, I went through the Postgres documentation which provides details for the active passive server setup.
What I want is the scheduler in spring boot should run only on server which is pointing to active mode, and in passive mode the schedular should not run.
As soon as active goes down and passive takes over as new active, then jobs should start running on new server.
I just have 2 jobs , one runs each 5 mins and one runs everyday at 1AM.
Need help in achieving this

JBoss EAP6 - restart multiple hosts with one command in domain mode

I have an app that needs to be restarted through the JBoss CLI on multiple hosts during a deployment.
Is there a way to do this dynamically with a single restart(blocking=true) command? Or is there a different command that restarts all hosts while also using the blocking argument that waits for the servers restart.
Example code
/host=devserver1/server-config=Group-devserver1:restart(blocking=true)
/host=devserver2/server-config=Group-devserver2:restart(blocking=true)
/host=devserver3/server-config=Group-devserver3:restart(blocking=true)
You can use the server group to restart the servers with blocking or you can restart the servers on the host, but there is no blocking.
To restart via the server group you'd do something like:
/server-group=main-server-group:restart-servers(blocking=true)
To restart on the host you'd do something like:
/host=master:reload(restart-servers=true)

Quartz scheduler stops working after some time in iis

When I publish my application to IIS server, quartz scheduler stop working after some time.In my local machine IIS server it works fine.
I need to perform some functionality every day at 11:55 pm.
By default, IIS recycles an application pool after some inactivity time. I guess this is your problem. The application will be just shutdown if nobody uses it.
While it is possible to make the application pool in IIS to run forever, it is still better to not schedule background tasks using web applications.
Use windows services or just simple Windows Task Scheduler for scheduling.
There are a couple of good solutions for scheduling background tasks with C# in .Net:
Topshelf
Hangfire
Here is a nice topic about using both solutions "Setting up windows service with Topshelf and HangFire"

Service kill & stop pending C#

my Q is divided to two:
1. what is a stop pending? would it stop me from changing the service dlls?
2. how can i stop a stubern service?
I am trying to close all services on a VM remotely in order to change dlls on the VMs.
some services stay as stop pending. I treied wait for service through the service control manger.
sc.Stop();
sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(25));
as well I can not close a service that have dependencies
any ideas?

Auto startup and shutdown of VMs in Hyper-V

I want to be able to automate startup and shutdown of a Windows XP VM running under Hyper-V on Windows 2008.
The VM should only be available during office hours. Its a standard Windows XP (SP3) installation. So the VM should startup at 8am and shutdown at 6pm (regardless of any running applications) according to a schedule that I can easily configure.
I've looked at a batch job under the VM itself to shutdown,
(something like at 18:00 every M,T,W,Th,F shutdown /l/y/c)
but I can't work out how to get it to start up again - possibly something under Hyper-V could be used?
And it would be nice to control both startup and shutdown from the same place
You can use Hyper-v PowerShell library from Codeplex to create your own PowerShell script to save (suspend) and start guest machines within the required time with scheduled task.