JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
March 24, 2023, 08:24:16 PM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: application config value "localhost" needed to be replaced with an IP  (Read 1378 times)

broiyan

  • JPPF Grand Master
  • ****
  • Posts: 54

Given the following edits to the application config file (as shown in diff output)
Quote
39c39
< driver1.jppf.server.port = 11111
---
> driver1.jppf.server.port = 11443
42c42
< driver1.jppf.ssl.enabled = false
---
> driver1.jppf.ssl.enabled = true
87c87
< #jppf.ssl.enabled = true
---
> jppf.ssl.enabled = true

And the following edits to the application config file in the SSL folder:

Quote
57c57
< jppf.ssl.keystore.file = config/ssl/keystore.ks
---
> jppf.ssl.keystore.file = config/ssl/server0KeyStore
85c85
< #jppf.ssl.truststore.file = config/ssl/truststore.ks
---
> jppf.ssl.truststore.file = config/ssl/server0TrustStore
89c89
< #jppf.ssl.truststore.password = password
---
> jppf.ssl.truststore.password = password

I get the following error:
Quote
2016-02-12 21:59:27,630 [INFO ][org.jppf.client.TaskServerConnectionHandler.init(78)]: [client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at server0:11443
2016-02-12 21:59:27,669 [WARN ][org.jppf.client.TaskServerConnectionHandler.init(97)]: error initializing connection to job server: org.jppf.ssl.SSLConfigurationException: java.lang.NullPointerException

This error is removed by editing the application config file to change the "driver1" host from "localhost" to the actual IP address. Since my application is running on the same physical (cloud) server as the driver (./startDriver.sh) I did not expect this. Perhaps this is a bug. Sometimes this warning message does not appear in the log file and the application seems stalled. Rebooting the server and re-running the driver and the application can cause the warning to be reproduced.
« Last Edit: February 13, 2016, 05:24:17 AM by broiyan »
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site
Re: application config value "localhost" needed to be replaced with an IP
« Reply #1 on: February 13, 2016, 05:52:48 AM »

Hello,

I do not understand what you mean by "my application is running on the same physical (cloud) server as the drive". Are they both in the same cloud service, but on separate virtual machines? If that's the case then each VM has its own IP address and 'localhost' on any of these VMs will only refer to the VM itself.

Otherwise, we need to investigate a litlle more to understand the issue. First, I'm seeing in your console output that the application is trying to connect to a host named 'server0'. This doesn't look like a local address, do you confirm? Also, can you check that host name resolution is properly configured for your cloud environment?

Lastly, it would be helpful to have the full stack trace for the SSLConfigurationException. For this, could you please add the following line in your application's config/log4j.properties file:
Code: [Select]
log4j.logger.org.jppf.ssl=DEBUG
Thanks,
-Laurent
Logged

broiyan

  • JPPF Grand Master
  • ****
  • Posts: 54
Re: application config value "localhost" needed to be replaced with an IP
« Reply #2 on: February 13, 2016, 09:08:55 AM »

EDIT: Since the problem was intermittent I cannot say with certainty that it has been solved but I made an edit to /etc/hosts and it may have made a difference. The edit was to put my server host name in /etc/hosts on the 127.0.1.1 line in lieu of the original. This is in contrast to using the actual IP and host name in a new (additional) line in the /etc/hosts file. According to askubuntu.com specifying the server host name on the same line as the 127.0.1.1 is the "correct" way to put the server host name into the /etc/hosts file, at least for ubuntu. After two invocations the [WARN] message has not occurred so perhaps it is solved. Thanks for your help.

Incidentally, the reason for setting HOSTNAME is that if I have multiple nodes, it is reassuring to see each report a different HOSTNAME in the log files or the consoles of the nodes. That's better than seeing all nodes identify themselves as "ubuntu" or something generic like that.
-----------------------------------------
I set the environment variable HOSTNAME and also /etc/hosts. I don't remember why. Perhaps I found it necessary some time in the past. If you do not advise this, I can remove it. The token server0 is defined through the /etc/hosts file.

The driver and the application are on the same VM, so localhost should work in the jppf.properties file.

Quote
root@server0:~/serverDeployment/driver# cat /etc/hosts
45.33.67.17 server0
127.0.0.1   localhost
127.0.1.1   ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
root@server0:~/serverDeployment/driver# hostname
server0
root@server0:~/serverDeployment/driver# echo $HOSTNAME
server0

The problem is reproducible but not every time. I will post the application log as soon as I reproduce the same [WARN] message.

EDIT: I rebooted and ran it again. This contains the [WARN] message again. Also included is the debugging info you wanted to have enabled.

Quote
2016-02-13 03:14:55,242 [INFO ][org.jppf.utils.ManagementUtils.<clinit>(153)]: management successfully initialized
2016-02-13 03:14:55,307 [INFO ][org.jppf.utils.VersionUtils.logVersionInformation(80)]: --------------------------------------------------------------------------------
2016-02-13 03:14:55,307 [INFO ][org.jppf.utils.VersionUtils.logVersionInformation(81)]: JPPF Version: 5.1.2, Build number: 1758, Build date: 2016-02-05 06:24 CET
2016-02-13 03:14:55,307 [INFO ][org.jppf.utils.VersionUtils.logVersionInformation(82)]: starting client with PID=3868, UUID=4304EF6C-9352-53D7-2992-44928AA5795D
2016-02-13 03:14:55,309 [INFO ][org.jppf.utils.VersionUtils.logVersionInformation(83)]: --------------------------------------------------------------------------------
2016-02-13 03:14:56,607 [INFO ][org.jppf.client.AbstractGenericClient.newConnection(281)]: connection [jppf_discovery-1-1] created
2016-02-13 03:14:56,659 [INFO ][org.jppf.client.ClassServerDelegateImpl.init(76)]: [client: jppf_discovery-1-1 - ClassServer] Attempting connection to the class server at server0:11443
2016-02-13 03:14:56,692 [INFO ][org.jppf.client.ClassServerDelegateImpl.init(84)]: [client: jppf_discovery-1-1 - ClassServer] Reconnected to the class server
2016-02-13 03:14:56,707 [INFO ][org.jppf.client.TaskServerConnectionHandler.init(78)]: [client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at server0:11443
2016-02-13 03:14:56,726 [DEBUG][org.jppf.ssl.SSLHelper.loadSSLProperties(282)]: successfully loaded the SSL configuration from 'config/ssl/ssl.properties'
2016-02-13 03:14:56,738 [WARN ][org.jppf.client.TaskServerConnectionHandler.init(97)]: error initializing connection to job server: org.jppf.ssl.SSLConfigurationException: java.lang.NullPointerException
2016-02-13 03:14:56,745 [INFO ][org.jppf.client.TaskServerConnectionHandler.init(78)]: [client: jppf_discovery-1-1 - TasksServer] Attempting connection to the task server at server0:11443
2016-02-13 03:14:57,786 [DEBUG][org.jppf.ssl.SSLHelper.getSSLParameters(140)]: SSL parameters : cipher suites=[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDH_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_SHA,TLS_ECDH_ECDSA_WITH_RC4_128_SHA,TLS_ECDH_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,TLS_EMPTY_RENEGOTIATION_INFO_SCSV], protocols=[TLSv1], needCLientAuth=false, wantClientAuth=false
« Last Edit: February 21, 2016, 11:49:23 PM by broiyan »
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site
Re: application config value "localhost" needed to be replaced with an IP
« Reply #3 on: February 14, 2016, 09:27:59 AM »

Hello,

Thanks a lot for the update. I just realized that the modification to the log4j configuration file I gave you was not the correct one, as it does not cause the application to log the full stack trace. Sorry for the inconvenience. Instead, the following filter should be added:
Code: [Select]
log4j.logger.org.jppf.client.TaskServerConnectionHandler=DEBUG
-Laurent
Logged

broiyan

  • JPPF Grand Master
  • ****
  • Posts: 54
Re: application config value "localhost" needed to be replaced with an IP
« Reply #4 on: February 14, 2016, 09:32:35 AM »

Please note my edit (2 messages back from here). I may no longer have this problem. I now supply the HOSTNAME in connection to 127.0.1.1 instead of the actual IP.
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads