jfrog / JFrog-Cloud-Installers

Template to deploy Artifactory Enterprise cluster.
Apache License 2.0
78 stars 140 forks source link

Avoiding IPv6 with extra JAVA_OPTION #347

Closed bbaassssiiee closed 11 months ago

bbaassssiiee commented 1 year ago

Some distributions have two entries for localhost in /etc/hosts:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

This can cause Java apps trying binding using IPv6, which fails when that's disabled. This causes some tcp ports not listening, like the Artifactory router service.

Solution: add an extra JAVA_OPTION: -Djava.net.preferIPv4Stack=true.

https://github.com/jfrog/JFrog-Cloud-Installers/blob/9158ae37089aead470009be6ede69e8118faf916/Ansible/ansible_collections/jfrog/platform/roles/artifactory/defaults/main.yml#L39

artifactory_extra_java_opts: '-server -Xms512m -Xmx4g -Xss256k -XX:+UseG1GC -Djava.net.preferIPv4Stack=true'
Logeshwarsn commented 1 year ago

@bbaassssiiee Thanks for raising this issue. Did you had a chance to test this change from your end ? if it is tested then please provide us the artifactory-service.log with enabling this artifactory_extra_java_opts: '-server -Xms512m -Xmx4g -Xss256k -XX:+UseG1GC -Djava.net.preferIPv4Stack=true'

Logeshwarsn commented 12 months ago

@bbaassssiiee we would like to include in this readme instead of default in vars.

bbaassssiiee commented 12 months ago

This was tested and here is the log you requested: artifactory-service.log

bbaassssiiee commented 12 months ago

@bbaassssiiee we would like to include in this readme instead of default in vars.

Pull-request to amend the README.md