*** Edit the information contained here is out of date. To find more up to date information please visit here: http://wavingtheshiny.collaborynth.com.au/books/fedone-book/fedone-book ***
Now that you've setup your Wave Reference Server, you're probably going to want to test out one of THE big features. Federation. This post will take you through setting it up.
What Is Federation?
Federation is the thing that moves Wave out from JAGB (Just Another Google Beta) to being something more. It is the server to server communication protocol. This is what allows you to run your own Wave server and communicate with any other Wave server.
Okay, Cool, So How Do I Set It Up?
We actually did most of the work for setting up Federation in the last tutorial. To finish the job we simply need to do the following:
Ports: If you're running the server behind a firewall or NAT, then you'll need to setup port forwarding for port 5269 on your device to your Server.
DNS: For the moment there isn't an "Official" port for the Wave Federation Protocol. This means that the WRS relies on SRV records to indicate which port it should be communicating with the remote server on. Below is an example of an SRV record for your Wave Server.
_xmpp-server._tcp.blah.com. 3600 IN SRV 10 0 5269 wave.blah.com.
Also if this is a new subdomain for your domain don't forget to add an A record.
wave.blah.com IN A [IPADDRESS]
Note: If you're using a subdomain to house your WRS (say wave.blah.com) you will need to setup a second A record. Openfire lists each component as a subdomain of the nominated domain. So in the case of wave.blah.com you would also need to setup a wave.wave.blah.com A record.
How Do I Test It?
Testing the Federation is pretty simple. In the run-server.sh scrip there is an entry xmpp_server_ping. If you put the url of a known working Wave Server here it will send out a packet on startup and if all is working well, you should recieve a reply from the server.
Comments
hhPHEGJsjOUyOr
Lvu3Lk ittgqfhbfavr, [url=http://hvrrxppsqjbj.com/]hvrrxppsqjbj[/url], [link=http://hxtdebifvjim.com/]hxtdebifvjim[/link], http://cjsibsfacyfo.com/
qBVZZFqtntltPn
ILB0gS rddotcmwsgif, [url=http://kcaazcrpsngm.com/]kcaazcrpsngm[/url], [link=http://sktjaxgtowlj.com/]sktjaxgtowlj[/link], http://imkbiutwwsei.com/
reiyvgIdXc
MrDd2k xdaxfawsifnn, [url=http://ebmeffpmyokf.com/]ebmeffpmyokf[/url], [link=http://qrnzgjfokhwx.com/]qrnzgjfokhwx[/link], http://rtwtksmogjnl.com/
HImLsBoTkpGewPu
Jm6Udc iyjrghiaszfy, [url=http://ccistuintprt.com/]ccistuintprt[/url], [link=http://gjbvpaffmppa.com/]gjbvpaffmppa[/link], http://gsvzvcxngwsd.com/
VvLqGVyufwm
comment3, cigarettes, Levitra,
aPvxgljtRvPkPUVqcK
comment5, life insurance test, Wycillin, Levitra,
wave.wave / 404 error code
When setting up a wave on a subdomain (wave.domain.com), your records indicate to configure wave.wave in the A records and the SRV records.When I do this, I receive a 404 Jabber error code indicating "remote-server-not-found". What do I additionally need to configure? Logs are as follows.
Federating challenges
.. this was something to test while waiting more tips for Web UI integrationd etails from Wave team. Thanks for documenting this. Maybe you could see something obvious in following or have you seen similar problems while testing federation between two wave servers.
I did the two indetical setup to different domains:
- host A: wave.subA.domain.com
- host B: wave.subB.domain.com
Waves in the both installations are working internally. I had to add A record for same IP (or /etc/hosts entry) for the both subA.domain.com and subB.domain.com. Otherwise server did not started properly with following error:
INFO: Starting client frontend on host: x.x.x.x port: 9876
couldn't connect to XMPP server:org.xmpp.component.ComponentException: java.net.UnknownHostException: subA.domain.com
Aug 2, 2009 10:32:53 PM org.waveprotocol.wave.examples.fedone.ServerMain run
I also added SRV record as you instructed below. I defined xmpp_server_ping for run-server.sh scripts for both server (A for B, B for A)..
Both installation started properly when /etc/hosts entry added. I started the server A first. The following log entry seen in server A after server B started:
INFO: Starting server
Aug 2, 2009 10:39:33 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent processPacket
INFO: received XMPP packet:
<iq type="get" id="7884-0" to="wave.subA.domain.com" from="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>
Aug 2, 2009 10:39:33 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent sendPacket
INFO: sent XMPP packet:
<iq type="result" id="7884-0" from="wave.subA.domain.com" to="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
Then I tried to collaborate between A and B. It looks like all request from A are going to B and seen in B's log, but what ever B's is trying to send nothing seen in A. I noticed following:
in server A: /add user2@subB.domain.com
- number of log lines in both server A and B, but nothing happen. The last entry in log B:
INFO: received XMPP packet:
<iq type="result" id="5000-2" from="dev2.ihalainen.fi" to="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="pubsub.subA.domain.com" name="Publish-Subscribe service"/>
<item jid="wave.subA.domain.com" name="Google Prototype Wave Server - FedOne"/>
<item jid="conference.subA.domain.com" name="Public Chatrooms"/>
</query>
</iq>
Aug 2, 2009 10:45:07 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent sendPacket
INFO: sent XMPP packet:
<iq type="get" id="7873-3" to="pubsub.subA.domain.com" from="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
Note: Why it is using pubsub host here?
in server B: /add user@subA.domain.com
Nothing seen in server A log. Two last entries in server B log:
Note! why it is trying to connect with the domain name and not with the server host name?
Aug 2, 2009 10:49:47 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.XmppDisco sendDiscoItemsGet
INFO: Trying to discover remote server: subA.domain.com
Aug 2, 2009 10:49:47 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent sendPacket
INFO: sent XMPP packet:
<iq type="get" id="1480-4" to="subA.domain.com" from="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>
Aug 2, 2009 10:49:48 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent processPacket
INFO: received XMPP packet:
<iq type="result" id="1480-4" from="subA.domain.com" to="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#items">
<item jid="pubsub.subA.domain.com" name="Publish-Subscribe service"/>
<item jid="wave.subA.domain.com" name="Google Prototype Wave Server - FedOne"/>
<item jid="conference.subAdomain.com" name="Public Chatrooms"/>
</query>
</iq>
Aug 2, 2009 10:49:48 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent sendPacket
INFO: sent XMPP packet:
<iq type="get" id="7287-5" to="subA.domain.com" from="wave.subB.domain.com">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
This is an Openfire Issue
Openfire by default supports the pubsub service and conference service. When the Wave server makes a request to the remote server the first thing it does is try and find the wave service being offered, however it cheats a little by assuming that the wave service will be the first one offered by the remote XMPP server. If this doesn't happen the local server sends anyway, unless there is absolutely no service being offered.
The key is to disable the pubsub and conference service in Openfire. I've updated the How To to reflect this but here are the instructions:
Disablilng Pubsub:
To disable the Pubsub service do the following:
Browse to Server Manager->System Properties. Scroll down to the bottom and enter the following information:
Property Name: xmpp.pubsub.enabled
Property Value: false
Disabling Group Chat:
Browse to Group Chat->Group Chat Settings.
Delete the conference domain.
Once you have completed these steps I find it best to restart the Openfire service (sudo /etc/init.d/openfire restart under ubuntu).
Federating successfully now
Thanks. It was an Openfire issue.
Port Numbers?
Hi James - great post - thanks.
I had a query on the port number you used in your DNS SRV record. Isn't in the XMPP S2S port that is needed to be defined, that is: 5269? The 5275 port is simply the local port that your Openfire server will listen on for the component connection from the Wave Reference Server? (And therefore, you need to open up 5269 on your NAT device?)
Or have I got it completely mixed up?
Thanks again,
Damian.
You're Right
The correct port number is 5269, 5275 is the result of a mixup on my end. I'll make the change :)