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

why there need to check standby_host before create connect #40

Open
wfxxh opened this issue Apr 30, 2020 · 0 comments
Open

why there need to check standby_host before create connect #40

wfxxh opened this issue Apr 30, 2020 · 0 comments

Comments

@wfxxh
Copy link

wfxxh commented Apr 30, 2020

# Create and test standby client if configured.
if @standby_host
  @standby_client = prepare_client(@standby_host, @standby_port, @user)
  begin
    test_client(@standby_client)
  rescue => e
    logger.warn("Could not connect to standby namenode #{@standby_client.host}. Error: #{e.message}. Trying main webhdfs namenode.")
  end
end
@client = prepare_client(@host, @port, @user)
begin
  test_client(@client)
rescue => e
  # If no standy host is configured, we need to exit here.
  if not @standby_host
    raise
  else
    # If a standby host is configured, try this before giving up.
    logger.error("Could not connect to #{@client.host}:#{@client.port}. Error: #{e.message}")
    do_failover
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant