Talend ESB Container Administration Guide

5.0_b

Talend ESB Container: Administration Guide
Publication date 13 February 2012 Copyright © 2011-2012 Talend Inc.

Copyleft
This documentation is provided under the terms of the Creative Commons Public License (CCPL). For more information about what you can and cannot do with this documentation in accordance with the CCPL, please read: http://creativecommons.org/licenses/by-nc-sa/2.0/ This document may include documentation produced at The Apache Software Foundation which is licensed under The Apache License 2.0.

Notices
Talend and Talend ESB are trademarks of Talend, Inc. Apache CXF, CXF, Apache Karaf, Karaf, Apache Camel, Camel, Apache Maven, Maven, Apache Archiva, Archiva are trademarks of The Apache Foundation. Eclipse Equinox is a trademark of the Eclipse Foundation. SoapUI is a trademark of SmartBear Software. All other brands, product names, company names, trademarks and service marks are the properties of their respective owners.

Table of Contents
1. Introduction .............................................................................................................. 1 1.1. Structure of this manual ................................................................................... 1 2. Directory Structure .................................................................................................... 3 3. Starting/Stopping Talend ESB Runtime ......................................................................... 5 3.1. Starting Talend ESB Runtime ........................................................................... 5 3.2. Stopping Talend ESB Runtime .......................................................................... 6 4. Starting/Stopping Talend ESB Infrastructure Components ................................................. 8 4.1. Starting the Service Locator .............................................................................. 8 4.2. Stopping the Service Locator ............................................................................ 8 4.3. Starting Service Activity Monitoring .................................................................. 9 4.4. Stopping Service Activity Monitoring ................................................................. 9 4.5. Starting the Security Token Service (STS) ........................................................... 9 4.6. Stopping the Security Token Service (STS) ......................................................... 9 4.7. Starting all three Talend ESB infrastructure services .............................................. 9 4.8. Stopping all three Talend ESB infrastructure services ........................................... 10 5. Using Console ........................................................................................................ 11 5.1. Viewing commands from the Karaf console ....................................................... 11 5.2. Karaf Console command summary ................................................................... 12 6. Deploying Multiple Karaf Containers .......................................................................... 18 6.1. Deploying multiple containers using configuration adaption scripts ......................... 18 7. Remote Console ...................................................................................................... 20 7.1. Configuring remote instances .......................................................................... 20 7.2. Connecting and disconnecting remotely ............................................................. 21 7.3. Stopping a remote instance ............................................................................. 22 8. Commands supplied by Apache CXF and Camel ........................................................... 23 8.1. Commands supplied by CXF ........................................................................... 24 8.2. Commands supplied by Camel ......................................................................... 24 9. Security ................................................................................................................. 25 9.1. Managing users and passwords ........................................................................ 25 9.2. Managing roles ............................................................................................. 25 9.3. Enabling password encryption ......................................................................... 26 9.4. Available realms ........................................................................................... 26 9.5. Deploying security providers ........................................................................... 29 10. Logging System ..................................................................................................... 31 10.1. Configuration .............................................................................................. 31 10.2. Console Log Commands ............................................................................... 32 10.3. Advanced Configuration ............................................................................... 32 11. Deployer .............................................................................................................. 35 11.1. Features deployer ........................................................................................ 36 11.2. Spring deployer ........................................................................................... 36 11.3. Wrap deployer ............................................................................................ 36 11.4. War deployer .............................................................................................. 38 12. Servlet Context ...................................................................................................... 39 12.1. Configuration .............................................................................................. 39 12.2. Configuring the context ................................................................................ 40 13. Provisioning .......................................................................................................... 41 13.1. Example: Deploying a sample feature .............................................................. 41 13.2. Repositories ................................................................................................ 42 13.3. Commands ................................................................................................. 46 13.4. Service configuration ................................................................................... 47 14. Web Applications .................................................................................................. 48 14.1. Installing WAR support ................................................................................ 48 14.2. Deploying a WAR to the installed web feature .................................................. 50 15. Monitoring and Administration using JMX ................................................................. 51 16. Installing the Talend Runtime container as a service ..................................................... 52 16.1. Introduction ................................................................................................ 52

Talend ESB Container Administration Guide

iii

...........3.... Installation on Linux ...................................................... Memory Allocation Parameters ............ Supported platforms ..........3..... 17.............................................................................................................................2...................................................... Troubleshooting Talend ESB ............................... On Linux .............. On Windows ....................................16.................... Installation .................... 17........... 17.. 52 53 54 57 57 58 58 Talend ESB Container Administration Guide iv ........... 16.2.................4.................................................................................................... 17............1............. 16...............................................................

.... 12 12 13 13 14 14 15 15 16 17 19 24 24 51 Talend ESB Container Administration Guide v ............ 5................................................................................................ Ports configured by the configuration scripts ................... 5......................................................... 5........................... log Scope commands .......... 6..................................................... 5.................................................................................. 15....10.......9.......1.................6. 8..............2....................... 5............................ jaas Scope commands ......... CXF commands ............. OBR Scope commands ............ Karaf Management MBeans ............................... 5......... Shell Scope commands ................................................. 8...................... OSGi Scope commands ..............1..... Camel commands ..................... 5..5..........................................................................................................................List of Tables 5............................................................. Miscellaneous Scope commands ............... admin Scope commands ...........................................2...3...4.......................................................1................................................................................................. dev Scope commands ..................... features Scope commands ................. 5......... 5............................. config Scope commands ................................8.................................1..............7.............................................................

Talend ESB Container Administration Guide 1 . • Chapter 4. This container administration manual is intended to provide information on Karaf tooling commands and general administration.1. the two terms are used interchangeably within this document. • Chapter 5. Deploying Multiple Karaf Containers describes how to adapt the configuration to deploy multiple containers at the same machine. Note As the Talend ESB container is based on Apache Karaf. Starting/Stopping Talend ESB Runtime describes the various options that are available to start and stop Talend ESB. • Chapter 6. except when explicitly stressed otherwise. Using Console gives a list of the console commands available. Starting/Stopping Talend ESB Infrastructure Components describes how to start and stop the infrastructure components of Talend ESB. Structure of this manual The following chapters are in this manual: • Chapter 2.Chapter 1. It is NOT a tutorial on getting started with Karaf .please see Talend ESB Getting Started Guide for this. • Chapter 3. Introduction Talend ESB provides an Apache Karaf-based ESB container preconfigured to support Apache Camel routing and Apache CXF-based services (both REST and SOAP-based). Directory Structure describes the directory layout of a Talend ESB installation. 1.

Talend ESB Container Administration Guide 2 . Commands supplied by Apache CXF and Camel describes commands provided by CXF and Camel. Logging System describes configuring and using the logging system. • Chapter 13. Security describes how to configure security with Talend ESB. Remote Console describes how to access Talend ESB using a remote console.Chapter 1. • Chapter 17. Troubleshooting Talend ESB describes how to fix problems related to JVM memory allocation parameters running Talend ESB. Thus when you install a feature and it will install all of its bundles defined under it. • Chapter 14. Introduction • Chapter 7. Provisioning describes how the provisioning system uses xml repositories that define sets of features (bundles). • Chapter 8. • Chapter 11. • Chapter 9. • Chapter 10. Monitoring and Administration using JMX lists the MBeans available to monitor and administrate Karaf using any JMX client. Web Applications describes deploying WAR-based web applications into Talend ESB Runtime. • Chapter 15. Deployer describes deploying bundles or re-defined groups of bundles (called features).

talend.Chapter 2. Directory Structure The Talend ESB software may be downloaded from http://www.com/download. laid out as a Maven 2 repository Talend ESB Container Administration Guide 3 . The standard directory layout of a Talend ESB installation is as follows: • /bin: startup scripts • /etc: configuration files • /keystores: KeyStore files for JobServer SSL connection • /data: working directory • /cache: OSGi framework bundle cache • /generated-bundles: temporary folder used by the deployer • /log: log files • /deploy: hot deploy directory • /instances: directory containing child instances • /lib: contains the bootstrap libraries • /lib/ext: directory for JRE extensions • /lib/endorsed: directory for endorsed libraries • /system: OSGi bundles repository.php.

which has the same effect as using the clean option [6]. Talend ESB Container Administration Guide 4 . If you want to restart from a clean state. Directory Structure Note The data folder contains all the working and temporary files for Karaf. you can wipe out this directory.Chapter 2.

Talend ESB Container Administration Guide 5 .1. 3. Karaf starts the non core bundles in the background.1. So even if the console is already available. On Windows From a console window. ${Talend-ESBVersion}\container .1.. the job commands may not.g. Starting Talend ESB Runtime Wait initally for commands to become available After starting Talend ESB Runtime. 3. you need to wait a few seconds for initialization to complete before entering the commands. Starting/Stopping Talend ESB Runtime This chapter describes how to start and stop Talend ESB Runtime and the various options that are available.Chapter 3. change to the installation directory and run Talend ESB Runtime. go to: cd [karaf_install_dir] where karaf_install_dir is the directory in which Karaf was installed. e. For the binary distribution.

for example: /usr/local/${TalendESB-Version}/container . 3. Stopping Talend ESB Runtime Within the Karaf console. Alternatively. Talend ESB Container Administration Guide 6 .bat server (Windows) bin\trun server (Linux). For the binary distribution. Then type: bin/trun Warning Do NOT close the console or shell in which Karaf was started. Starting Talend ESB Runtime in the background Karaf can be easily started as a background process using the following command: bin\start.4. Karaf can be reset to a clean state by simply deleting the [karaf_install_dir]/data folder.2. 3. change to the installation directory and run Talend ESB Runtime.1. as that will terminate Karaf (unless Karaf was started using the nohup command).Chapter 3.1.3. you can perform a clean shutdown of Karaf by using the osgi:shutdown command.1. add clean to the above start command. do: cd [karaf_install_dir] where karaf_install_dir is the directory in which Karaf was installed.bat (Windows) bin\start (Linux).bat 3. Starting/Stopping Talend ESB Runtime Then type: bin\trun. Starting Talend ESB Runtime without console Karaf can be started without the console if you don't intend to use it (one can always connect using the remote ssh access) using the following command: bin\trun. with an optional -f (force) flag to avoid a yes/no confirmation.2. 3. On Linux From a console window.

For more advanced functionality. First. it can be an absolute time in the format hh:mm. The time argument can have different formats. it's also possible to delay the shutdown using the time argument. Second. in which hh is the hour (1 or 2 digits) and mm is the minute of the hour (in two digits). it can be in the format +m.bat (Windows) or bin/stop (Linux). in which m is the number of minutes to wait.Chapter 3. exiting the shell using logout or Ctrl+D will also terminate the Karaf instance. Starting/Stopping Talend ESB Runtime If you're running from the main console. The argument now is an alias for +0. Examples: The following command will shutdown Karaf at 10:35am: osgi:shutdown 10:35 The following command will shutdown Karaf in 10 minutes: osgi:shutdown +10 Talend ESB Container Administration Guide 7 . you can run bin\stop. Further. from a command shell.

enter the following command at the console prompt: tesb:start-locator Standalone version of the Service Locator Alternatively there is a standalone version of the Service Locator described in the Talend ESB Getting Started Guide. Starting/Stopping Talend ESB Infrastructure Components This chapter describes how to start and stop the infrastructure components of Talend ESB. 4.2. Stopping the Service Locator Within the Talend Runtime container you can shutdown the Service Locator by typing: tesb:stop-locator Talend ESB Container Administration Guide 8 .Chapter 4.1. 4. Starting the Service Locator After starting the Talend Runtime container.

Starting Service Activity Monitoring After starting the Talend Runtime container.Chapter 4.6.4. Starting/Stopping Talend ESB Infrastructure Components 4. enter the following command at the console prompt: tesb:start-sam 4. enter the following command at the console prompt: tesb:start-all Port Conflicts If there is another Talend Runtime container running at the same machine and you forgot to adapt the configuration of the used ports. Talend ESB Container Administration Guide 9 . Starting all three Talend ESB infrastructure services After starting Talend Runtime container. you can shutdown Service Activity Monitoring by typing: tesb:stop-sam 4. enter the following command at the console prompt: tesb:start-sts 4. Stop all infrastructure services using tesb:stop-all and restart them after adapting the configuration.7. In this case tesb:start-all will not try to start the remaining infrastructure components. Starting the Security Token Service (STS) After starting Talend Runtime container. a port conflict may arise while starting an infrastructure component. you can shutdown the Security Token Service (STS) by typing: tesb:stop-sts 4. Stopping Service Activity Monitoring At the console. Stopping the Security Token Service (STS) At the console.5. There are configuration scripts simplifying this task.3.

Stopping all three Talend ESB infrastructure services At the console you can shutdown all three Talend ESB infrastructure services by typing: tesb:stop-all Talend ESB Container Administration Guide 10 . Starting/Stopping Talend ESB Infrastructure Components 4.Chapter 4.8.

--installed Talend ESB Container Administration Guide 11 . Viewing commands from the Karaf console To see a list of the available commands in the console press the tab at the prompt. To view help on a particular command. so if you want to see the commands in the osgi group.1. Using Console 5. type the first letters and hit tab.Chapter 5. SYNTAX features:list [options] OPTIONS --help Display this help message -i. The tab key toggles completion anywhere on the line. Depending on the commands. type the command followed by --help or use the help command followed by the name of the command: karaf@trun> features:list --help DESCRIPTION features:list Lists all existing features available from the defined repositories. completion may be available on options and arguments too.

Destroys an existing container instance. Lists all existing container instances.2. View the command-line or online help as discussed in the previous section for information about the various arguments and options available with each command. Admin Scope The commands within the admin: scope involve administration tasks. Config Scope The commands within the config: scope are used to modify configuration data of Karaf instances (data stored in the /etc folder of the Karaf instance.2.2.1. Connects to an existing container instance. Table 5. Talend ESB Container Administration Guide 12 . config Scope commands Command cancel Parameters [options] Description Cancels the changes to the configuration being edited.2. admin Scope commands Command change-opts change-rmiregistry-port Parameters [options] name javaOpts [options] name port Description Changes the java options of an existing container instance.Chapter 5. Renames an existing container instance.[options] name port port change-ssh-port connect create destroy list rename start stop [options] name port [options] name [command] [options] name [options] name [options] [options] name new-name [options] name [options] name 5. Creates a new container instance. Karaf Console command summary The following tables summarize the out-of-the-box commands available with Karaf. Table 5. Changes the secure shell port of an existing container instance.) Updates take effect immediately without need of restarting Karaf. Starts an existing container instance. Changes the RMI registry port (used by management layer) of an existing container instance. Using Console Display a list of all installed features only Help for each command is also available online at the Apache Karaf website. 5.1. 5. change-rmi-server.2. including starting and stopping Karaf instances and connecting to them remotely. Note there is also a ConfigMBean that can be used to do this configuration within JMX. grouped by scope (family of commands). Changes the RMI server port (used by management layer) of an existing container instance. Stops an existing container instance.

Sets a property configuration. Shows information about selected information. Lists existing configurations. Talend ESB Container Administration Guide 13 .3. in the currently edited the propdel proplist propset update [options] property [options] [options] property value [options] Saves and propagates changes configuration being edited.4. OSGi Framework options. Features Scope The commands within the features: scope are used to provide support for Karaf features. Dev Scope The commands within the dev: scope are used to providing logging and other system output help to the administrator. Creates or edits a configuration. Prints the full stack trace in the console when the execution of a command throws an exception. Using Console Command delete edit list propappend Parameters [options] pid [options] pid [options] [query] [options] [query] Description Delete a configuration.2. Enables/disables dynamic-import for a given bundle. features Scope commands Command addUrl info Parameters [options] urls [options] name [version] Description Adds a list of repository URLs to the features service. dev Scope commands Command create-dump dynamic-import framework print-stack-traces restart show-tree watch Parameters [options] [name] [options] id [options] [framework] [options] [print] [options] [options] id [options] [urls] Description Creates zip archive with diagnostic info. Deletes a property from the edited configuration. Table 5. Watches and updates bundles. Appends the given value to an existing property or creates the property with the specified name and value. Restart Karaf. which are predefined collections of bundles used to implement specific services. Lists properties from the currently edited configuration.3.2.Chapter 5. Table 5. 5. Shows the tree of bundles based on the wiring information. from 5.4.

Removes the specified repository features service. 5. Delete a role from a user.5.6.6. Update JAAS realm.2. Using Console Command install list listRepositories listUrl listVersions refreshUrl removeRepository removeUrl uninstall Parameters [options] feature [options] [options] [options] [options] feature [options] urls [options] repository [options] urls [options] features Description Installs a feature with the specified name and version. Lists the modifications on the active realm/ module. Add a role to a user. Log Scope The commands within the log: scope are used for management of system logs. Manage user and roles of a Jaas Realm.5. JAAS Scope The commands within the jaas: scope are used for management of JAAS users and realms. Removes the given list of repository URLs from the features service. Table 5.2. Lists all existing features available from the defined repositories. Lists the modification on the active realm/module. Displays a list of all defined repository URLs. jaas Scope commands Command cancel realms manage pending roleadd roledel update useradd userdel users Parameters [options] [options] [options] realm [options] [options] username role [options] username role [options] [options] username password [options] username [options] Description Cancel the modification of a JAAS realm. Add a user. Lists all versions of a feature available from the currently available repositories. Reloads the list of available features from the repositories. 5.Chapter 5. Talend ESB Container Administration Guide 14 . Table 5. Lists the users of the active realm/module. Displays a list of all defined repositories. Delete a user. log Scope commands Command clear Parameters [options] Description Clear log entries. Uninstalls a feature with the specified name and version.

Talend ESB Container Administration Guide 15 .8. Installs one or more bundles. OSGi Scope commands Command bundle-level headers info install Parameters [options] [ids] [options] [ids] [options] [urls] Description Displays OSGi headers of a given bundle. optionally providing the given packages. Find OBR bundles for a given filter. Reloads the repositories to obtain a fresh list of bundles.8. Sets the log level. Continuously display log entries. Displays the repository URLs currently associated with the OBR service. starting and stopping.) as well as some container-level actions.2. etc. Deploys a list of bundles using OBR service. Removes a list of repository URLs from the OBR service. Displays detailed information of a given bundle.Chapter 5.7. Table 5. Table 5. 5. Shows the currently set log level. Shows the resolution output for a given set of requirements. Deploys and starts a list of bundles using OBR. Prints information about OBR bundles.7. OBR Scope commands Command addUrl deploy find info list listUrl refreshUrl removeUrl resolve source start Parameters [options] urls [options] bundles [options] requirements [options] bundles [options] [packages] [options] [options] [urls] [options] [urls] [options] requirements [options] folder bundles [options] bundles Description Adds a list of repository URLs to the OBR service.2. 5. Displays the last occurred exception from the log. Using Console Command display display-exception get set tail Parameters [options] [options] [options] [logger] [options] level [logger] [options] Description Displays log entries. Downloads the sources for an OBR bundle. OBR Scope The commands within the obr: scope are used to link to OSGi bundle repositories (OBRs) and install bundles defined within them. Lists OBR bundles. OSGi Scope The commands within the osgi: scope handle bundle maintenance (installation. [options] id [startLevel] Gets or sets the start level of a given bundle.

Prints system information. Disconnects shell from current session. Echoes or prints arguments to STDOUT. [options] [options] condition ifTrue [ifFalse] [options] [options] className [arguments] [options] [options] [options] class [args] [options] format [args] [options] duration [options] [files] [options] script [args] [options] Talend ESB Container Administration Guide 16 . Refresh a bundle. Shell Scope commands Command cat clear each echo exec grep head history if info java logout more new printf sleep sort source tac Parameters [options] paths or urls [options] Description Displays the content of a file or URL.9. File pager. Gets or sets the system start level. [options] values function Execute a closure on a list of arguments. Prints lines matching the given pattern. Using Console Command list ls refresh resolve restart shutdown start start-level stop uninstall update Parameters [options] [options] [ids] [options] [ids] [options] [ids] [options] [ids] [options] [time] [options] ids [options] [level] [options] ids [options] ids [options] id [location] Description Lists all installed bundles. Uninstall bundle(s). 5. Lists OSGi services. Resolve bundle(s). Update bundle. Shuts the framework down. Starts bundle(s). Stop bundle(s). Run a script Captures the STDIN and returns it as a string. Stops and restarts bundle(s). Executes system processes. Shell Scope The commands within the shell: scope are used to provide terminal window commands in the OSGi shell. Prints command history. If/Then/Else block.Chapter 5. Optionally writes the content to a file. Table 5.2. Formats and prints arguments. Executes a Java standard application. Sleeps for a bit then wakes up. [options] [arguments] [options] command [options] pattern [options] [paths or urls] Displays the first lines of a file. Clears the console buffer.9. Writes sorted concatenation of all files to standard output. Creates a new java object.

Talend ESB Container Administration Guide 17 . Connects to a remote SSH server. Miscellaneous Scope commands Command packages:exports packages:imports ssh:ssh ssh:sshd web:list wrapper:install Parameters [options] [ids] [options] [ids] [options] hostname [command] [options] [options] [options] Description Displays exported packages. Creates a SSH server Lists details for war bundles. Install the container as a system service in the OS. Displays imported packages. Miscellaneous Scopes There are a few scopes that offer just one or two commands each. Table 5.10.2. 5. Using Console Command tail Parameters [path or url] Description Displays the last lines of a file. They're listed in the below table.Chapter 5.10.

Start the second container with default settings. Changes performed by the Karaf configuration adaption scripts are persistent and reflected in the configuration files in container/etc. (Ensure the container with the default settings isn't running). and then run the Karaf configuration adaption script at the Karaf prompt to update and save the new settings.sh for the second container copy source scripts/configureC3. in the Karaf console.sh for the first container copy source scripts/configureC2. Deploying Multiple Karaf Containers This chapter describes how to adapt the configuration to deploy multiple containers at the same machine.sh for the third container copy source scripts/configureC0. use: source scripts/configureC1. there are Karaf configuration adaption scripts which automate the adjustment of potentially conflicting parameters.Chapter 6. after starting the container from the container directory. They are based on the edit and propset commands described above.sh resets the parameters to the default values Talend ESB Container Administration Guide 18 .1. 6. In particular. All necessary parameters adjustments are done using a single script call. Deploying multiple containers using configuration adaption scripts In order to avoid conflicts between multiple container instances.

sh 8043 9004 1102 44447 8104 8030 8031 8918 Restart Container To make shure the new parameters are used. Ports configured by the configuration scripts Parameter HTTP Port HTTPS Port RMI Registry Port RMI Server Port SSH Port Command Port File Transfer Port Monitoring Port configureC0. so change the ports in the Karaf configuration adaption scripts and rerun these to apply the changes. it is recommended to shut down and restart the container after applying a configuration adaption script. Troubleshooting If you get the "Port already in use exception" when starting alternate-container.1. Deploying Multiple Karaf Containers The ports which are configured using the scripts are described in the table below: Table 6.sh 8040 9001 1099 44444 8101 8000 8001 8888 configureC1.sh 8042 9003 1101 44446 8103 8020 8021 8908 configureC3. If you are still getting the error.sh 8041 9002 1100 44445 8102 8010 8011 8898 configureC2. but for the Jobserver parameters in Talend Enterprise ESB this is not yet possible. recheck that there is not already a container running using the default parameters. it may also be that the port is actually in use by an unrelated process. Most of the parameter changes will be adapted "on the fly". Talend ESB Container Administration Guide 19 .Chapter 6.

HashMap .0 sshRealm=karaf hostKey=${karaf. it enables a remote console that can be accessed over SSH from any other Karaf console or plain SSH client.cfg configuration file with the following defaults values: sshPort=8101 sshHost=0.util.base}/etc/host. The remote console provides all the features of the local console and gives a remote user complete control over the container and services running inside of it. // Talend ESB Container Administration Guide 20 .key You can change this configuration using the config commands or by editing the above file.apache.0.Chapter 7.1. // each (bundles) { $bm put ($it symbolicName) $it } .karaf. $bm get $1 } bundle-id-by-sn = { b = (bundle-by-sn $1) . The SSH hostname and port number is configured in the [karaf_install_dir]/etc/ org. but you'll need to restart the ssh console in order for it to use the new parameters.0. Remote Console 7. # define helper functions bundle-by-sn = { bm = new java. When you start Karaf. Configuring remote instances It does not always make sense to manage an instance a Talend ESB instance using the local console.shell. Talend ESB can be remotely managed using a remote console.

2.. type shell:info at the karaf> prompt. And..1-b02 7. Security for more information.2. Information about the currently connected instance is returned.osgi . More usually. Using the ssh:ssh command You can connect to a remote Karaf's console using the ssh:ssh command.3. Karaf Karaf home Karaf base OSGi Framework JVM Java Virtual Machine .1. To confirm that you have connected to the correct Karaf instance.ssh) 7. For example. Using the Karaf client The Karaf client allows you to securely connect to a remote Karaf instance without having to launch a Karaf instance locally. to quickly connect to a Karaf instance running in server mode on the same machine.apache. karaf@trun> ssh:ssh -l tadmin -P tadmin -p 8101 hostname Warning The default password is tadmin but we recommend changing it.0 org.shell. run the following command from the karaf-install-dir directory: bin/client. port. as shown. you could append console commands as follows: bin/client -a 8101 -h hostname -u tadmin -p tadmin features:install wrapper To display the available options for the client.Chapter 7.apache. if you were using the client within a larger script.0 /local/apache-karaf-2.R35x_v20090827 Java HotSpot(TM) Server VM version 14.1.eclipse.5.karaf. /local/apache-karaf-2. type: > bin/client --help Talend ESB Container Administration Guide 21 .0. you would provide a hostname.2.shell config:propset sshPort 8102 config:update # force a restart osgi:restart --force (bundle-id-by-sn org. See Chapter 9.0.2. Remote Console if { $b } { $b bundleId } { -1 } } # edit config config:edit org. username and password to connect to a remote instance.karaf. Connecting and disconnecting remotely 7.

Remote Console Apache Karaf client -a [port] specify the port to connect to -h [host] specify the host to connect to -u [user] specify the user name -p [password] specify the password --help shows this help message -v raise verbosity -r [attempts] retry connection establishment (up to attempts times) -d [delay] intra-retry delay (defaults to 2 seconds) [commands] commands to run If no commands are specified.3.2.Chapter 7. ~$ ssh -p 8101 tadmin@localhost tadmin@localhost's password: 7.2. Using the Karaf client To stop a remote instance using the Karaf client. press Ctrl+D. Note Pressing Ctrl+D in a remote console simply closes the remote connection and returns you to the local shell without shutting off the remote instance. 7. 7. Using a plain SSH client You can also connect using a plain SSH client from your *nix system or Windows SSH client like Putty. the client will be put in an interactive mode 7.3.3. Disconnecting from a remote console To disconnect from a remote console.3. you can stop the remote instance using osgi:shutdown.4. run the following from the karaf-install-dir/lib directory: bin/client -u tadmin -p tadmin -a 8101 hostname osgi:shutdown Talend ESB Container Administration Guide 22 . shell:logout or simply logout at the Karaf prompt.2. Using the remote console If you have connected to a remote console using ssh:ssh or the Karaf client.1. Stopping a remote instance 7.

To view help on a particular command. Note CXF and Camel are already preconfigured in the Talend OSGi container.Chapter 8. but you need to install Camel / CXF features in native Karaf to use these commands. SYNTAX cxf:list-endpoints [options] [bus] ARGUMENTS bus OPTIONS --help Display this help message The CXF bus name where to look for the Endpoints Talend ESB Container Administration Guide 23 . Commands supplied by Apache CXF and Camel These are commands that are related to Apache CXF and Camel functionality. type the command followed by --help or use the help command followed by the name of the command: karaf@trun> cxf:list-endpoints --help DESCRIPTION cxf:list-endpoints Lists all CXF Endpoints on a Bus.

starts a CXF Endpoint on a Bus.2. These are for version Camel 2. Commands supplied by Camel These commands related to Camel functionality. CXF commands Command cxf:list-busses cxf:list-endpoints cxf:stop-endpoint busid endpointName cxf:start-endpoint busid endpointName Parameters [options] [options] [bus] [options] bus endpoint Description Lists all CXF Busses bus is the optional CXF bus name where to look for the Endpoints stops a CXF Endpoint on a Bus. Camel commands Command camel:list-contexts camel:list-routes camel:info-context Parameters [options] [options] [options] name Description Lists the Camel contexts available in the current Karaf instance Displays the list of Camel routes available in the current Karaf instance Displays detail information about a given Camel context Starts the given Camel context Stops the given Camel context Provides detail information about a Camel route Renders the route in XML Starts the given route Stops the given route camel:start-context [options] name camel:stop-context [options] name camel:info-route camel:show-route camel:start-route camel:stop-route [options] name [options] name [options] name [options] name Talend ESB Container Administration Guide 24 .apache.html. endpoint is the Endpoint name to stop. Table 8. bus is CXF bus name where to look for the Endpoint. Commands supplied by CXF These commands related to CXF functionality.Chapter 8. Table 8. which is the current version used by Talend ESB. see http:// cxf.apache.org/karaf.1. bus is CXF bus name where to look for the Endpoint. endpoint is the Endpoint name to start.org/. For more information on CXF.x.2.8.1. Tip Use TAB key for completion on the name parameters below. Commands supplied by Apache CXF and Camel 8. [options] bus endpoint 8. Help for these commands is available at http:// camel.

The users. Managing users and passwords The default security configuration uses a property file located at karaf-install-dir/etc/ users.properties to store authorized users and their passwords.role][.properties file contains one or more lines. The default user name is tadmin and the associated password is tadmin too.1. 9.properties Talend ESB Container Administration Guide 25 . Managing roles JAAS roles can be used by various components.. Security 9.2. The three management layers (SSH.Chapter 9.role]. We strongly encourage you to change the default password by editing the above file before moving Karaf into production. The default role name is configured in the etc/system. its password and the associated roles: user=password[. each line defining a user.. JMX and WebConsole) all use a global role based authorization system. The users are currenly used in three different places in Karaf: • access to the SSH console • access to the JMX management layer • access to the Web console Those three ways all delegate to the same JAAS based security authentication.

passwords and roles from. All users authenticating for the management layer must have this role defined.role system property and the default value is admin. The format of the properties are as follows..role][.1. Available realms Karaf comes with several login modules that can be used to integrate into your environment. Security using the karaf.apache. Enabling password encryption In order to not keep the passwords in plain text.PropertiesLoginModule" flags="required"> users = $[karaf. This file uses the properties file format.webconsole Value sshRole jmxRole role 9.enabled true config:update # force a restart dev:restart The passwords will be encrypted automatically in the etc/users.4.karaf.3.base]/etc/users.apache. Encrypted passwords are prepended with {CRYPT} so that are easy to recognize. PropertiesLoginModule This login module is the one configured by default.jaas config:propset encryption.management org.shell org. The syntax for this value is the following: [classname:]principal where classname is the class name of the principal object (defaults to org.apache.karaf.modules. 9.modules.apache.properties..4.admin.apache.properties configuration file the first time the user logs in.apache.role].karaf. 9.karaf. each line defining a user.karaf. Note that roles can be changed for a given layer using ConfigAdmin in the following configurations: Layer SSH JMX Web PID org. its password and the associated roles: user=password[.RolePrincipal) and principal is the name of the principal of that class (defaults to admin).Chapter 9. <jaas:config name="karaf"> <jaas:module className= "org.karaf. It uses a properties text file to load the users.properties </jaas:module> Talend ESB Container Administration Guide 26 .jaas.jaas. the passwords can be stored encrypted in the configuration file. This can be easily enabled using the following commands: # edit config config:edit org.

JDBCLoginModule The JDBCLoginModule uses a database to load the users. Passing a data source as a JNDI name To use an JNDI name. <jaas:config name="karaf"> <jaas:module className="org.password = SELECT PASSWORD FROM USERS WHERE USERNAME=? query.4.JDBCLoginModule" flags="required"> datasource = jndi:aries:services/javax.karaf.3.3.modules.sql. the prefix osgi: needs to be provided. Name datasource query.JDBCLoginModule" flags="required"> datasource = osgi:javax. The example below assumes the use of Aries JNDI to expose services via JNDI.service. provided a data source (normal or XA).Chapter 9. 9. Instead of users for the PropertiesLoginModule. Passing a data source as an OSGi ldap filter To use an OSGi ldap filter. this configuration uses a pid value for the process ID of the configuration containing user definitions.modules.1.jaas. The data source and the queries for password and role retrieval are configurable. See the example below: <jaas:config name="karaf"> <jaas:module className="org. passwords and roles from. the prefix jndi: needs to be provided. with the use of the following parameters.sql.jndi.4.name=jdbc/karafdb) query.jdbc.2. passwords and roles.jaas. OsgiConfigLoginModule The OsgiConfigLoginModule uses the OSGi ConfigurationAdmin service to provide the users.DataSource/ \\ Talend ESB Container Administration Guide 27 .apache.apache.4.karaf. Security </jaas:config> 9.role Description The datasource as on OSGi ldap filter or as JDNI name The SQL query that retries the password of the user The SQL query that retries the roles of the user 9.4.DataSource/ \\ (osgi.role = SELECT ROLE FROM ROLES WHERE USERNAME=? </jaas:module> </jaas:config> 9.2.password query.jdbc.3.

the role lookup will be performed only at the first level (ONELEVEL).karaf.provider ssl. LDAPLoginModule The LDAPLoginModule uses a LDAP to load the users and roles.dc=apache.dn user.search.ldap.name.keystore ssl.g.username connection.factory ssl ssl.algorithm ssl. If "true". e. The default is simple.g.ldap. This parameter is optional. an SSL connection will be used The provider name to use for SSL The protocol name to use for SSL (SSL for example) The algorithm to use for the KeyManagerFactory and TrustManagerFactory (PKIX for example) The key store name to use for SSL. The LDAP base DN used to looking for roles.subtree role.modules. e. If "false".keyalias ssl.protocol ssl. Security (osgi. the role lookup will be recursive (SUBTREE). cn If "true".4.LDAPLoginModule" Talend ESB Container Administration Guide 28 .LdapCtxFactory If "true" or if the protocol on the connection.g. A example of LDAPLoginModule usage follows: <jaas:config name="karaf"> <jaas:module className="org.4.dc=org The LDAP filter used to looking for user's role.apache. The LDAP base DN used to looking for user. Define the authentication backend used on the LDAP server.sun.jaas.filter role. ldap://hostname Admin username to connect to the LDAP. The LDAPLoginModule supports the following parameters: Name connection. ou=role.filter user.base.dc=org The LDAP filter used to looking for user. e.jndi.g.name=jdbc/karafdb) query.truststore Description The LDAP connection URL.dc=apache. Only used if the connection. e. ou=user.context. the user lookup will be recursive (SUBTREE).username is specified.service. Define the initial context factory used to connect to the LDAP server.g. bind the users on the LDAP to check passwords.search.url connection. Admin password to connect to the LDAP.password user. (uid=%u) where %u will be replaced by the username. If "false". the LDAP connection will be anonymous.base.jndi. The key alias to use for SSL The trust store name to use for SSL.role = SELECT ROLE FROM ROLES WHERE USERNAME=? </jaas:module> </jaas:config> 9. e.g. if it's not provided.dn role. The trust store must be deployed using a jaas:keystore configuration.attribute role. (member:=uid=%u) The LDAP role attribute containing the role string used by Karaf. The key store must be deployed using a jaas:keystore configuration.url is ldaps. the user lookup will be performed only at the first level (ONELEVEL). e.password = SELECT PASSWORD FROM USERS WHERE USERNAME=? query.Chapter 9.subtree authentication initial. The default is com.

properties configuration file to add the following property: Talend ESB Container Administration Guide 29 .base.ou=system role. the following configuration can be used as an example: <ext:property-placeholder /> <jaas:config name="karaf" rank="1"> <jaas:module className="org.dn = ou=users. The JVM imposes some restrictions about the use of such provider JAR files.dc=org user.name.subtree = true role.filter = (cn=%u) user. Security flags="required"> connection.ldap.karaf. Deploying security providers Some applications require specific security providers to be available.search.home}/etc/trusted.search.url = ldap://localhost:389 user. namely.search.dn = ou=group.filter = (uniqueMember=uid=%u) role.subtree = true role.filter = (uid=%u) user.ou=system user.base.name.dn = ou=user.modules.algorithm=PKIX </jaas:module> </jaas:config> <jaas:keystore name="ks" path="file:///${karaf.5.attribute = cn role.dn = ou=groups.security) in order to register them. While this approach works fine.protocol=SSL ssl.Chapter 9.base.jaas. However Talend ESB offers a simple way to configure additional security providers: • put your provider jar in [karaf-install-dir]/lib/ext • modify the [karaf-install-dir]/etc/config.attribute = cn role. it has a global effect and requires that all servers are configured accordingly.subtree = true authentication = simple ssl.dc=apache.ks" keystorePassword="secret" /> 9.apache.url = ldaps://localhost:10636 user. that they need to be signed and be available on the boot classpath.truststore=ks ssl. One way to deploy such providers is to put them in the JRE folder at $JAVA_HOME/jre/ lib/ext and modify each provider's security policy configuration ($JAVA_HOME/jre/lib/security/ java.LDAPLoginModule" flags="required"> connection. such as BouncyCastle.base.dc=apache.subtree = true authentication = simple </jaas:module> </jaas:config> If you want to use an SSL connection.dc=org role.filter = (member:=uid=%u) role.search.

providers = \\ org.bootdelegation property in the same configuration file: org..providers = xxx.bootdelegation = .framework.jce. It can be done by modifying the org.karaf. Security org.Chapter 9. you may want to provide access to the classes from those providers from the system bundle so that all bundles can access those.framework.apache.osgi.org.apache.bouncycastle.karaf.osgi..security.bouncycastle* Talend ESB Container Administration Guide 30 .BouncyCastleProvider In addition.provider. For example: org..security.yyy The value of this property is a comma separated list of the provider class names to register.

1.Chapter 10.ops4j. Logging System Karaf provides a powerful logging system based on OPS4j Pax Logging.pax. Configuration file The configuration of the logging system uses a standard Log4j configuration file at the following location: [karaf_install_dir]/etc/org.logging.1.1. In addition to being a standard OSGi Log service. Talend ESB Container Administration Guide 31 . it supports the following APIs: • Apache Commons Logging • SLF4J • Apache Log4j • Java Util Logging Karaf also comes with a set of console commands that can be used to display.cfg You can edit this file at runtime and any change will be reloaded and be effective immediately. 10. Configuration 10. view and change the log levels.

.apache.threshold=WARN . Console Log Commands The log scope comes with several commands -. you might want to run the following commands: <log:set DEBUG . you can turn on this appender on by adding it to the list of configured appenders using the log4j. if you want to debug something.. Configuring the appenders The default logging configuration defines three appenders: • the stdout console appender is disabled by default. To configure those in a persistent way. “Log Scope” for a full list. the default configuration will not provide enough information to debug most problems. out.cfg file. log4j... with the locale console disabled). 10. log4j.rootLogger property • the out appender is the one enabled by default. It logs events to a number of rotating log files of a fixed size. The default configuration uses the bundle symbolic name as the file name to log to 10.3.. osgi:VmLogAppender .rootLogger=DEBUG.ops4j. If you plan to run Karaf in server mode only (i. stdout.2.log. Changing the log levels The default logging configuration sets the logging levels so that the log file will provide enough information to monitor the behavior of the runtime and provide clues about what caused a problem. The example below shows how to set the root logger to DEBUG but limiting the information displayed on the console to >WARN.e. • the sift appender can be used instead to provide a per-bundle log file.2.1.see Section 5... do something . You can easily change the parameters to control the number of files using maxBackupIndex and their size maxFileSize. Advanced Configuration The logging backend uses Log4j.2. However.rootLogger=DEBUG.appender.karaf.logging.Chapter 10.stdout. When debugging a problem in Karaf you may want to change the level of logging information that is displayed on the console.cfg 10. The log commands have a separate configuration file: [karaf_install_dir]/etc/org. osgi:VmLogAppender log4j. < log:display Note that the log levels set using the log:set commands are not persistent and will be lost upon restart. but offers a number of additional features. Talend ESB Container Administration Guide 32 . You will want to set its logging level to DEBUG in the org. you should edit the configuration file mentioned above using the config commands or directly using a text editor of your choice. out. The most useful logger to change when trying to debug an issue with Karaf is the root logger.pax.3. Logging System 10..1. For example.6.

root-ref=[true|false] log4j.appender-ref=[appender-ref] 10.3.id: the id of the bundle from which the class is loaded • bundle.appender. OSGi specific MDC attributes Pax-Logging provides the following attributes by default: • bundle.appenders= // [comma-separated-list-of-appender-names] Below is a real example: log4j.out.net.LevelMin=DEBUG 10. MDC sifting appender An MDC sifting appender is available to split the log events based on MDC attributes.log4j.appender.3.log4j.filter.appender.varia.appender.appender.appenders=jms log4j.f1.1.4. Error handlers Error handlers can be added using the following syntax: log4j.jms=org.logger-ref=[logger-ref] log4j..errorhandler.5. Nested appenders Nested appenders can be added using the following syntax: log4j.[filter-name]. 10.name: the symbolic-name of the bundle • bundle.appender.appender.JMSAppender .3.[filter-name]=[filter-class] log4j.errorhandler=[error-handler-class] log4j.filter.AsyncAppender log4j.apache.appender.3.log4j.appender.async.appender.[option]=[value] Below is a real example: log4j.out.appender.appender.Chapter 10. Logging System 10.filter.out.[appender-name].async=org.version: the version of the bundle 10.filter.. Below is a configuration example for this appender: Talend ESB Container Administration Guide 33 .apache.[appender-name].LevelMax=FATAL log4j.errorhandler.[appender-name].3.f1.[appender-name].appender.apache.3.[appender-name].filter.f1=org.LevelRangeFilter log4j.[appender-name].2.errorhandler.[appender-name]. Filters Appender filters can be added using the following syntax: log4j.

apache.appender.appender.0] at org.java:71)[21:org.karaf.apache.java:169)[21:org.java:225)[21:org.IllegalArgumentException: Command not found: *:foo at org.6.console:2.. Enhanced OSGi stack trace renderer This renderer is configured by default in Karaf and will give additional informations when printing stack traces.apache.pax-logging-service .Pipe. } Then you need to package the appender in a jar with a Manifest like this: Manifest: Bundle-SymbolicName: org.7.gogo.apache.name\\}. Using your own appenders If you plan to use your own appenders.appender.shell.karaf.shell.console:2.mydomain.console:2.1. For each line of the stack trace.runtime.execute (CommandSessionImpl.default=karaf log4j.layout.sift.karaf.runtime.appender.0_20] 10.pax.appender.java:101)[21:org.log4j.pax.run(Thread.felix.pax-logging-service. Logging System log4j.1.apache.apache.sift. This way.logging.shell.run (Pipe.execute (Closure.felix.console:2.32C %4L | %m%n log4j.log log4j.0] at org.appender=org.16t | %-32.layout=org.shell.sift=org.apache.felix.karaf. So for example you write a log4j appender: class MyAppender extends AppenderSkeleton { ..shell.sift.felix.appender.1. Now you can use the appender in your log4j config file like shown in the config examples above.runtime.MDCSiftingAppender log4j.console.5p | %-16. Talend ESB Container Administration Guide 34 .data}/log/$\\{bundle.1.apache.ConversionPattern= \\ %d{ABSOLUTE} | %-5.appender.ops4j.karaf.apache.gogo.Closure..appender.apache.ops4j.1.key=bundle.shell.sift.appender.6. it will display OSGi specific informations related to the class on that line: the bundle id.file=${karaf.java:79)[21:org.jline.myappender Fragment-Host: org.sift.executeStatement (Closure.Chapter 10.console:2.sift.shell.apache.run (Console.apache.32c{1} | %-32.runtime.Closure. the bundle symbolic name and the bundle version.apache.gogo.appender.0] at org.0] at org.shell.Console.karaf.felix. This information can greatly help diagnosing problems in some cases. the underlying logging system will be able to see and use your appenders.PatternLayout log4j.3.shell. you need to create an OSGi bundle and attach it as a fragment to the bundle with a symbolic name of org.Thread.1.java:637)[:1..logging.gogo.name log4j.sift.shell. The information is appended at the end of each line in the following format id:name:version as shown below: java.shell.karaf.console:2.log4j.Closure.appender.3.shell.sift.gogo.runtime.append=true 10.apache.FileAppender log4j.CommandSessionImpl.lang.0] at java.log4j.java:162)[21:org.appender.0] at org.lang.apache.execute (Closure.

Deployer The Karaf deployer is used for deploying bundles or groups of bundles (called features) into the Karaf container. The following diagram describes the architecture of the deployer.Chapter 11. Talend ESB Container Administration Guide 35 .

0.servicemix.5) [32] [Active ] [Created ] [ 30] Apache Karaf :: Deployer :: Wrap Non OSGi Jar Karaf wrap deployer looks for jar files in the deploy folder.1. It's a standard deployer (you don't need to install additional Karaf features): karaf@trun> la|grep -i wrap [ 1] [Active ] [ ] [ 5] OPS4J Pax Url . The jar files is considered as non-OSGi if the MANIFEST doesn't contain the Bundle-SymbolicName and Bundle-Version attributes.Chapter 11.1. The non-OSGi jar file is transformed into an OSGi bundle.publish-context:=false. The deployer will transform on the fly any spring configuration file dropped into the deploy folder into a valid OSGi bundle. The deployer tries to populate Talend ESB Container Administration Guide 36 .2. Features deployer To be able to hot deploy features from the deploy folder. \\ 11. Spring deployer Karaf includes a deployer that is able to deploy plain blueprint or spring-dm configuration files.0.> <manifest> Require-Bundle= my-bundle </manifest> 11.. Wrap deployer The wrap deployer allows you to hot deploy non-OSGi jar files ("classical" jar files) from the deploy folder.1.2. Deployer 11. If you want to install a single feature. For example my-config-1. or if there is no MANIFEST at all. If you need to customize the generated manifest.wrap: (1. A bundle will be created and its installation (automatic) will trigger the installation of all features contained in the descriptor. The generated OSGi manifest will contain the following headers: Manifest-Version: 2 Bundle-SymbolicName: [name of the file] Bundle-Version: [version of the file] Spring-Context: *. you can do so by including an xml element in your Spring configuration: <spring:beans .3.apache. see the Chapter 13. you can do so by writing a feature descriptor like the following: <features> <repository>mvn:org. Provisioning.create-asynchronously:=true Import-Package: [required packages] DynamicImport-Package: * The name and version of the file are extracted using a heuristic that will match common patterns. you can simply drop a Feature descriptor on that folder.nmr/apache-servicemix-nmr/ 1.0/xml/features</repository> <feature name="nmr-only"> <feature>nmr</feature> </feature> </features> For more informations about features. Removing the file from the deploy folder will uninstall the features. The default imported packages are extracted from the Spring file definition and includes all classes referenced directly..xml will lead to name = my-config and version = 1.0.

apache.lang".3 Generated-By-Ops4j-Pax-From = wrap:file:/home/onofreje/workspace/karaf/ assembly/target/apache-karaf-2.1_09-85 ("Apple Computer.apache.math.apache.lang.enums.lang.357 Specification-Version = 2.0.commons.commons.lang.lang.apache. org.commons.commons.1 Originally-Created-By = 1.apache.commons. org.lang. org.lang.commons. you can see that the bundle exports all packages with optional resolution and that Bundle-SymbolicName and Bundle-Version have been populated: karaf@trun> osgi:headers 41 commons-lang (41) ----------------Specification-Title = Commons Lang Tool = Bnd-0. org.lang.resolution:=optional.apache. you will see: karaf@trun> la|grep -i commons-lang [ 41] [Active ] [ ] [ 60] commons-lang (2.3.resolution:=optional.commons.apache. if you simply copy commons-lang-2.exception".uses:="org.resolution:=optional.apache.apache.resolution:=optional.lang.3. Deployer the Bundle-SymbolicName and Bundle-Version extracted from the jar file path.5 Package = org.resolution:=optional.resolution:=optional.apache.apache.mutable. For example.3 Specification-Vendor = Apache Software Foundation Implementation-Version = 2.lang.99.math. org.commons. uses:="org.apache.math.apache.commons.apache.commons.apache.apache.apache Created-By = 1.commons.commons.apache.lang.lang.lang.0_21 (Sun Microsystems Inc. org.apache.3) If you take a look on the commons-lang headers.builder.exception.0 Bnd-LastModified = 1297248243231 X-Compile-Target-JDK = 1. org. org.6.commons.uses:=org.uses:="org. org.commons. org.lang.resolution:=optional.enum.commons. org.exception.apache.enum.3 Implementation-Vendor-Id = org.commons.jar$ Bundle-SymbolicName=commons-lang&Bundle-Version=2. Inc.") Ant-Version = Apache Ant 1.3.6.apache. Talend ESB Container Administration Guide 37 .lang.lang.jar (which is not an OSGi bundle) into the deploy folder.apache. org.Chapter 11.lang.lang.text.apache.) Implementation-Title = Commons Lang Manifest-Version = 1.apache. org. org.uses:=org.builder.commons.commons.builder.apache.commons.lang.commons.lang.enums.lang.apache.uses:=org.commons.3 Bundle-ManifestVersion = 2 Import-Package = org.uses:=org.time.commons.org.commons.lang.99-SNAPSHOT/deploy/commons-lang-2.org.lang.commons. org.commons.lang X-Compile-Source-JDK = 1.apache.resolution:=optional.math.commons.lang.3 Extension-Name = commons-lang Implementation-Vendor = Apache Software Foundation Bundle-Name = commons-lang Bundle-SymbolicName = commons-lang Bundle-Version = 2.mutable.commons.apache.lang.resolution:=optional Export-Package = org.lang.

Talend ESB Container Administration Guide 38 .uses:=org.lang.4.lang.commons.commons.commons. org. War deployer See Chapter 14.math".apache.Chapter 11.apache. org.lang. Web Applications for information on web application (war) deployment. Deployer org.lang 11.apache.commons.commons.uses:=org.text.apache.apache.time.lang.

The following section explains servlet context configuration in more detail.web. 12. For example. CXFServlet.cfg You can edit these files at runtime and any change will be reloaded and be effective immediately.apache. First we look at the configuration files. Karaf and CXF provide servlet context custom configuration. The configuration of the servlet context for the OSGi HTTP Service is specified in a file at the following location: [karaf_install_dir]/etc/org. Talend ESB Container Administration Guide 39 . Please read the Servlet Transport on the Apache CXF website for additional information about this servlet context.ops4j. using a servlet transport.pax.cxf.1. for building services. you can deploy into a servlet container.cfg The configuration of the port for the OSGi HTTP Service is specified in: [karaf_install_dir]/etc/ org. Configuration Note The paths [karaf_install_dir]/ and [Talend-ESB-Version]/container are equivalent. Servlet Context A servlet context defines a set of methods which allows a servlet to communicate with its servlet container.Chapter 12.osgi.

2.hello_soap_http. Servlet Context 12.osgi. Configuring the context When editing the files.pax.1.http. Relative endpoint address The CXFServlet uses a relative address for the endpoint rather than a full http address.2.port=8040 12.apache.hello_soap_http. the org.service.cfg file specified prefix for the services is: org.Chapter 12. the relative endpoint addresses would be configured as: <jaxws:endpoint id="greeter" implementor="org.cxf.servlet.ops4j.apache. given an implementation class called GreeterImpl with endpoints greeter and greeterRest.GreeterImpl" address="/GreeterRest"/> The cumulative result of these changes is that the endpoint address for the servlet will be: http:// {server}:8040/services/Greeter1 and http://{server}:8040/services/GreeterRest Talend ESB Container Administration Guide 40 .apache.cxf.osgi.cfg file specified port for the services is: org. For example.web.apache.GreeterImpl" address="/Greeter1"/> <jaxrs:server id="greeterRest" serviceClass="org.context=/services The org.

1. The provisioning system uses xml "repositories" that define a set of features. Example: Deploying a sample feature In the rest of this chapter. But as a quick demonstration. we'll run a sample Apache Camel feature already present in the Talend ESB distribution. These features:addUrl and features:install commands download the Camel features descriptor and install this example. Such a mechanism is mainly provided by a set of commands available in the features shell. we describe in detail the process involved in provisioning. run the following commands: features:addUrl mvn:org.apache.camel/camel-example-osgi/2. yet flexible. In the console.5. The output is as follows: >>>> SpringDSL set body: >>>> SpringDSL set body: >>>> SpringDSL set body: Fri Jan 07 11:59:51 CET 2011 Fri Jan 07 11:59:53 CET 2011 Fri Jan 07 11:59:55 CET 2011 Talend ESB Container Administration Guide 41 . Provisioning Karaf provides a simple.0/xml/features features:install camel-example-osgi The example installed uses Camel to start a timer every 2 seconds and output a message on the console. 13.Chapter 13. way to provision applications or "features".

bundles. Note: By default.4. each one representing an application that can be installed.aopalliance/1.1.0.apache. all the features defined in a repository are not installed at the launch of Apache Karaf (see Section 13.4.1. We recommend using this XML schema.apache.karaf/apache-camel/2.2.. The feature is identified by its name which must be unique amongst all the repositories used and consists of a set of bundles that need to be installed along with some optional dependencies on other features and some optional configurations for the Configuration Admin OSGi service. Be careful when you define them as there is a risk of 'cycling' dependencies.karaf/apache-karaf/2.4.bundles/ \\ org. You may also verify your descriptor before adding it to Karaf by simply validation. Repositories So. first we look at feature repositories.apache.camel.RELEASE</bundle> <bundle>mvn:org.nmr/apache-servicemix-nmr/ \\ 1. even from IDE level.0. Stopping and uninstalling the sample application To stop this demo.0.0.3.springframework/spring-beans/3.org/xmlns/features/v1.org/xmlns/features/v1.springframework/spring-context/3. <features xmlns="http://karaf.springframework/spring-aop/3.4.1.springframework/spring-context-support/3.0.apache.1. Here is an example of such a repository: <features xmlns="http://karaf. It will allow Karaf to validate your repository before parsing. one would write the following definition: Talend ESB Container Administration Guide 42 .RELEASE"> <bundle>mvn:org.RELEASE </bundle> </feature> </features> A repository includes a list of feature elements. run the following command: features:uninstall camel-example-osgi 13.0. 13.0"> <feature name="spring" version="3. Bundles The main information provided by a feature is the set of OSGi bundles that defines the application.apache.0"> <repository>mvn:org.apache. For example.springframework/spring-core/3.0/xml/features</repository> <repository>mvn:org.0.4.0.Chapter 13.2. Such bundles are URLs pointing to the actual bundle jars.2/xml/features </repository> ..0_1</bundle> <bundle>mvn:org.RELEASE</bundle> <bundle>mvn:org.servicemix.servicemix. Provisioning 13.5.servicemix.0/xml/features </repository> <repository>mvn:org.4.RELEASE</bundle> <bundle>mvn:org. “Service configuration” for more information).4. The complete xml schema for feature descriptor are available on Features XML Schema page.apache.RELEASE</bundle> <bundle>mvn:org. References to features define in other repositories are allow and can be achieved by adding a list of repository.

Chapter 13. Provisioning

<bundle>http://repo1.maven.org/maven2/org/apache/servicemix/nmr/ org.apache.servicemix.nmr.api/1.0.0-m2/ \\ org.apache.servicemix.nmr.api-1.0.0-m2.jar</bundle>

\\

Doing this will make sure the above bundle is installed while installing the feature. However, Karaf provides several URL handlers, in addition to the usual ones (file, http, etc...). One of these is the maven URL handler, which allow reusing maven repositories to point to the bundles.

13.2.1.1. Maven URL Handler
The equivalent of the above bundle would be: <bundle> mvn:org.apache.servicemix.nmr/org.apache.servicemix.nmr.api/1.0.0-m2 </bundle> In addition to being less verbose, the maven url handlers can also resolve snapshots and can use a local copy of the jar if one is available in your maven local repository. The org.ops4j.pax.url.mvn bundle resolves mvn URLs. This flexible tool can be configured through the configuration service. For example, to find the current repositories type: karaf@trun:/> config:list and the following will display:

Pid: org.ops4j.pax.url.mvn BundleLocation: mvn:org.ops4j.pax.url/pax-url-mvn/0.3.3 Properties: service.pid = org.ops4j.pax.url.mvn org.ops4j.pax.url.mvn.defaultRepositories = file:/opt/development/ \\ karaf/assembly/target/apache-felix-karaf-1.2.0-SNAPSHOT/ \\ system@snapshots org.ops4j.pax.url.mvn.repositories = http://repo1.maven.org/maven2, http://svn.apache.org/repos/asf/servicemix/m2-repo below = list of repositories and even before the local repository The repositories checked are controlled by these configuration properties. For example, org.ops4j.pax.url.mvn.repositories is a comma separated list of repository URLs specifying those remote repositories to be checked. So, to replace the defaults with a new repository at http://www.example.org/repo on the local machine:

karaf@trun:/> config:edit org.ops4j.pax.url.mvn karaf@trun:/> config:proplist service.pid = org.ops4j.pax.url.mvn org.ops4j.pax.url.mvn.defaultRepositories = file:/opt/development/karaf/ assembly/target/apache-felix-karaf-1.2.0-SNAPSHOT/system@snapshots org.ops4j.pax.url.mvn.repositories = http://repo1.maven.org/maven2, http://svn.apache.org/repos/asf/servicemix/m2-repo below = list of repositories and even before the local repository karaf@trun:/> config:propset org.ops4j.pax.url.mvn.repositories http://www.example.org/repo karaf@trun:/> config:update By default, snapshots are disabled. To enable an URL for snapshots append @snapshots. For example: http:// www.example.org/repo@snapshots. Repositories on the local are supported through file:/ URLs.

Talend ESB Container Administration Guide

43

Chapter 13. Provisioning

13.2.1.2. Bundle start-level
By default, the bundles deployed through the feature mechanism will have a start-level equals to the value defined in the configuration file config.properties with the variable karaf.startlevel.bundle=60. This value can be changed using the xml attribute start-level. <feature name='my-project' version='1.0.0'> <feature version='2.4.0'>camel-spring</feature> <bundle start-level='80'>mvn:com.mycompany.myproject/ myproject-dao</bundle> <bundle start-level='85'>mvn:com.mycompany.myproject/ myproject-service</bundle> <bundle start-level='85'>mvn:com.mycompany.myproject/ myproject-camel-routing</bundle> </feature>

\\ \\ \\

The advantage to define the start-level of a bundle is that you can deploy all your bundles including those of the project with the 'infrastructure' bundles required (e.g : camel, activemq) at the same time and you will have the guaranty when you use Spring Dynamic Module (to register service through OSGI service layer), Blueprint that by example Spring context will not be created without all the required services installed.

13.2.1.3. Bundle stop/start
The OSGI specification allows to install a bundle without starting it. To use this functionality, simply add the following attribute in your <bundle> definition <feature name='my-project' version='1.0.0'> <feature version='2.4.0'>camel-spring</feature> <bundle start-level='80' start='false'>mvn:com.mycompany.myproject/ myproject-dao</bundle> <bundle start-level='85' start='false'>mvn:com.mycompany.myproject/ myproject-service</bundle> <bundle start-level='85' start='false'>mvn:com.mycompany.myproject/ myproject-camel-routing</bundle> </feature>

\\ \\ \\

13.2.1.4. Bundle dependency
A bundle can be flagged as being a dependency. Such information can be used by resolvers to compute the final list of bundles to be installed.

13.2.2. Dependent Features
Dependent features are useful when a given feature depends on another feature to be installed. Such a dependency can be expressed easily in the feature definition: <feature name="jbi"> <feature>nmr</feature> ...

Talend ESB Container Administration Guide

44

Chapter 13. Provisioning

</feature> The effect of such a dependency is to automatically install the required nmr feature when the jbi feature will be installed. A version range can be specified on the feature dependency: <feature name="spring-dm"> <feature version="[2.5.6,4)">spring</feature> ... </feature> In such a case, if no matching feature is already installed, the feature with the highest version available in the range will be installed. If a single version is specified, this version will be chosen. If nothing is specified, the highest available will be installed.

13.2.3. Configurations
The configuration section allows to deploy configuration for the OSGi Configuration Admin service along a set of bundles. Here is an example of such a configuration: <config name="com.foo.bar"> myProperty = myValue </config> The name attribute of the configuration element will be used as the ManagedService PID for the configuration set in the Configuration Admin service. When using a ManagedServiceFactory, the name attribute is servicePid_aliasId_, where servicePid is the PID of the ManagedServiceFactory and aliasId is a label used to uniquely identify a particular service (an alias to the factory generated service PID). Deploying such a configuration has the same effect than dropping a file named com.foo.bar.cfg into the etc folder. The content of the configuration element is set of properties parsed using the standard java property mechanism. Such configuration as usually used with Spring-DM or Blueprint support for the Configuration Admin service, as in the following example, but using plain OSGi APIs will of course work the same way: <bean ...> <property name="propertyName" value="${myProperty}" /> </bean> <osgix:cm-properties id="cmProps" persistent-id="com.foo.bar"> <prop key="myProperty">myValue</prop> </osgix:cm-properties> <ctx:property-placeholder properties-ref="cmProps" /> There may also be cases where you want to make the properties from multiple configuration files available to your bundle context. This is something you may want to do if you have a multi-bundle application where there are application properties used by multiple bundles, and each bundle has its own specific properties. In that case, <ctx:property-placeholder> won't work as it was designed to make only one configuration file available to a bundle context. To make more than one configuration file available to your bundle-context you would do something like this: <beans:bean id="myBundleConfigurer" class= "org.springframework.beans.factory.config.PropertyPlaceholderConfig"> <beans:property name="ignoreUnresolvablePlaceholders" value="true"/> <beans:property name="propertiesArray"> <osgix:cm-properties id="myAppProps" persistent-id="myApp.props"/> <osgix:cm-properties id="myBundleProps" persistent-id="my.bundle.props"/> </beans:property>

Talend ESB Container Administration Guide

45

a configuration file for jetty (jetty. Then we are passing in a beans array and inside of that array is where we set our osgix:cm-properties elements.2. They use URLs pointing to features descriptors. Configuration files In certain cases it is needed not only to provide configurations for the configuration admin service but to add additional configuration files e.4. It even might be help full to deploy a configuration file instead of a configuration for the config admin service since.3. • features:refreshUrl: Reload the repositories to obtain a fresh list of features Karaf maintains a persistent list of these repositories so that if you add one URL and restart Karaf. the features will still be available.1.Chapter 13. it can be handy to reload it in the Kernel without having to restart it or to remove then add again this URL. For more informations about using the Configuration Admin service in Spring-DM. the resolver will use the OBR service to determine the list of bundles to install (bundles flagged as dependency will only be used as possible candidates to solve various constraints). see the Spring-DM documentation. The default resolver will simply return the list of bundles provided in the feature description.xml">mvn:org. <configfile finalname="/etc/jetty. The obr resolver can be installed and used instead of the standard one.2. In that case.version}/xml/jettyconfig</configfile> \\ 13. A resolver will be use to obtain the list of bundles to actually install for a given feature. we are using SpringDM with osgi as the primary namespace. 13. Talend ESB Container Administration Guide 46 .karaf/apache-karaf/ ${project. The refreshUrl command is mostly used when developing features descriptors: when changing the descriptor. while the value references the Maven artifact to deploy. the most common ones being http. • features:addUrl: Add a list of repository URLs to the features service • features:removeUrl: Remove a list of repository URLs from the features service • features:listUrl: Display the repository URLs currently associated with the features service. Instead of using ctx:contextplaceholder we are using the "PropertyPlaceholderConfig" class.apache. Provisioning </beans:bean> In this example. 13. To achieve this the attribute finalname shows the final destination of the configfile. Feature resolver The resolver attribute on a feature can be set to force the use of a given resolver instead of the default resolution process.xml).g. Repository management The following commands can be used to manage the list of descriptors known by Karaf. This element "returns" a properties bean. These URLs can use any protocol known to Apache Karaf. Commands 13.3. file and mvn.5.

cfg can be modified to customize the behavior when starting the Kernel for the first time.0"> <feature name="spring-web" version="2.karaf.6.2.0-m2/xml/features features:install nmr \\ To use a file handler to deploy a features file (note the path is relative to the Apache Karaf installation directory): features:addUrl file:base/features/features.0.xml To deploy bundles from file system without using Maven: As we can use file:// as protocol handler to deploy bundles. Talend ESB Container Administration Guide 47 .3. Provisioning 13. and features:list.6.SEC01.servicemix. See Section 5.4.jar</bundle> </feature> </features> Note the path again is relative to Apache Karaf installation directory.apache.apache. 13.nmr/apache-servicemix-nmr/ 1. Features management Common features: scope commands used in features management include features:install. This configuration file contains two properties: • featuresBoot: a comma separated list of features to install at startup • featuresRepositories: a comma separated list of feature repositories to load at startup This configuration file is of interest if you plan to distribute a Apache Karaf distribution which includes preinstalled features. Service configuration A simple configuration file located in [FELIX:karaf]/etc/org.2.0.4.features.3.org/xmlns/features/v1. features:uninstall.Chapter 13.5.3. 13.5. Examples To install features using mvn handler: features:addUrl mvn:org. “Features Scope” for more information on these commands.apache.SEC01"> <bundle>file:base/bundles/spring-web-2. you can use the following syntax to deploy bundles when they are located in a directory which is not available using Maven: <features xmlns="http://karaf.

2. .2. 14.0] obr [uninstalled] [2.0 karaf-2. Installing WAR support The following steps will install the "war" feature (support for deploying WAR files with Servlet and JSPs into a Jetty server) into your Karaf instance.2.0 karaf-2. .0] ssh . .2. List the available features karaf@trun> features:list State Name .0 karaf-2.2. . [uninstalled] [2.2.2.0 karaf-2.2.0] http [uninstalled] [2. 2. karaf-2.2. 1.0 Install the war feature (and the sub-features it requires) .2.karaf@trun> features:install war Note: you can use the -v or --verbose to see exactly what Karaf does Talend ESB Container Administration Guide 48 .2.1.Chapter 14.0] config [uninstalled] [2.0] webconsole [installed ] [2.2.0 karaf-2. Web Applications Karaf provides an ability to deploying WAR-based web applications within the Jetty server contained in the Karaf instance.0] war [uninstalled] [2.

jetty/jetty-http/7.jetty/jetty-security/7.8.0.2-SNAPSHOT Installing bundle mvn:org.1.1.22. Web Applications karaf@trun> features:install -v war Installing feature war 2.8. .web/pax-web-extender-war/ 0.ops4j.ops4j.WAR (1.2.0.0. war-i: (1.pax.war:.6.url/pax-url-war/1.pax.0) Jetty (1.2-SNAPSHOT Installing bundle mvn:org.0) Extender .Whiteboard [ 42] [Active ] [ ] [ 60] [ 41] [Active ] [ ] [ 60] Name geronimo-servlet_2.v20100715 Installing bundle mvn:org.ops4j.pax.5_spec/1.jetty/jetty-servlet/7. . Verify the features were installed servicemix> features/list State Name .eclipse.ops4j.1.1.web/pax-web-jsp/0.99-SNAPSHOT Installing feature http 2.2 Found installed bundle: org.0 .1.pax.0] war karaf-2.2-SNAPSHOT Installing bundle mvn:org.web/pax-web-deployer/0.6.apache.ops4j.eclipse.eclipse.6.servicemix.1.1.web/pax-web-runtime/0.ops4j.pax.apache.0) Service SPI (1.2.Chapter 14.99-SNAPSHOT Installing feature jetty 7. [installed ] [2.2.jetty/jetty-server/7.1.bundles.0) OPS4J Pax OPS4J Pax Web Web Web Web Web Web Web API (1.v20100715 Installing bundle mvn:org.2.1.asm [10] Installing bundle mvn:org.6.eclipse.6.0) Runtime (1.0] http karaf-2.apache.0.eclipse.ops4j.eclipse.4) Talend ESB Container Administration Guide 49 .0 [installed ] [2.5_spec (1. . 4. [ 32] [Active ] [ ] [ 60] [ 33] [Active ] [ ] [ 60] jetty (6.v20100715 Installing bundle mvn:org.1.pax.ops4j.pax.geronimo.web/pax-web-jetty/0.8.8.web/pax-web-extender-whiteboard/ 0.0.specs/ geronimo-servlet_2.2.2-SNAPSHOT Installing bundle mvn:org.1.8.0.FileInstall Deployer (1.1.6.jetty/jetty-util/7.2-SNAPSHOT Installing bundle mvn:org.2-SNAPSHOT Installing bundle mvn:org.6.6.2-SNAPSHOT Installing bundle mvn:org.eclipse.pax.1.0) Url .4 3.v20100715 Installing bundle mvn:org.6.karaf/apache-karaf/ 2.v20100715 Checking configuration file mvn:org.jetty/jetty-io/7.8.0.jetty/jetty-xml/7. .1. .v20100715 Installing bundle mvn:org.v20100715 Installing bundle mvn:org.pax. .2-SNAPSHOT Installing bundle mvn:org.2.2) [ 34] [Active ] [ ] [ 60] [ 35] [Active ] [ ] [ 60] [ 36] [Active ] [ ] [ 60] [ 37] [Active ] [ ] [ 60] [ 38] [Active ] [ ] [ 60] [ 39] [Active ] [ ] [ 60] [ 40] [Active ] [ ] [ 60] Extender .eclipse.0.0) Jsp Support (1.v20100715 Installing bundle mvn:org.2) Apache ServiceMix :: Bundles :: OPS4J Pax OPS4J Pax OPS4J Pax OPS4J Pax OPS4J Pax OPS4J Pax OPS4J Pax (1.web/pax-web-api/0. Verify the installed bundles were started karaf@trun> osgi:list START LEVEL 100 ID State Level .ops4j.1.8.v20100715 Installing bundle mvn:org.99-SNAPSHOT/xml/jettyconfig Installing bundle mvn:org.jetty/jetty-continuation/7.web/pax-web-spi/0.8.0) Web .

2. 1.war?Bundle-SymbolicName= \\ tomcat-sample&Webapp-Context=/sample Then open your web browser and point to http://localhost:8181/sample/index. If you want to deploy a sample web application into Karaf. Web Applications . To deploy a WAR (JSP or Servlet) to Jetty. update its MANIFEST. Talend ESB Container Administration Guide 50 .apache.ops4j.5-doc/appdev/sample/sample. HTTP ERROR: 404 NOT_FOUND RequestURI=/ Powered by jetty:// 14.org/wiki/display/paxweb/WAR+Extender Copy the updated WAR (archive or extracted files) to the deploy directory. you could use the following command: karaf@trun> osgi:install -s webbundle:http://tomcat. The Jetty server should now be listening on http://localhost:8181/.html.MF to include the required OSGi headers as described here: http://team.Chapter 14. but with no published applications available. 2. 5.org/ \\ tomcat-5. . Deploying a WAR to the installed web feature The following steps will describe how to install a simple WAR file (with JSPs or Servlets) to the just installed web feature. .

Karaf Management MBeans MBean (org. They provide more or less the same actions that you can do using the Karaf shell commands.Chapter 15. The list of MBeans available: Table 15.1. JConsole provided in the Oracle or IBM JDK).karaf:type value) Description admin bundles config dev diagnostic features log packages services system web obr administrates the child instances manipulates the OSGi bundles manipulates the Karaf configuration files (in the /etc folder) and the ConfigAdmin layer provides information and administration of the OSGi framework used to create information files (dumps) about Karaf activity manipulate the Karaf features manipulate the logging layer manipulate the PackageAdmin layer and get information about exported and imported packages to get information about the OSGi services to shutdown the Karaf container itself to get information about the Web bundles (installed with the war feature) to manipulate the OBR layer (installed with the obr feature) Talend ESB Container Administration Guide 51 .apache. Monitoring and Administration using JMX Apache Karaf provides a large set of MBeans that allow you to fully monitor and administrate Karaf using any JMX client (for example.

32-bit and 64-bit versions • SGI Irix Talend ESB Container Administration Guide 52 . service dependencies.2.1. The Wrapper correctly handles "user log outs" under Windows. Introduction The Talend Runtime container is based on Apache Karaf. Karaf Wrapper (for service wrapper) makes it possible to install the Talend Runtime container as a Windows Service.Chapter 16. Likewise. the scripts shipped with Karaf also make it very easy to install the Talend Runtime container as a daemon process on Unix systems. and the ability to run services which interact with the desktop. 16. Installing the Talend Runtime container as a service 16. Supported platforms The following platforms are supported by the Wrapper: • AIX • FreeBSD • HP-UX.

Ubuntu.x.x. you can install Talend Runtime container as a service. 2003. Installation The Wrapper is an optional feature.6. Currently supported on both 32-bit and 64-bit sparc. and x86 systems. For instance. and Red Hat. Solaris 9 and 10. to register Talend Runtime container as a service (depending on the running OS). --name The service name that will be used when installing the service. 2. wrapper feature will provide wrapper:install new command in the trun: trun@root> wrapper:install --help DESCRIPTION wrapper:install Install the container as a system service in the OS. Known to work with Debian. (Default: Karaf) (defaults to karaf) -D. Currently supported on both 32-bit and 64bit x86 and Itanium systems. simply type: trun@root> features:install wrapper Once installed. AUTO_START or DEMAND_START (Default: AUTO_START) (defaults to AUTO_START) -n.x.Windows 2000. --description The description of the service. --display The display name of the service. • Windows . • Macintosh OS X • Sun OS.2. the Wrapper can be run only in console mode. but should work with any distribution. SYNTAX wrapper:install [options] OPTIONS -d. in automatic start mode. and PPC systems. --start-type Mode in which the service is installed. Itanium. --help Display this help message -s. Also known to run on Windows 98 and ME. (defaults to ) Using wrapper:install. 2. XP. Currently supported on both 32-bit and 64-bit x86. Installing the Talend Runtime container as a service • Linux kernels 2. however due the lack of support for services in the OS. Vista. To install it.3. simply type: trun@root> wrapper:install -s AUTO_START -n TALEND-ESB-CONTAINER -d Talend-ESB-Container -D "Talend ESB Container Service" Talend ESB Container Administration Guide 53 . 16.4.Chapter 16. 2008 and Windows 7.

jar Creating file: C:\work\5.0.0.4.bat Creating file: C:\work\5.1-release/Talend-ESB-V5.1-release/Talend-ESB-V5.Chapter 16.0.0.1-release\Talend-ESB-V5.1-release\Talend-ESB-V5.jar Setup complete. trun@root> wrapper:install -s AUTO_START -n TALEND-ESB-CONTAINER \ -d Talend-ESB-Container -D "Talend ESB Container Service" Creating file: /home/onofreje/5.1/container/ lib/libwrapper. To install the service.1-release\Talend-ESB-V5.1-release\Talend-ESB-V5. Installing the Talend Runtime container as a service Here is an example of wrapper:install command executing on Windows: karaf@trun> wrapper:install -s AUTO_START -n TALEND-ESB-CONTAINER -d Talend-ESB-Container -D "Talend ESB Container Service" Creating file: C:\work\5.1/container/ bin/KARAF-wrapper Creating file: /home/onofreje/5.0.0.dll Creating file: C:\work\5.0.1\container\bin\ TALEND-ESB-CONTAINER-service.1\container\lib\ karaf-wrapper-main.0.0.1\container\etc\ TALEND-ESB-CONTAINER-wrapper.0.conf before installing and starting the service. You may wish to tweak the JVM properties in the wrapper configuration file: C:\work\5.1/container/ bin/KARAF-service Creating file: /home/onofreje/5.1-release\Talend-ESB-V5.0.jar Creating file: /home/onofreje/5. run: C:> C:\work\5.1\container\bin\ TALEND-ESB-CONTAINER-wrapper.1-release/Talend-ESB-V5.0.1\container\bin\ TALEND-ESB-CONTAINER-service.0.so Creating file: /home/onofreje/5. to start the service run: C:> net start "TALEND-ESB-CONTAINER" Once running.1-release/Talend-ESB-V5.0.1\container\lib\ wrapper.conf Creating file: /home/onofreje/5.exe Creating file: C:\work\5.0.0.0.0.0.0.0.0.conf Creating file: C:\work\5.0. Installation on Linux The same wrapper:install command may be executed on Linux.0. to stop the service run: C:> net stop "TALEND-ESB-CONTAINER" Once stopped.1-release\Talend-ESB-V5.1-release/Talend-ESB-V5. to remove the installed the service run: C:> C:\work\5.0.1/container/ etc/KARAF-wrapper.1\container\lib\ karaf-wrapper.0.1-release\Talend-ESB-V5.1\container\etc\TALENDESB-CONTAINER-wrapper.1-release\Talend-ESB-V5.1/container/ lib/karaf-wrapper.0.0.0.bat install Once installed.1-release/Talend-ESB-V5.1\container\bin\ TALEND-ESB-CONTAINER-service.bat remove 16.1/container/ Talend ESB Container Administration Guide 54 .0.1-release\Talend-ESB-V5.

On Redhat/Fedora/CentOS Systems To install the service: $ ln -s /home/onofreje/5. the way the service is installed depends upon your flavor of Linux: 16.conf before installing and starting the service.3/etc/KARAF-wrapper. You may want to tweak the JVM properties in the wrapper configuration file: /home/onofreje/apache-karaf-2.0. On Ubuntu/Debian Systems To install the service: $ ln -s /home/onofreje/5.2.jar Setup complete.1-release/Talend-ESB-V5.1-release/Talend-ESB-V5. Installing the Talend Runtime container as a service lib/karaf-wrapper-main.d/TALEND-ESB-CONTAINER-service 16.0.Chapter 16.1/container/bin/TALEND-ESB-CONTAINERservice /etc/init.d -f TALEND-ESB-CONTAINER-service remove To start the service: Talend ESB Container Administration Guide 55 .d TALEND-ESB-CONTAINER-service defaults To disable starting the service when the machine is rebooted: $ update-rc.d/ $ chkconfig TALEND-ESB-CONTAINER-service --add To start the service when the machine is rebooted: $ chkconfig TALEND-ESB-CONTAINER-service on To disable starting the service when the machine is rebooted: $ chkconfig TALEND-ESB-CONTAINER-service off To start the service: $ service TALEND-ESB-CONTAINER-service start To stop the service: $ service TALEND-ESB-CONTAINER-service stop To uninstall the service : $ chkconfig TALEND-ESB-CONTAINER-service --del $ rm /etc/init.4.0.1. Subsequently.1.4.d/ To start the service when the machine is rebooted: $ update-rc.1/container/bin/ TALEND-ESB-CONTAINER-service /etc/init.0.

d/TALEND-ESB-CONTAINER-service stop To uninstall the service : $ rm /etc/init. Installing the Talend Runtime container as a service $ /etc/init.Chapter 16.d/TALEND-ESB-CONTAINER-service start To stop the service: $ /etc/init.d/TALEND-ESB-CONTAINER-service Talend ESB Container Administration Guide 56 .

Determines the maximum size of permanent generation. Using Talend ESB many classes are loaded. Increase if a "PermGen space" exception is thrown. Higher values may reduce garbage collection. specially when using security features and deploying multiple services to the same container. JAVA_MAX_MEM. Java classes are loaded in permanent generation. Determines the start size of permanent generation. Increase if a "PermGen space" exception is thrown. Memory Allocation Parameters The Talend ESB start scripts define the JVM memory allocation parameters used for running Talend ESB. JAVA_MIN_MEM. This is a separate heap space that is normally not garbage collected. Corresponds to the JVM parameter -Xms. Determines the maximum size of the Java heap memory.Chapter 17. Talend ESB Container Administration Guide 57 . Higher values may reduce garbage collection and improve performance. This is a separate heap space that is normally not garbage collected. Corresponds to the JVM parameter Xmx. Corresponds to the JVM parameter -XX:MaxPermSize Additionally the following parameters are used as default to enable class unloading from permanent generation which reduces the overall permanent generation space usage: -XX:+CMSClassUnloadingEnabled and -XX: +UseConcMarkSweepGC. Troubleshooting Talend ESB This chapter describes how to fix problems related to JVM memory allocation.1. Corresponds to the JVM parameter -XX:PermSize JAVA_MAX_PERM_MEM. 17. JAVA_PERM_MEM. improve performance and avoid "Out of memory" exceptions. Determines the start size of the Java heap memory.

3.Chapter 17. Determined by the script variable $JAVA_SIXTY_FOUR you can set different values depending whether your JVM is 64-bit. Talend ESB Container Administration Guide 58 . 64-bit-JVMs need significantly more memory. Determined by the script variable %Bit_64% you can set different values depending whether your JVM is 64-bit. Troubleshooting Talend ESB 17. 17. On Linux Adapt the memory allocation parameters in the karaf start script at the following location: [karaf_install_dir]/bin/trun. 64-bit-JVMs need significantly more memory.bat.2. On Windows Adapt the memory allocation parameters in the karaf start script at the following location: [karaf_install_dir]/bin/trun.

Sign up to vote on this title
UsefulNot useful