mercredi 28 octobre 2009

weblogic : installation d'un domain ... via config.sh ...

Voici le configuration wizard en ligne de commande :

Tapez: ./config.sh –mode=console
Ensuite il suffit de répondre aux questions posées par le script ... A noter qu'il est possible de l'utiliser sous Linux/Unix et Windows ...


Il existe le mode silencieux :

./config.sh -mode=silent -silent_script=MonScript.txt

Un exemple de script se trouve dans l'installe de bea ${BEA_HOME}\weblogic81\common\templates\silent_scripts\domain_wls.txt ...

Une syntaxe particulière et relativement simple existe pour ce type de script ...


//This is an example of a Configuration Wizard silent script. This example uses the
// Basic WebLogic Server Domain template to show how to open, modify, and write out
// a domain in silent mode. Please note that many values used in this script are subject
// to change based on your WebLogic installation and the template you are using.
//
// Usage:
// = config.cmd -mode=silent -silent_script=
// = ./config.sh -mode=silent -silent_script=
//
// Where:
// should be the full path to the silent script.
/////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////
//Read in a domain template.
/////////////////////////////////////////////////////////////////////////////////////////
read template from
"D:\bea\weblogic81/common/templates/domains/wls.jar";

/////////////////////////////////////////////////////////////////////////////////////////
//Find and configure the Admin Server.
/////////////////////////////////////////////////////////////////////////////////////////
find Server "myserver" as s1;
set s1.ListenAddress "";
set s1.ListenPort "7001";
set s1.SSL.Enabled "true";
set s1.SSL.ListenPort "7002";

/////////////////////////////////////////////////////////////////////////////////////////
//Create a JMSQueue.
/////////////////////////////////////////////////////////////////////////////////////////
//A JMSServer has to be created first.
create JMSServer "myJMSServer" as jmsserver;
create JMSQueue "myJMSQueue" as myq;
//required attribute
set myq.JNDIName "jms/myjmsqueue";
//required attribute
set myq.JMSServer "myJMSServer";
//optional attribute
//set myq.StoreEnabled "false";
//target "myJMSServer" to server "myserver"
assign JMSServer "myJMSServer" to target "myserver";

/////////////////////////////////////////////////////////////////////////////////////////
//Create a JDBCConnectionPool.
/////////////////////////////////////////////////////////////////////////////////////////
create JDBCConnectionPool "demoPool" as mypool;
//required attribute
set mypool.DriverName "com.pointbase.jdbc.jdbcUniversalDriver";
//required attribute
set mypool.URL "jdbc:pointbase:server://localhost:9092/demo";
//required attribute
set mypool.Password "PBPUBLIC";
//optional attribute (but it's recommended you set the db user...)
set mypool.Properties "user=PBPUBLIC";
//target all JDBC connection pools to server "myserver"
assign JDBCConnectionPool "*" to target "myserver";

/////////////////////////////////////////////////////////////////////////////////////////
//target existing applications.
/////////////////////////////////////////////////////////////////////////////////////////
//target applications only when they exist in current domain template
//assign application "*" to target "myserver";

/////////////////////////////////////////////////////////////////////////////////////////
//Create the admin user and password.
/////////////////////////////////////////////////////////////////////////////////////////
find User "weblogic" as u1;
set u1.password "weblogic";

/////////////////////////////////////////////////////////////////////////////////////////
//Write out the domain.
/////////////////////////////////////////////////////////////////////////////////////////
set OverwriteDomain "true";
write domain to "D:\bea/user_projects/domains/wls";

/////////////////////////////////////////////////////////////////////////////////////////
//Close domain template to indicate completion of work.
/////////////////////////////////////////////////////////////////////////////////////////
close template;



Un article très complet se trouve ici

Aucun commentaire:

Enregistrer un commentaire