Home > Documentation > Reference > Tools and commands > deploy |
The deploy script is used for installing, uninstalling, reinstalling, starting and stopping applications and modules
This command has the following syntax:
where <general_options> specify common options that apply to all commands and control how the application behaves, <command> is a command name that specifies the action to be performed, and <command_options> are options unique to the command specified.
The deploy command can also be started by using the java -jar command:
This section lists all the available general options for the Geronimo deployer tool.
Starting with Geronimo 2.1.2, the deployer tool can use a secure channel (SSL/TLS) to communicate with the JMX server to perform the given actions. To enable secure communication just add the --secure option. Depending on your configuration you might also need to specify some Java security properties to configure the JVM to use the right keystores and passwords. For example, on a default Geronimo installation you might need to set the following (all in one line):
Once that property is set, you can execute the following command (just as an example):
The secure JMX server might not be running by default. Please see Configuring secure JMX server for more information.
The available sub-commands for the Geronimo deployer tool are listed below:
Additionally, you can type help for further details on a given command, the syntax is as follows:
Use the deploy command to add and start a new module. The deploy command has the following syntax:
The <module> specifies the application file name and location. The <deployment_plan> specifies the file name and location of the XML with the deployment plan. Sometimes the application module already has included in the package a deployment plan or the application is so simple that does not require any deployment plan, in these cases this parameter can be omited.
A module file can be one of the following:
If the server is not currently running at the time of deploying the application, the module will be marked to start next time the server is started.
The most common <general_options> would be --user and --password. The --inPlace option allows you point to and deploy an application directly from a directory external to Geornimo without the need for even packaging the application. In other words, you can have an application running in Geronimo but that application may be anywhere else on the file system.
Please note that the --inPlace option cannot be used when deploying an application to a remote server.
To use this option you should type:
Where <APP_HOME> indicates the home directory where you have your application (exploded).
You can also deploy applications if Geronimo is not running by using the --offline option, the syntax for this command would be:
Off course, you can also combine --offline and --inPlace
Use the login command to save the username and password for the current connection to the file .geronimo-deployer
in the current user's home directory. Future connections to the same server will try to use this saved authentication information instead of prompting where possible.
This information will be saved separately per connection URL, so you can specify --url or --host and/or --port on the command line to save a login to a different server.
The login command has the following syntax:
So, next time you run a different command that originally required user name and password, you can run the command directly, for example:
Similarly, you don't have to specify or re-enter the user name and password when you shut down the server using the shutdown command.
Even when the login information is not saved in clear text, it is not secure either. If you want to save the authentication securely, you should change the .geronimo-deployer file in your home directory so that nobody else can read or write it.
Use the redeploy command to stop, replace and restart a module that has been deployed before. The redeploy command has the following syntax:
Just like the deploy command, the redeploy command accepts the following modules file types:
Typically, both a module and a plan are specified. If the module contains a plan or if a default plan can be used, the plan can be omitted. However, if a plan is specified in this case, it overrides the other plans. If the plan references a server component already deployed in the server's environment, the module is omitted. you can use --targets option only for clustering redeployment. For clustering redeployment you can find the target with list-targets command. Copy the one with the name as MasterConfigurationStore and use it as a target variable.
Use the start command to start a previously deployed module. The start command has the following syntax:
Where <moduleIDs> is a list of one or more modules (configID) separated by blank space. The module identification (or ConfigID) is defined at deployment time in the respective deployment plan for each module previously deployed.
Use the stop command to stop a running module. The stop command has the following syntax:
Where <moduleIDs> is a list of one or more modules (configID) separated by blank space. The module identification (or ConfigID) is defined at deployment time in the respective deployment plan for each module previously deployed.
Use the undeploy command to stop and remove a module (running or not) and its deployment information from the server. The undeploy command has the following syntax:
Where <moduleIDs> is a list of one or more modules (configID) separated by blank space. The module identification (or ConfigID) is defined at deployment time in the respective deployment plan for each module previously deployed.
This command has the same ability as with deploy to uninstall applications when the server is not running, this command has the following syntax:
Use the distribute command to add a new module to the server. This command does not start the module nor mark it to be started in the future. The distribute command has the following syntax:
Just like with the deploy command, <module> specifies the application file name and location. The <deployment_plan> specifies the file name and location of the XML with the deployment plan. Sometimes the application module already has included in the package a deployment plan or the application is so simple that does not require any deployment plan, in these cases this parameter can be omitted.
A module file can be one of the following:
Use the encrypt command to generate an encrypted string. This command takes use of org.apache.geronimo.util.EncryptionManager and has the following syntax:
<geronimo_home>/bin/deploy <general_options> encrypt <string>
Where <general_options> are common options that apply to all commands, <string> specifies a string to get encrypted.
Currently password strings are plain text in deployment plans, such as datasource or JMS deployment plans within an EAR. It might pose a security problem to store password strings as plain text even though the deployment plans are only used during the deployment process, and not at runtime. Starting from Geronimo 2.1.5, users can encrypt passwords using the encrypt command and paste the encrypted strings into deployment plans as password.
Examples:
Use this syntax to encrypt string passw0rd
on an active server so that the encryption settings of that server will be used
Online encryption result:
Use this syntax to encrypt string passw0rd offline
Offline encryption result:
Note: Online encryption needs a running server to connect to and will use the encryption settings of that server, such as an encryption key, to do the encryption. As a result, the encrypted password usually can only be used for that particular server. Offline encryption uses the default encryption settings, and the encrypted password can be used by all servers. Offline encryption is thus less secure than online encryption.
Use the install-library command to install a library into server's repository. The install-library command has the following syntax:
Use the --groupId option to specify a non-default group id for the library. Otherwise, the library file will be installed with the group id named default.
Examples:
That command will install the mylib-1.0.jar at <geronimo_home>/repository/default/mylib/1.0/mylib-1.0.jar
That command will install the mylib-1.0.jar at <geronimo_home>/repository/mygroup/mylib/1.0/mylib-1.0.jar
Use the list-modules command to list all available modules on the server, note that for running this command the server must be running. The list-modules command has the following syntax:
Use the list-targets command to lists the targets known to the server you have connected to. The list-targets command has the following syntax:
In the case of Geronimo, each configuration store is a separate target. Geronimo does not yet support clusters as targets.
Use the unlockKeystore command to unlock a keystore and private keys. The unlockKeystore command has the following syntax:
<geronimo_home>/bin/deploy <general_options> unlockKeystore <keyStoreName> <keyAlias1> <keyAlias2>
Where <keyStoreName> specifies a locked keystore to get unlocked, <keyAlias1> and <keyAlias2> are optionally used to specify one or more locked private keys in the keystore to get unlocked.
Note that before you can use the unlockKeystore command, you need to ensure that the following lines are added to <geronimo_home>/var/config/config-substitutions.properties:
Where
Examples:
Use this syntax to unlock the keystore whose name is mykeystore
Use this syntax to unlock the keystore whose name is mykeystore and the private key whose alias is key1
Use the install-plugin command to install a Geronimo plugin previously exported from a Geronimo server or downloaded from a repository. A Geronimo plugin can be an application, a configuration such data sources and drivers or a combination. The install-plugin command has the following syntax:
Use the search-plugins command to list all the Geronimo plugins available in a Maven repository. The search-plugins command has the following syntax:
Bookmark this on Delicious Digg this | Privacy Policy - Copyright © 2003-2011, The Apache Software Foundation, Licensed under ASL 2.0. |