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

What to do if the hive service is actively disconnected due to timeout? #199

Closed
shcw opened this issue Sep 9, 2022 · 5 comments
Closed

Comments

@shcw
Copy link

shcw commented Sep 9, 2022

Hi ~

Our hive connection will be automatically disconnected if there is no request for more than 5 minutes. At this time, the connection cannot be reused. Is there a better way to deal with it?

For example: heartbeat、 timing trigger?

@shcw shcw changed the title What to do if the hive service is actively disconnected due to timeout What to do if the hive service is actively disconnected due to timeout? Sep 9, 2022
@beltran
Copy link
Owner

beltran commented Sep 10, 2022

You may be able to configure this with hive.server2.idle.session.timeout and hive.server2.session.check.interval. See this answer: https://stackoverflow.com/a/33994479, and these docs: https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.server2.session.check.interval

@beltran
Copy link
Owner

beltran commented Sep 16, 2022

Closing this for now, let me know if it didn't help.

@beltran beltran closed this as completed Sep 16, 2022
@shcw
Copy link
Author

shcw commented Sep 19, 2022

Closing this for now, let me know if it didn't help.

thx, i plan to query a sql every 5 minutes and let him continue.

unable to modify hive's configuration for other reasons

@beltran
Copy link
Owner

beltran commented Sep 19, 2022

You can set custom values from the connection, these values need not apply to the server. See this test for example, so you could do:

configuration := map[string]string{
      "hive.server2.idle.session.timeout": "3000",
}
configuration := NewConnectConfiguration()
...
configuration.HiveConfiguration = hiveConfiguration
connection, errConn := gohive.Connect("hs2.example.com", port, getAuth(), configuration)

So the configuration would only apply to your client.

@shcw
Copy link
Author

shcw commented Sep 20, 2022

您可以从连接中设置自定义值,这些值不需要应用于服务器。例如看这个测试,所以你可以这样做:

configuration := map[string]string{
      "hive.server2.idle.session.timeout": "3000",
}
configuration := NewConnectConfiguration()
...
configuration.HiveConfiguration = hiveConfiguration
connection, errConn := gohive.Connect("hs2.example.com", port, getAuth(), configuration)

因此,该配置仅适用于您的客户端。

I got it, thank you very much for your guidance

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

2 participants