Glassfish命令之create-domain

命令

create-domain

语法

create-domain [--help] 
[--adminport adminport]
[--instanceport instanceport] 
[--portbase portbase] 
[--profile profile-name] 
[--template template-name] 
[--domaindir domaindir] 
[--savemasterpassword={false|true}] 
[--domainproperties (name=value)[:name=value]*] 
[--keytooloptions (name=value)[:name=value]*] 
[--savelogin={false|true}] 
[--checkports={true|false}] 
[--nopassword={false|true}] 
domain_name

描述

GlassFish Server中的域是符合Java EE标准的管理命名空间。 每个域都有一个配置,存储在一组文件中。 可以在给定的GlassFish Server安装中创建任意数量的域,每个域都具有不同的管理标识。 域可以独立于其他域而存在。

任何有权访问给定系统上的asadmin实用程序的用户,都可以创建域并将其配置存储在所选的文件夹中。 默认情况下,域配置是在域的默认目录中创建的。 您可以覆盖此位置以将配置存储在其他位置。

如果在运行create-domain子命令时,在domain.xml文件中找到域自定义程序,则会处理自定义程序。

create-domain子命令使用asadmin实用程序选项--user指定的单个管理用户创建域。 如果未指定--user选项,并且--nopassword选项设置为true,则使用默认管理用户admin。 如果--nopassword选项设置为false(默认值),则需要用户名。 在这种情况下,如果未使用--user选项指定用户名,系统将提示您这样做。

仅在本地模式下支持此子命令。

命令选项

--help 
-?
Displays the help text for the subcommand.

--adminport
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 domain, for example, http://localhost:4949. The --adminport option cannot be used with the --portbase option. The default value is 4848.

--instanceport
The domain 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. This port is a positive integer and must be available at the time of domain creation. The --instanceport option cannot be used with the --portbase option. The default value is 8080.

--portbase
Determines the number with which the port assignment should start. A domain uses a certain number of ports that are statically assigned. The portbase value determines where the assignment should start. Choose this value carefully. The values for the ports are calculated as follows: Admin port: portbase + 48, HTTP listener port: portbase + 80, IIOP listener port: portbase + 37, JMX port: portbase + 86. See the output of this subcommand for a complete list of occupied ports, when --portbase option is specified. The --portbase option cannot be used with the --adminport, --instanceport, or the --domainproperties option.

Note –
This subcommand uses some ports that are not required. This behavior is retained for compatibility with other releases.

--profile
Do not specify this option. This option is retained for compatibility with other releases. If you specify this option, a syntax error does not occur. Instead, the subcommand runs successfully and the option is silently ignored.

--template
Do not specify this option. This option is retained for compatibility with other releases. If you specify this option, a syntax error does not occur. Instead, the subcommand runs successfully and the option is silently ignored.

--domaindir
The directory where the domain is to be created. If specified, the path must be accessible in the filesystem. If not specified, the domain is created in the default domain directory, as-installglassfish/domains.

--savemasterpassword
Setting this option to true allows the masterpassword to be written to the file system. The default value is false.

A master password is really a password for the secure key store. A domain is designed to keep its own certificate (created at the time of domain creation) 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 is supposed to protect the store (a file) that contains this certificate. This file is called keystore.jks and is created in the configuration directory of the domain created. If however, this option is chosen, the master password is saved on the disk in the domain's configuration location. The master password is stored in a file called master-password, which is a Java JCEKS type keystore. The reason for using the --savemasterpassword option is for unattended system boots. In this case, the master password is not prompted for when the domain starts because the password will be extracted from this file.

It is best 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 false, because saving the master password on the disk is an insecure practice, unless file system permissions are properly set. If the master password is saved, then start-domain does not prompt for it. The master password gives an extra level of security to the environment.

--domainproperties
Setting the optional name/value pairs overrides the default values for the properties of the domain to be created. The list must be separated by the colon (:) character. The --portbase options cannot be used with the --domainproperties option. The following properties are available:

jms.port
Specifies the port number for JMS. Valid value is 7676.

domain.jmxPort
Specifies the port on which the JMX connector is initialized. The valid values are 1-65535.

orb.listener.port
Specifies the ORB listener port for IIOP connections on which orb-listener-1 listens.

http.ssl.port
Specifies the port number for http-listener-2. Valid values are 1 to 65535. On UNIX, to create sockets that listen on ports 1–1024, you need superuser privileges.

orb.ssl.port
Specifies the ORB listener port for IIOP connections on which the IIOP listener called SSL listens.

orb.mutualauth.port
Specifies the ORB listener port for IIOP connections on which the IIOP listener called SSL_MUTUALAUTH listens.

osgi.shell.telnet.port
Specifies the port for connecting to the Felix shell service that GlassFish Server provides to interact with the OSGi runtime. The default value is 6666.

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

Allowed options are as follows:

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

By default, the name is the fully-qualified name of the machine where the create-domain subcommand is run.

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

Note –
When the same user creates multiple domains having the same admin port number on the same or different machines (where the home directory is NFS mounted), the subcommand does not ask if the password should be overwritten. The password will always be overwritten.

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

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

If 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.

Operands
domain_name
The name of the domain to be created.

 

翻译自:

Oracle GlassFish Server 3.0.1 Reference Manual

https://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值