EmonHUB post to multiple EmonCMS Servers

I’ve been running v8.5 of EmonCMS for forever, and want to finally upgrade to the latest build. The instructions I found for upgrading don’t seem terribly helpful for 8.5 > 9.8; they do specifically call out upgrading TO 8 from older versions, but not from 8 to a newer version, so I built a new VM, loaded Ubuntu 16.04.3 and installed EmonCMS from scratch using hte guide, and now have a working EmonCMS 9.8.8 instance. So I want to post to both servers to keep my historical data until it times out and work on migrating everything I have set up over to 9.8.

I did some searching and found what has been indicated to work, but for whatever reason, it doesn’t seem to work (for me).

Here’s what I have in my EmonHUB config:

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = http://IP1
        apikey = WriteAPIKey1
        senddata = 1
        sendstatus = 1

[[emoncms2]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = http://IP2
        apikey = WriteAPIKey2
        senddata = 1
        sendstatus = 1

Best I can tell, this should be sending data to both EmonCMS instances, but on the new one, there’s nothing showing on the ‘/input/view’ page. The first one is still getting its updates.

Did I miss something?

Yes that looks correct, it should work.

Could you post your emonhub.log? Does this contain any clues? Is your first Emoncms server updating ok.

V8 > V9 was a big update. It’s possible to upgrade but I would recomend a fresh install. There are various migration scrips available:

well, now that you mention it… the EmonHUB appears to be queuing up a lot on it destined for the second EmonCMS server. The only thing that stands out is this:

2017-10-20 20:57:35,036 DEBUG    emoncms2   Sending bulkdata, length: 4835
2017-10-20 20:57:35,217 INFO     emoncms2   sending: {snip}
2017-10-20 20:57:35,255 WARNING  emoncms2   emoncms2 couldn't send to server, HTTPError: 404
2017-10-20 20:57:35,257 WARNING  emoncms2   send failure: wanted 'ok' but got ''
2017-10-20 20:57:35,257 DEBUG    emoncms2   Sending bulkdata, success: False
2017-10-20 20:57:35,258 DEBUG    emoncms2   New queue length: 4835
2017-10-20 20:57:35,259 INFO     emoncms2   sending: http://192.168.41.14/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y
2017-10-20 20:57:35,262 WARNING  emoncms2   emoncms2 couldn't send to server, HTTPError: 404

So apparently something is ‘not right’ with the new EmonCMS server. When I go to the same URL (minus the data after the .json?), I get:

The requested URL /myip/set.json was not found on this server.

The only difference of note is that on my old 8.5 instance, I do not go the IP/emoncms - it’s just the ip or hostname.

I did note a reference to ‘myip’ in one of the posts I read, but I have no idea what it was referring to other than what I see in the log - there is no instance of ‘myip’ in the config.

Edit2: I fixed it. Not sure if this is ‘supposed’ to be done or not, but I apparently did it on my 8.5 server, so figured ‘what the heck, let’s try it, I’d rather it work this way anyway’. As I mentioned, on my old server, I just go to ‘http://serverip/’ and I get my EmonCMS page, whereas on the new one I have to go to ‘http://serverip/emoncms’. Well, I edited the ‘000-default.conf’ in ‘/etc/apache2/sites-available’ to comment out ‘DocumentRoot /var/www/html’ (You could also delete it if you want) and add in ‘DocumentRoot /var/www/html/emoncms’. After doing this and restarting, almost like magic, the new server is getting data. And the log on EmonHub is a bit quieter.