2.7.1 create-relation
The create-relation subcommand creates a relation between servers.
Synopsis
asadmin [asadmin_options] create-relation --relationtype relation_type_name --from server_name --to server_name [--order order] [--properties name=value[:name=value]...] relation_name
Storage location
Application Server installation directory/javaee/glassfish/bin
Function
The create-relation subcommand creates a relation between servers. You can create a relation by specifying the names of the relation source server and destination server, which correspond to the relation type. This command creates the relation information as relation information of the server specified in the --from option.
This subcommand is supported only in the remote mode.
Execution permission
General user
Precondition
Various servers have been setup.
Arguments
- --relationtype relation_type_name
-
Specifies the type of the relation to be made between the relation source server and relation destination server.
Type: String
You can specify the following values:
-
prf-relation
PRF server relation
-
redirect
Redirect relation
Default value: (None. You must specify a value.)
-
- --from server_name
-
Specifies the name of the server that will become the relation source. Specify a server of the server type that is set for the dependent source server of the relation type.
Type: String
You can specify the following values:
-
If --relationtype is prf-relation, specify a following value:
Name of a Java EE server existing in the domain.
Name of a web server existing in domain.
-
If --relationtype is redirect, specify the
Name of a web server existing in the domain.
Default value: (None. You must specify a value.)
-
- --to server_name
-
Specifies the name of the server that will become the relation destination. Specify a server of the server type that is set for the depended-on destination server, of the relation type.
Type: String
You can specify the following values:
-
If --relationtype is prf-relation, specify the
Name of a PRF server existing in the domain.
-
If --relationtype is redirect, specify the
Name of a Java EE server existing in the domain.
Default value: (None. You must specify a value.)
-
- --order order
-
Specifies the sequence number of the relation when multiple dependency relations of the same relation type are created for the same relation source server.
Type: Integer
You can specify the following values:
-
Integer: 0 to 65535
Default value: 0
-
- --properties name=value[:name=value]...
-
name
Specifies the property names and values in pairs, in the properties that apply to the relation information between servers. The syntax is name=value. You can specify multiple values separated by a colon (:). If the same property name is specified multiple times, then the property name that is specified later is used.
Type: String
You can specify the following values:
-
PRF standard property or extension property that begins with ex_.
value
You can specify the following values:
-
A value in the range of properties defined for the name option.
Default value:
If redirect is specified for --relationtype, the default value is: hitachi-relation-types.hitachi-relation-type.redirect.property.value_of_the_standard_property_key.
If prf-relation is specified for --relationtype: (None)
-
- relation_name
-
Specifies the name of the relation between the related servers.
Type: String
You can specify the following values:
-
ASCII characters
-
The name can contain the following characters:
Lowercase letters: a to z
Uppercase letters: A to Z
Numbers: 0 to 9
Hyphens: -
Underscores: _
-
The first character can either be an uppercase or a lowercase letter.
-
The following names that exist in the domain cannot be specified:
Node name
Java EE server name
Web server name
PRF server name
Cluster name
Name of a relation between servers
Name of the configuration of the Java EE server
-
The following names that are listed cannot be specified because they are either used by the system or are reserved words:
domain
server
default
server-config
default-config
default-webserver-config
default-prf-config
javaee
webserver
prf
cluster
redirect
prf-relation
Name that begins with HJES_
prebuilt_web_server_name -config
prebuilt_PRF_name -config
Default value: (None. You must specify a value.)
-
Examples
The following example creates a PRF related server (the relation type is prf-relation and the relation name is redirect1) between the Java EE server JavaEE1 and the PRF server PRF1 :
asadmin create-relation --relationtype prf-relation --from JavaEE1 --to PRF1 redirect1
The following example creates a redirect relation server (the relation type is redirect and the relation name is redirect3) between the web server Web1 and the Java EE server JavaEE1 :
asadmin create-relation --relationtype redirect --from Web1 --to JavaEE1 --properties path=/aaa/:network-listener=http-listener-1 redirect3
The following example creates a relation redirect server by specifying the order number:
asadmin create-relation --relationtype redirect --from Web1 --to JavaEE1 --order 20 --properties path=/aaa/:network-listener=http-listener-1 redirect3
asadmin create-relation --relationtype redirect --from Web1 --to JavaEE2 --order 10 --properties path=/:network-listener=http-listener-1 redirect4
Exit Status
Exit Status |
Explanation |
---|---|
0 |
Normal termination. |
1 |
Abnormal termination. |