许多并发的Cassandra数据库连接通过SSH隧道

我有一个应用程序使用PyCassa Cassandra客户端打开Cassandra服务器的许多并发连接。 当我在数据库服务器上本地运行客户端应用程序时,它工作。 但是,当我通过SSH通道转发到数据库服务器的Cassandra端口,并通过此隧道连接客户端应用程序到服务器时,几个连接通过,但通常我得到这样的错误:

'2012210105:49:49'|WARNING |_append_historyStorage|75 |Exception when appending to CassandraTimeSeries Traceback (most recent call last): File "atr/cassandratimeseries.py", line 140, in append cf = self._getColumnFamily(duration, 'main') File "atr/cassandratimeseries.py", line 63, in _getColumnFamily return ColumnFamily(ConnectionPool(self._keyspace, pool_timeout=100, timeout=15, max_overflow=5), self._columnFamilyName(duration, table_type), **self._column_family_op_options) File "/usr/local/lib/python2.7/dist-packages/pycassa/pool.py", line 356, in __init__ self.fill() File "/usr/local/lib/python2.7/dist-packages/pycassa/pool.py", line 415, in fill conn = self._create_connection() File "/usr/local/lib/python2.7/dist-packages/pycassa/pool.py", line 403, in _create_connection (exc.__class__.__name__, exc)) AllServersUnavailable: An attempt was made to connect to each of the servers twice, but none of the attempts succeeded. The last failure was TTransportException: TSocket read 0 bytes 

在我到服务器ssh'd的terminal打印一条消息,如:

 channel 1034: open failed: administratively prohibited: open failed channel 1035: open failed: administratively prohibited: open failed channel 1036: open failed: administratively prohibited: open failed channel 1037: open failed: administratively prohibited: open failed channel 1038: open failed: administratively prohibited: open failed channel 1039: open failed: administratively prohibited: open failed channel 1040: open failed: administratively prohibited: open failed 

有趣的是,如果我然后尝试SSH到服务器,我得到:

 channel 1023: chan_read_failed for istate 1 channel 1023: chan_write_failed for ostate 3 Shared connection to xx.xxx.xxx.xxx closed. 

如果我删除/ tmp中的主套接字文件,那么我可以ssh再次。

任何想法可能会出错? 我已经通过/etc/security/limits.conf为客户端和服务器增加了nofile限制(一万个)并重新启动。 “开放失败:行政禁止”表明存在一些行政限制。 这是什么,我该如何提高它(我应该怎么想出来呢?)

有没有其他的方式,SSH隧道比连接到本地端口更有限?

谢谢

有趣的是,我没有遇到过这个。 我会尝试你已经做了什么,所以为了接下来的步骤,我在ssh源中追查“pipe理禁止”的消息,它只发生在一个情况下,它从sshd.c中从那里我提出在channel.c和逻辑session.c

这似乎是唯一的代码在SSH将取消限制通道的数量允许,没有硬限制,我可以看到在sshd.c或channels.c

 /* setup the channel layer */ if (!no_port_forwarding_flag && options.allow_tcp_forwarding) channel_permit_all_opens(); 

你能检查服务器上的sshd_config,并确保设置了以下选项:

 AllowTcpForwarding yes 

我不喜欢我的答案是,似乎有一个1024的限制,我希望在代码中追踪的地方。 1024通常是limits.conf中打开文件的数量的默认限制 – 是否有任何其他地方在启动sshd的shell中设置了ulimit?