background image

 Running multiple instances of JBoss AS using different sets of ports

15

/var/log/jbossas/default/server.log

In general, each log file is created by the SysV script as

/var/log/

service-name

/$JBOSSCONF/server.log

so no file conflicts shall exist.

For more flexibility in the configuration of the different servers, you may want to create full copies of

JBOSS_HOME

. This is described in 

Section 4.3, “ Creating copies of 

JBOSS_HOME

 above -- make sure

you use the 

cp

 command's 

p

 switch to preserve the 

jboss

 user and group ownership. Then, in 

/

etc/sysconfig/

service-name

, uncomment and update the value of the 

JBOSS_HOME

 variable.

Optionally, you can just uncomment and change the value of 

JBOSS_HOME

 as described above so

as to specify an empty or non-existent directory and the script will automatically create a copy of
the RPM-installed 

/var/lib/jbossas

 (original 

JBOSS_HOME

) for you when the service is first

started. The current "minimal", "production", "default" and "all" configurations will be copied. Make sure
the parent directory, in case of a new directory, or the directory itself, if already existent, have write
permissions for the user 

jboss

.

Note

Starting the server this first time may take a little longer due to the file copying.

There are 2 ways to run additional instances of JBoss AS and avoid port conflicts:

• By using different sets of ports

• By binding to different local IP addresses

4.5.1.  Running multiple instances of JBoss AS using different sets

of ports

Using different sets of ports

The BindingManager in JBoss AS can be used to dynamically override service configurations
(e.g. port numbers). Jbossas has some pre-configured overrides, namely 

ports-01

ports-02

and 

ports-03

. The configuration file can be found at 

/var/lib/jbossas/docs/examples/

binding-manager/sample-bindings.xml

. These sets of overrides can be used when multiple

instances of JBoss AS must be started. Please follow these steps when multiple instance of JBoss AS
need to be started:

1. Create a new file 

/etc/init.d/

service-name

 which is a symlink to 

/etc/init.d/jbossas

,

e.g:

ln -s /etc/init.d/jbossas /etc/init.d/jbossas-ports-01

2. Create a new config file for 

service-name

 /etc/sysconfig/

service-name

. The contents

of this file should be similar to 

/etc/sysconfig/jbossas

, except with instance specific values

uncommented and updated, e.g:

Содержание APPLICATION STACK 1.4 RELEASE

Страница 1: ...Red Hat Application Stack 1 4 Release Notes for Use with Red Hat Application Stack 1 4 ...

Страница 2: ...Release Notes Red Hat Application Stack 1 4 Release Notes for Use with Red Hat Application Stack 1 4 Edition 1 0 Copyright 2006 2008 ...

Страница 3: ... 2 Using up2date DVD 4 3 Installing Red Hat Application Stack 7 4 Using JBoss AS 11 4 1 Using the Linux service production 11 4 2 Using run sh development 12 4 3 Creating copies of JBOSS_HOME 13 4 4 Using the jbossas commands from any directory 14 4 5 Running multiple instances of JBoss AS 14 4 5 1 Running multiple instances of JBoss AS using different sets of ports 15 4 5 2 Running multiple insta...

Страница 4: ...iv ...

Страница 5: ... 1 4 includes JBoss AS 4 2 for running web applications in a standard middleware environment Note that JBoss AS uses an embedded Tomcat and does not require a stand alone Tomcat Before installing and running JBoss AS you will require a working installation of Java 1 5 Currently Red Hat Application Stack is certified with the Sun JVM 1 5 0 update 15 or later and the latest BEA JVM available through...

Страница 6: ...2 ...

Страница 7: ...ncy 2 1 Install a supported SDK 2 1 1 Installing a BEA IBM or Sun SDK 1 Install a Java SDK from RHN Java SDKs are provided by the Red Hat Enterprise Linux 4 Extras channel for your Linux variant and architecture The channel names are as follows rhel arch variant 4 extras where arch i386 or x86_64 variant as or es The java 1 5 0 bea java 1 5 0 ibm and java 1 5 0 sun SDKs are available from these ch...

