获取 jabberd14 的所有 源代码。构建服务器,进行配置/make。
从 IDEALX 获取 xdb_sql 的源代码,构建它,并设置 jabber.xml 以使用它。
![]() | 这是一个非常重要的步骤。xdb_file,jabberd 自带的默认 xdb,也受到打开文件描述符的限制。你可以像我们稍后将对 jadc2s 做的那样玩相同的 shell 游戏,但是如果你想要一个可以处理数百万用户的服务器,那么你需要 xdb_file 以外的东西。使用 xdb_sql,它只使用一个文件描述符来连接到 mysql 服务器。 |
有关如何配置 xdb_sql 的更多信息,请参阅发行版中分发的 README 文件。
构建 jadc2s 并将二进制文件分发到它们将要运行的机器上。
设置主 jabberd 以接受 jadc2s 组件连接。在 jabber.xml 配置文件中,添加以下 XML
<service id="jadc2s-1"> <accept> <ip/> <port>5111</port> <secret>secret</secret> </accept> </service> <service id="jadc2s-2"> <accept> <ip/> <port>5112</port> <secret>secret</secret> </accept> </service> |
现在你可以运行主 jabberd 并使其监听 jadc2s 的连接。
在每台机器上配置 jadc2s.xml 以连接到 SM,监听位置等...
<!-- session manager configuration --> <sm> <!-- host and port of the SM --> <host>localhost</host> <port>5111</port> <!-- shared secret, for authenticating us --> <secret>secret</secret> <!-- our ID, for authenticating us to the sm --> <id>jadc2s</id> <!-- how many times to try to connect to the sm (default: 5) --> <retries>5</retries> </sm> <!-- local network settings --> <local> <!-- who we identify ourselves as. This should correspond to the --> <!-- ID (host) that the session manager thinks it is. --> <id>localhost</id> <!-- IP address to bind to (default: 0.0.0.0) --> <!-- <ip>0.0.0.0</ip> --> <!-- port to bind to (default: 5222) --> <port>5222</port> <!-- SSL configuration --> <!-- Specify the port to listen on, and the key file to use for --> <!-- the certificate. --> <!-- <port/> (default: 5223) --> <!-- <pemfile/> (default: ./server.pem) --> <!-- <ssl> <port>5223</port> <pemfile>./server.pem</pemfile> </ssl> --> </local> |
有关如何配置 jadc2s 的更多信息,请参阅 jadc2s 源代码目录中的 README 文件。
打开一个可以更改文件系统参数的 shell(通常是 root),并执行以下命令
<!-- maximum number of file descriptors. Should be a prime --> <!-- number. At least four will be used by jadc2s itself, --> <!-- usually around six or seven (default: 1023) --> <!-- For a list of prime numbers: --> <!-- http://www.utm.edu/research/primes/lists/small/10000.txt --> <max_fds>10007</max_fds> |
你选择的数字是素数非常重要。为了更容易找到你想要的素数,你可以访问这个页面 http://www.utm.edu/research/primes/lists/small/10000.txt。
剩下的就是运行服务器和 jadc2s 进程。一切都应该正常工作。如果不行,请务必告诉我:<reatmon@jabber.org>以便我可以修复本文档。