Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-4158 Allow create-domain command to configure the Hazelcast Configuration #4270

Merged
merged 4 commits into from Oct 23, 2019

Conversation

@MeroRai
Copy link
Contributor

MeroRai commented Oct 10, 2019

Description

This is a feature to allow create-domain command to configure the Hazelcast Configuration. This makes it possible to configure the Hazelcast Configuration before starting the domain.

Following new command options have been added to the create-domain command:

  • --hazelcastdasport The port to run Hazelcast on for the DAS. If this port is busy, the port specified will be incremented until a valid port is found. The --hazelcastdasport option cannot be used with the --portbase option. The default value is 4900. The --hazelcastdasport option overrides the hazelcast.das.port property of the --domainproperties option.

  • --hazelcaststartport The port the other Payara Server instances use to run Hazelcast on. If this port is busy, the port specified will be incremented until a valid port is found. The --hazelcaststartport option cannot be used with the --portbase option. The default value is 5900. The --hazelcaststartport option overrides the hazelcast.start.port property of the --domainproperties option.

  • --hazelcastautoincrement By default the cluster uses the next unoccupied port that is available starting with the start port. When auto-increment is turned off an occupied start port results in a startup failure instead. The --hazelcastautoincrement option overrides the hazelcast.auto.increment property of the --domainproperties option.

Following domain properties have been added to the create-domain command:

  • hazelcast.das.port This property specifies the port number of the port that is used to run. Hazelcast on for the DAS. If this port is busy, the port specified will be incremented until a valid port is found. Valid values are 1-65535. On UNIX, creating sockets that listen on ports 1-1024 requires superuser privileges. The hazelcast.das.port property is overridden by the --hazelcastdasport option.

  • hazelcast.start.port This property specifies the port number of the port the other Payara Server instances use to run Hazelcast on. If this port is busy, the port specified will be incremented until a valid port is found. Valid values are 1-65535. On UNIX, creating sockets that listen on ports 1-1024 requires superuser privileges. The hazelcast.start.port property is overridden by the --hazelcaststartport option.

  • hazelcast.auto.increment This property specifies whether or not to use the next unoccupied port that is available starting with the start port. When auto-increment is turned off an occupied start port results in a startup failure instead. The hazelcast.auto.increment property is overridden by the --hazelcastautoincrement option.

It also shifts the Hazelcast DAS and the Start port according to the value of --portbase command option, similar to the other port values.

Testing

New tests

None

Testing Performed

  • Running the create-domain command to test the functionality of the newly implemented command options. E.g. running asadmin create-domain --hazelcastdasport 7900 --hazelcaststartport 8900 --hazelcastautoincrement true testDomain command. Gave following output:
Using default port 4848 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Using default port 9009 for JAVA_DEBUGGER.
Using port 7900 for Hazelcast DAS.
Using port 8900 for Hazelcast Start.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=dev,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=dev-instance,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
Domain testDomain created.
Domain testDomain admin port is 4848.
Domain testDomain allows admin login as user "admin" with no password.
Command create-domain executed successfully.
  • Or running create-domain --domainproperties hazelcast.das.port=7900:hazelcast.auto.increment=false:hazelcast.start.port=8900 testDomain command. Gave following output:
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Using default port 9009 for JAVA_DEBUGGER.
Using port 7900 for Hazelcast DAS.
Using port 8900 for Hazelcast Start.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=dev,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=dev-instance,OU=Payara,O=Payara Foundation,L=Great Malvern,ST=Worcestershire,C=UK]
Domain testDomain created.
Domain testDomain admin port is 4848.
Domain testDomain allows admin login as user "admin" with no password.
Command create-domain executed successfully.
  • Local Build Test

Testing Environment

Zulu JDK 1.8_222 on Elementary OS 0.4.1 Loki with Maven 3.5.4

Documentation

TODO

@MeroRai MeroRai self-assigned this Oct 10, 2019
@MeroRai

This comment has been minimized.

Copy link
Contributor Author

MeroRai commented Oct 15, 2019

jenkins test please

Copy link
Contributor

cubastanley left a comment

Briefly tested and unsure if this is correct functionality expectations that I have. Nevertheless, creating a new domain with a custom das port and start port where the port value is already in use by a running instance causes the command to fail; auto increment doesn't work as I'd expect based on the given description.
./asadmin create-domain --portbase 2000 test-domain
./asadmin start-domain test-domain
./asadmin create-domain --hazelcastdasport 2049 --hazelcaststartport 2059 --hazelcastautoincrement true test-domain-one -> You do not have permission to use port 2059 for test-domain-one. Try a different port number or login to a more privileged account. CLI130: Could not create domain, test-domain-one Command create-domain failed.
Left as a comment rather than requested change as this may be standard functionality and a misinterpretation on my part

* Hazelcast DAS port: portbase + 0

* Hazelcast Start port: portbase + 0
Comment on lines 113 to 115

This comment has been minimized.

Copy link
@jGauravGupta

jGauravGupta Oct 23, 2019

Contributor

Suffix typo here, It should be 49 & 59.

@MeroRai

This comment has been minimized.

Copy link
Contributor Author

MeroRai commented Oct 23, 2019

jenkins test please

@MeroRai MeroRai merged commit 60f0387 into payara:master Oct 23, 2019
57 of 58 checks passed
57 of 58 checks passed
security/snyk - appserver/ant-tasks/pom.xml (payara-ci) 10 new vulnerabilities
Details
Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/admingui/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/concurrent/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/core/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ejb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/extras/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ha/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jdbc/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/load-balancer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/orb/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/payara-appserver-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/persistence/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/registration/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/security/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/transaction/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/webservices/pom.xml (payara-ci) No new issues
Details
security/snyk - copyright/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/admin/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/common/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/core/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/diagnostics/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/payara-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/security/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/test-utils/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - pom.xml (payara-ci) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.