Страница 8: ... For the Application Server which includes an embedded Tomcat run up2date jbossas Refer also to Chapter 4 Using JBoss AS below 2 2 2 Using up2date DVD To install using up2date DVD 1 up2date your installation and install the JVM as described above 2 Mount the Red Hat Application Stack V 1 4 DVD 3 Add the following line to etc sysconfig rhn sources to use up2date directly on the RPMs on the disk dir...

Страница 9: ... AS below If you are upgrading from version 1 1 of Red Hat Application Stack please note that the jbossas ejb3 package has now been obsoleted and it s contents merged into the main jbossas package An up2date jbossas command will upgrade everything correctly ...

Страница 10: ...6 ...

Страница 11: ... 8 1 static largeobjects html and http www postgresql org docs 8 1 static app pg dumpall html For more information see http www postgresql org docs 8 1 static install upgrading html If you are using MySQL Backing up your database is optional but recommended Run as root mysqldump all databases p tmp mysqldumpfile sql 2 Stop the daemons sbin service httpd stop To shut down MySQL sbin service mysqld ...

Страница 12: ...teps 1 3 Then as root run up2date installall RedHat Application Stack V1 Note If you are upgrading from Stacks V 1 1 and have installed the jbossas ejb3 package before running the above command you need to first remove jbossas ejb3 manually by running as root rpm e jbossas ejb3 Note You may need to install the following packages to satisfy dependencies before executing the above command if they ar...

Страница 13: ... back up psql U username tmp pg backup Start the http daemon sbin service httpd start For MySQL Start MySQL sbin service mysqld start Update MySQL mysql_upgrade Restore your data mysql p tmp mysqldumpfile sql Start the http daemon sbin service httpd start The installation is now complete ...

Страница 14: ...10 ...

Страница 15: ...onsole web console jmx invoker and http invoker is turned on Additionally no user accounts are active by default so as to prevent default user password based attacks Accounts for the jmx console and the invokers can be set up by modifying JBOSS_HOME server CONFIG conf props jmx console users properties Accounts for the web console users can be set up by modifying JBOSS_HOME server CONFIG deploy ma...

Страница 16: ...hen change the configuration and request it to be used by setting the JBOSSCONF variable in the file etc sysconfig jbossas Optionally you can just set the JBOSSCONF variable in etc sysconfig jbossas to a non existent subdirectory existing parent with write access by the jboss user or an empty directory with write access by jboss and the init script will create a new configuration directory tree fo...

Страница 17: ...E below To create additional JBoss AS configurations besides the provided default production minimal and all you must create a new directory for your configuration as follows note the switches given to the cp command JBOSS_BASE var lib jbossas cd JBOSS_HOME cp pL R server default server myownconfig You can then change the configuration and request it to be used by specifying it in the c flag to ru...

Страница 18: ...f instances created using methods below is not supported If you create custom instances you will manually have to port files changes from a new update to that instance The description here is restricted to running multiple instances of the JBoss AS Linux service Running multiple instances with run sh is already described elsewhere in the JBoss AS documentation You can administer multiple SysV serv...

Страница 19: ... directory itself if already existent have write permissions for the user jboss Note Starting the server this first time may take a little longer due to the file copying There are 2 ways to run additional instances of JBoss AS and avoid port conflicts By using different sets of ports By binding to different local IP addresses 4 5 1 Running multiple instances of JBoss AS using different sets of por...

Страница 20: ...ce name which is a symlink to etc init d jbossas e g ln s etc init d jbossas etc init d jbossas instance2 2 Create a new config file for service name etc sysconfig service name with instance specific values uncommented and updated e g cp etc sysconfig jbossas etc sysconfig jbossas instance2 Uncomment and update JBOSSCONF to instance2 Uncomment and update JBOSS_IP and set it to another IP address i...

Страница 21: ... U S Government d Will not use or transfer the software for use in any sensitive nuclear chemical or biological weapons or missile technology end uses unless authorized by the U S Government by regulation or specific license e Understand and agree that if you are in the United States and export or transfer the Software to eligible end users you will as required by EAR Section 740 17 e submit semi ...

Страница 22: ...18 ...

Отзывы: