zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher <ctubb...@apache.org>
Subject Re: too many open files occur while the network cable is pulled out#zookeeper3.4.6#java client
Date Mon, 21 Dec 2015 22:34:25 GMT
I could see a concern if the number of sockets continues to grow unbounded,
but if it levels off at some point, and the surge is only temporary, it
might be better to just make sure you bump up your system's security limits
for the number of open files ("nofile" in /etc/security/limits.{d/|conf}.

This is something the Accumulo project has been recommending, and I've
heard similar recommendations from Hadoop users, and other cloud and/or
bigdata systems. The defaults in many systems are just too small to handle
routine use cases.

On Sun, Dec 20, 2015 at 3:58 PM wsk-528 <wsk-528@163.com> wrote:

> hello:
>     accidentally,i find a problem than the zookeeper client print "too
> many open files" with server version 3.4.6, and i use the same java client
> version.
>     the env is like this:the server running on server A, and the client
> running on server B(RHEL AS5), when i pull out the cable between them, the
> client print "too many open files" ,and network unreachable.
>     i test if i shutdown the network interface,the same log was printed.
>     i use lsof -p <pid>,i can see a lot of socket file handle.
>
>
>
>
>     my code is as following:
>    public class ZKTest {
>
>
> /**
> * @param args
> * @throws IOException
> * @throws InterruptedException
> * @throws KeeperException
> */
> public static void main(String[] args) throws IOException,
> InterruptedException, KeeperException {
> ZooKeeper zk = new ZooKeeper(args[0], 30000, new Watcher() {
>
>
> @Override
> public void process(WatchedEvent event) {
> if(event.getState()==KeeperState.SyncConnected) {
> System.out.println("connected...");
> } else if(event.getState()==KeeperState.Disconnected) {
> System.out.println("disconnected...");
> } else if(event.getState()==KeeperState.Expired) {
> System.out.println("expired...");
> } else {
> System.out.println("unknow " + event.getState());
> }
> }
> });
> zk.exists("/testpath", false);
> Object o = new Object();
> synchronized(o) {
> o.wait();
> }
> }
>
>
> }
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message