[ejabberd] Amazon load balancer and ejabberd, problematic?

Keith Irwin keith.irwin at gmail.com
Tue Apr 5 22:28:16 MSD 2011


Folks--

I have an amazon load balancer set up to forward port 443 traffic to a
back-end system running ejabberd on port 5222. The idea is that over time, I
can cluster more ejabberd servers but maintain that same name/port for
(programmatic) clients.

This seems (mainly) to work.

On the server side, I have some Scala clients which, occasionally (once a
day, maybe), get the following errors:

java.net.SocketException: Connection closed by remote host
        at
sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1327)
        at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:62)
        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220)
        at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:290)
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:294)
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140)
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
        at java.io.BufferedWriter.flush(BufferedWriter.java:253)
        at
org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:208)
        at
org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40)
        at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:76)
java.io.EOFException: no more data available - expected end tag
</stream:stream> to close start tag <stream:stream> from line 1, parser
stopped on END_TAG seen ...</properties></message>... @1:179556
        at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
        at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
        at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
        at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
        at
org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325)
        at
org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
        at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)

Unfortunately, my Smack using Scala code can't seem to recover from this.
Attempts to reconnect just break with the same error.

My question isn't about the JVM stuff (quite yet) but about whether or not
there's something odd about the behavior of running XMPP through a load
balancer (Amazon's ELB, specifically) that can occasionally break things in
a way that's not really normal for XMPP streams.

Any wisdom out there?

Thanks,

Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20110405/933f3ac8/attachment-0001.html>


More information about the ejabberd mailing list