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

[BUG][opensearch] failed to resolve host [opensearch-cluster-master-headless] #478

Closed
BCantos17 opened this issue Sep 29, 2023 · 1 comment
Labels
bug Something isn't working untriaged Issues that have not yet been triaged

Comments

@BCantos17
Copy link

Describe the bug
When creating a cluster with a name other than the default name opensearch-cluster-master, opensearch tries to connect to the opensearch-cluster-master-headless
To Reproduce
Steps to reproduce the behavior:
Create an opensearch.yml configuration and change the fields clusterName and nodeGroup to something other than opensearch-cluster and master and then try running the chart. The services will throw an exception. In my case, the yaml file is

clusterName: "opensearch-next-cluster"
nodeGroup: "manager"
roles:
  - cluster_manager
config:
  opensearch.yml: |-
    cluster.name: opensearch-next-cluster
    network.host: 0.0.0.0
    plugins:
      security:
        disabled: true

Expected behavior
Should try to connect to the host opensearch-next-cluster-manager-headless instead or perhaps include a field to override the hostname. I could not find anything in the documentation that looks like I can override the host

Chart Name
opensearch
Chart Version
2.15.0

Host/Environment (please complete the following information):

  • Helm Version: 2.8.0
  • Kubernetes Version: 1.27

Additional context
full stack trace

{"type": "server", "timestamp": "2023-09-29T20:51:16,382Z", "level": "WARN", "component": "o.o.d.SeedHostsResolver", "cluster.name": "opensearch-next-cluster", "node.name": "opensearch-next-cluster-manager-0", "message": "failed to resolve host [opensearch-cluster-master-headless]",
"stacktrace": ["java.net.UnknownHostException: opensearch-cluster-master-headless",
"at java.net.InetAddress$CachedAddresses.get(InetAddress.java:801) ~[?:?]",
"at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]",
"at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]",
"at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]",
"at org.opensearch.transport.TcpTransport.parse(TcpTransport.java:613) ~[opensearch-2.10.0.jar:2.10.0]",
"at org.opensearch.transport.TcpTransport.addressesFromString(TcpTransport.java:555) ~[opensearch-2.10.0.jar:2.10.0]",
"at org.opensearch.transport.TransportService.addressesFromString(TransportService.java:1143) ~[opensearch-2.10.0.jar:2.10.0]",
"at org.opensearch.discovery.SeedHostsResolver.lambda$resolveHostsLists$0(SeedHostsResolver.java:182) ~[opensearch-2.10.0.jar:2.10.0]",
"at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]",
"at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:849) ~[opensearch-2.10.0.jar:2.10.0]",
"at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]",
"at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]",
"at java.lang.Thread.run(Thread.java:833) [?:?]"] }
@BCantos17 BCantos17 added bug Something isn't working untriaged Issues that have not yet been triaged labels Sep 29, 2023
@BCantos17
Copy link
Author

So i was passing in the opensearch.yml as a template variable like so

config:
  opensearch.yml: |-
    ${opensearch.yml}

and in that template I was trying to pass in a variable within the template cluster.name: ${clustername} but this didn't pass in the variable, instead passing in the string "${clustername}". Fixed the issue but just changing it from a variable to a string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Issues that have not yet been triaged
Projects
None yet
Development

No branches or pull requests

1 participant