quality@glassfish.java.net

Re: multiple targets for undeploy

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Fri, 01 Aug 2008 05:16:32 -0700

When you have a cluster in a domain, the deployed apps/resources follow this
logic:

1- they are created on the domain
2- they are referenced from targets like the cluster.

What (sort of) comes in the way of 1) is the chosen defaults. Note that the
domain (DAS) itself is a server, whose name is "server". Hence, when you
deploy using a command like:
"asadmin deploy foo.war", what happens is:

11- The application is available in the domain *AND*
22- A reference to this application is created from the server named "server".

When you do something like: "asadmin deploy --target domain foo.war, 11)
happens of course, but 22) does not happen. Thus this application is only
available on the domain. Now, ideally, you should do "create-application-ref"
command to create a reference to this application from the cluster(s) of
interest.

So, in your case, you can either undeploy it from cluster target (using
--target clustername) or remove the application refs to it from that cluster
(using delete-application-ref command) and then undeploy it from the server.

I guess I should blog about it.

Ajit Kamble wrote:
> Thanks for the prompt answer sudhir .
> I have the war deployed on default "server" as well as cluster. Cluster
> has two instances "server1 and server2"
> So i guess i have to do it individually. First for server and then for
> cluster ?
>
> - Ajit
>
> Sudhir Prabhu wrote:
>> Ajit,
>>
>> What kinds of servers are these two?
>>
>> 1. Stand alone AS instances?
>> 2. 2 DAS'?
>> 3. Members of a same cluster?
>> 4. Members of 2 different clusters?
>>
>> Only if both are part of same cluster can you achieve this with a
>> single command
>> ./asadmin undeploy --target clustername <sample-application-name>
>>
>> For all else you will need multiple commands. And there are different
>> ways of achieving it
>>
>> 1. Deploy individually on all instances
>> 2. Or Create an application reference and refer to it from each instance.
>>
>> Hope that helps
>>
>> Sudhir
>>
>> Ajit Kamble wrote:
>>> I want to undeploy a war from two targets say server1 and server2 on
>>> glassfishv2 .
>>> How do i acheive this using asadmin ? What is the syntax for
>>> --target option ?
>>>
>>> ./asadmin undeploy --target <??> <sample-application-name>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: quality-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: quality-help_at_glassfish.dev.java.net
>>
>