[LIVY-697] Rsc client cannot resolve the hostname of driver in yarn-cluster mode #246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
[LIVY-697] Rsc client cannot resolve the hostname of driver in yarn-cluster mode
The content of Driver in /etc/hosts are as follows:
127.0.0.1 localhost
10.10.10.10 test_hostname
The content of Driver in /etc/hostname are as follows:
test_hostname
The findLocalAddress method in livy cannot return 10.10.10.10, but return test_hostname.
Because the test_hostname point to 10.10.10.10, which doesn't pass the check
address.isLoopbackAddress(), so findLocalAddress return test_hostname .
The rsc client cannot resolve the test_hostname, which cause rsc client cannot connect to
driver.
The findLocalAddress method in livy can return 10.10.10.10 as expected if the content
of Driver in /etc/hosts are as follows, which is not correct in our environment.
127.0.0.1 localhost
127.0.0.1 test_hostname
Though I can modify the findLocalAddress method to return 10.10.10.10, but it maybe cause
error if the machine has multiple network cards. So, rsc client gets the driver ip from the
connection.
How was this patch tested?
The content of Driver in /etc/hosts are as follows:
127.0.0.1 localhost
127.0.0.1 test_hostname
The content of Driver in /etc/hostname are as follows:
test_hostname
rsc client can get the driver ip in connection, and connect to driver successfully.