Streamsets 错误 - 错误的文件描述符

Streamsets Error - Bad File Descriptor

我试图使用 Streamsets 查询 Oracle 数据库并将数据发布到 Kafka。我在 Mac 上下载了 Streamsets 的 tarball 并将其解压缩到我的主目录中。 运行 $HOME/streamsets-datacollector-2.1.0.2/bin/streamsets dc 在我第一次尝试时启动,然后我按照说明 here to add the jdbc driver, then the instructions here 配置我的 streamsets 作业。但是,我得到一个错误:JDBC_00 - Cannot connect to specified database: com.streamsets.pipeline.api.StageException: JDBC_06 - Failed to initialize connection pool: java.sql.SQLRecoverableException: IO Error: Bad file descriptor.

这最终与进程可以打开的文件数量限制有关。当我在笔记本电脑上 运行 ulimit -n 时,它显示 4864,然后我通过 ulimit -n 10000 将其设置为 10,000,重新启动 streamsets 服务器,它成功了!如果我需要保留 运行 这个,我会找到一个更程序化的方法来设置这个进程的 ulimit 来解决这个问题。

您肯定需要增加 ulimit -n。要为 Ubuntu 中的所有用户永久更改,请尝试以下操作:

echo "* soft nofile 60000" > /etc/security/limits.d/*_limits.conf && echo "* hard nofile 60000" >> /etc/security/limits.d/*_limits.conf

将 60000 替换为您想要的任何数字。我在使用 60k 的流集中从未遇到过问题。你应该能够在 bsd 中做类似的事情。