modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
| 19 ++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
New commits:
commit a80c8cbcffcc7f80b5a551c41221c15f896f954e
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Thu Oct 3 16:26:05 2013 +0200
[BZ 1010265] - Installation fails if hostname is not on DNS - Handling also the case
when the UnknownHostException is thrown from the startNode() method (where the Cassandra
is actually started.)
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index abf57e3..ce3fc51 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -271,6 +271,17 @@ public class StorageInstaller {
return STATUS_JMX_PORT_CONFLICT;
}
+ if
(startupErrors.contains("java.net.UnknownHostException")) {
+ int from =
startupErrors.indexOf("java.net.UnknownHostException:")
+ + "java.net.UnknownHostException:".length();
+ String hostname = startupErrors.substring(from,
startupErrors.indexOf(':', from));
+ log.error("Failed to resolve requested binding address.
Please check the installation "
+ + "instructions and host DNS settings"
+ + (isWindows() ? "." : " also make sure the
hostname alias is set in /etc/hosts." )
+ + " Unknown host: " + hostname);
+ log.error("The storage installer will exit due to previous
errors");
+ return STATUS_UNKNOWN_HOST;
+ }
log.warn("Please review your configuration for possible sources
of errors such as port "
+ "conflicts or invalid arguments/options passed to the java
executable.");
}
@@ -441,7 +452,9 @@ public class StorageInstaller {
return installerInfo;
} catch (UnknownHostException unknownHostException) {
throw new StorageInstallerException(
- "Failed to resolve requested binding address. Please check the
installation instructions and host DNS settings. Unknown host "
+ "Failed to resolve requested binding address. Please check the
installation instructions and host DNS settings"
+ + (isWindows() ? "." : " also make sure the hostname alias
is set in /etc/hosts." )
+ + " Unknown host "
+ unknownHostException.getMessage(), unknownHostException,
STATUS_UNKNOWN_HOST);
} catch (IOException e) {
throw new StorageInstallerError("The upgrade cannot proceed. An
unexpected I/O error occurred", e,
@@ -558,7 +571,9 @@ public class StorageInstaller {
} catch (UnknownHostException unknownHostException) {
throw new StorageInstallerException(
- "Failed to resolve requested binding address. Please check the
installation instructions and host DNS settings. Unknown host "
+ "Failed to resolve requested binding address. Please check the
installation instructions and host DNS settings"
+ + (isWindows() ? "." : " also make sure the hostname alias
is set in /etc/hosts." )
+ + " Unknown host "
+ unknownHostException.getMessage(), unknownHostException,
STATUS_UNKNOWN_HOST);
} catch (IOException e) {
throw new StorageInstallerError("The upgrade cannot proceed. An
unexpected I/O error occurred", e,
Show replies by date