Hitachi

Hitachi Application Server V10 Command Reference Guide (For Windows® Systems)


2.4.3 create-domain

Creates Java EE Server domain.

Synopsis

asadmin [asadmin-options] create-domain [--help]
    [--adminport adminport] [--instanceport instanceport]
    [--portbase portbase] [--template template-name]
    [--domaindir domaindir] [--savemasterpassword={false|true}]
    [--usemasterpassword={false|true}]
    [--domainproperties name=value[:name=value]...]
    [--keytooloptions name=value[:name=value]...]
    [--savelogin={false|true}] [--checkports={true|false}]
    [--nopassword={false|true}] domain-name

Storage location

Application Server installation directory/javaee/glassfish/bin

Function

The create-domain subcommand creates Java EE Server domain. A domain in Java EE Server is an administrative namespace that complies with the Java Platform, Enterprise Edition (Java EE) standard.

Every domain has a configuration, which is stored in a set of files. Any number of domains, each of which has a distinct administrative identity, can be created in a given installation of Application Server. A domain can exist independently of other domains. Any user who has access to the asadmin utility on a given system can create a domain and store its configuration in a folder of the user's choice. By default, the domain configuration is created in the default directory for domains. You can override this location to store the configuration elsewhere.

This command creates a domain with a single administrative user specified by the asadmin utility option --user.

You choose an appropriate profile for the domain, depending on the applications that you want to run on your new domain. You can choose the developer, cluster, or enterprise profile for the domain you create.

This command is supported in local mode only.

Arguments

--help | -?

Displays the help text for the subcommand.

--adminport adminport

Specifies the HTTP port or the HTTPS port for administration. This port is the port number in the URL that you specify in your web browser to manage the domain, for example, http://localhost:4949. The --adminport option cannot be used with the --portbase option. The default value is 4848.

The --adminport option overrides the domain.adminPort property of the --domainproperties option.

Type: Integer

The following values can be specified:

  • 1 to 65535

Default value: 4848

--instanceport instanceport

Specifies the domain that provides services so that applications can run when deployed. This HTTP port specifies where the web application context roots are available for a web browser to connect to it. This port is a positive integer and must be available while creating the domain. The --instanceport option cannot be used with the --portbase option. The default value is 8080. The --instanceport option overrides the domain.instancePort property of the --domainproperties option.

Type: Integer

The following values can be specified:

  • 1 to 65535

Default value: 8080

--portbase portbase

Determines the number with which port assignments should start. A domain uses a certain number of ports that are statically assigned. The portbase value determines where the assignment should start. The values for the ports are calculated as follows:

  • Administration port: portbase + 48

  • HTTP listener port: portbase + 80

  • HTTPS listener port: portbase + 81

  • JMS port: portbase + 76

  • IIOP listener port: portbase + 37

  • Secure IIOP listener port: portbase + 38

  • Secure IIOP with mutual authentication port: portbase + 39

  • JMX port: portbase + 86

  • JPDA debugger port: portbase + 9

  • Felix shell service port for OSGi module management: portbase + 66

When the --portbase option is specified, the output of this subcommand includes a complete list of used ports.

The --portbase option cannot be used with the --adminport, --instanceport, or the --domainproperties option.

Type: Integer

The following values can be specified:

  • -8 to 65449

Default value: N/A

--template template-name

Specifies the file name, including a relative or absolute path, of a domain configuration template to use for creating the domain.

If a relative path is specified, the subcommand appends the path to the Application Server installation directory/javaee/glassfish/lib/templates directory to locate the file. If it is an absolute pathname, the subcommand locates the file in the specified path. This option enables you to create different types of domains and define custom domain templates. The jar file is the input file for this option which contains the domain configuration file.

Type: String

The following values can be specified:

  • Specify file name of domain configuration

Default value: N/A

--domaindir domaindir

Specifies the directory where the domain is to be created. If specified, the path must be accessible in the file system. If not specified, the domain is created in the default domain directory, Application Server installation directory/javaee/glassfish/domains.

Type: String

The following values can be specified:

  • Domain directory path

Default value: Application Server installation directory/javaee/glassfish/domains

--savemasterpassword={false|true}

Setting this option to true allows the master password to be written to the file system. The default value is false.

A master password is a password for the secure key store. A domain is designed to keep its own certificate (created while creating a domain) in a safe place in the configuration location. This certificate is called the domain's SSL server certificate. When the domain is contacted by a web browser over a secure channel (HTTPS), this certificate is presented by the domain. The master password protects the store (a file) that contains this certificate. This file is called keystore.jks and is created in the configuration directory of the created domain. If this option is chosen, then the master password is saved on the disk in the configuration location of the domain. The master password is stored in the master-password file, which is a Java JCEKS type keystore. The --savemasterpassword option is used during an unattended system restart. In this case, the master password is not prompted when the domain starts because the password is extracted from this file.

It is a best practice to create a master password when creating a domain, because the master password is used by the start-domain subcommand. For security purposes, the default setting should be set to false, because saving the master password on the disk is not secure, unless file system permissions are set properly. If the master password is saved, then the start-domain subcommand does not prompt for it. The master password gives an extra level of security to the environment.

If this option is set to true, then the --usemasterpassword option is also set to true, irrespective of the value that is specified on the command line.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--usemasterpassword={false|true}

Specifies whether the key store is encrypted with a master password that is built into the system or a user-defined master password. If the value is set to false (default), then the keystore is encrypted with a well-known password that is built into the system. Encrypting the keystore with a password that is built into the system does not provide additional security. If this value is set to true, then the subcommand obtains the master password from the AS_ADMIN_ MASTERPASSWORD entry in the password file or prompts for the master password. The password file is specified in the --passwordfile option of the asadmin utility command. If the --savemasterpassword option is set to true, then this option is also set to true, irrespective of the value that is specified in the command line.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--domainproperties name=value[:name=value]...

Specifies the optional name/value pairs that override the default values for the properties of the domain to be created. The list must be separated by a colon (:). The --portbase options cannot be used with the --domainproperties option.

The --portbase options cannot be used with the --domainproperties option.

Type: String

The following values can be specified:

  • domain.adminPort=value

    Specifies the port number of the HTTP port or the HTTPS port for administration. This port is the port in the URL that you specify in your web browser to manage the instance, for example, http://localhost:4949. Valid values are 1-65535.

    The domain.adminPort property is overridden by the --adminport option.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • domain.instancePort=value

    Specifies the port number of the port that is used to listen for HTTP requests. Valid values are 1-65535.

    The domain.instancePort property is overridden by --instanceport option.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • domain.jmxPort=value

    Specifies the port number on which the JMX connector listens. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • http.ssl.port=value

    Specifies the port number of the port that is used to listen for HTTPS requests. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • java.debugger.port=value

    Specifies the port number of the port that is used for connections to the Java Platform Debugger Architecture (JPDA) (http://java.sun.com/javase/technologies/core/toolsapis/jpda/) debugger. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • jms.port=value

    Specifies the port number for the Java Message Service provider. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • orb.listener.port=value

    Specifies the port number of the port that is used for IIOP connections. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • orb.mutualauth.port=value

    Specifies the port number of the port that is used for secure IIOP connections with client authentication. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • orb.ssl.port=value

    Specifies the port number of the port that is used for secure IIOP connections. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

  • osgi.shell.Telnet.port=value

    Specifies the port number of the port that is used for connections to the Apache Felix Remote Shell (http://felix.apache.org/site/apache-felix-remote-shell.html). This shell uses the Felix shell service to interact with the OSGi module management subsystem. Valid values are 1-65535.

    Type: Integer

    Default value: N/A

    Range Value: 1 to 65535

Default value: N/A

The --portbase options cannot be used with the --domainproperties option.

--keytooloptions name=value[:name=value]...

Specifies an optional list of name-value pairs of keytool options for a self-signed server certificate. The certificate is generated while creating the domain. Each pair in the list must be separated by a colon (:).

Type: String

The following values can be specified:

  • CN=value

    Specifies the common name of the host that is to be used for the self-signed certificate. This option name is case insensitive.

    Default value: Fully qualified name of the host where the create-domain subcommand is run.

    Range Value: N/A

    * CN property value is case insensitive.

Default value: N/A

--savelogin={false|true}

Saves the administration user name and password. The default value is false. The username and password are stored in the .asadminpass file of the user's home directory. A domain can only be created locally. Therefore, when using the --savelogin option, the host name saved in the .asadminpass property/entry is always localhost. If the user has specified default administration port while creating the domain, there is no need to specify --user, --passwordfile, --host, or --port in any of the subsequent asadmin remote commands. These values are obtained automatically.

When the same user creates multiple domains that have the same administration port number on the same or different host (where the home directory is NFS mounted), the subcommand does not ask if the password must be overwritten. The password is always overwritten.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

--checkports={true|false}

Specifies whether to check for the availability of the administration of the HTTP, JMS, JMX, and IIOP ports. The default value is true.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: true

--nopassword={false|true}

Specifies whether the administrative user will have a password. If the value is set to false (default value), the password is specified using the AS_ADMIN_PASSWORD entry in the asadmin password file (set using the --passwordfile option). If the value is set to false and the AS_ADMIN_PASSWORD is not set, you are prompted for the password. If the value is set to true, the administrative user is created without a password. If a user name for the domain is not specified by using the --user option, and the --nopassword option is set to true, the default user name, admin, is used.

Type: Boolean

The following values can be specified:

  • true

  • false

Default value: false

domain-name

Specifies the name of the domain to be created. The name can contain only ASCII characters and must be a valid directory name for the operating system on the host where the domain is created.

Type: String

The following values can be specified:

  • domain name

Default value: N/A

Examples

The following example creates a domain.

asadmin create-domain --adminport 4848 domain4

Exit Status

Exit Status

Explanation

0

command executed successfully.

1

error in executing the command.