Binding to all interfaces

Hello,

I want to host SingleNode EventStore in Azure VM. Everything works nicely but I’m a bit concerned that I need to specify machine internal IP address in config file.

AFAIK Azure fabric controller can re-provision my VM or the machine can be rebooted and internal IP can change.

I don’t really want to go into the pain of setting up a virtual network.

I wonder if it would be possible to bind Event Store to all interfaces?

Or maybe I’m missing something?

Can’t remember offhand but I think passing --ip 0.0.0.0 will do this. Worth considering whether you actually want to reverse proxy it though.

Cheers,

James

Thanks for your reply, James.

Passing 0.0.0.0 causes http server to fail with error ‘The request is not supported’.

I’ve set up reverse proxy using IIS and ARR module and I can access web front-end. However I don’t think this will work with TCP connections…

Jakub

If we were to do it internally it would be to bind to ipaddress.any usually which is hardcoded to 0.0.0.0 is there maybe something azure specific here?

Check out this post: http://stackoverflow.com/questions/17154770/is-there-any-way-to-have-azure-vm-keep-the-same-ip-address

I have been running a single-node on an Azure Virtual machine for almost 8 months now, and the only IP-change I have experienced was when I changed the instance-size from small to medium (and back).

I know this does not answer your question, but at lest it should give you some comfort.

System.Net.IPAddress.Any resolves to 0.0.0.0 on Azure as well (at least on a Virtual machine on Azure).

Just a few notes:

When allocating an external port on Virtual Machine, this does not enable the same port on VM, but rather on the Azure Load Balancer. Internal port number would be allocated to you by Azure Fabric and you would need to retrieve it from the runtime anyway (before passing to Event Store).

Stopping and starting Azure VM can now lead to IP address change.

Best,

Rinat

Hi,

EventStore.SingleNode.exe --ip 0.0.0.0 --http-prefix http://*:2113/

should bind the ES to all interfaces for both TCP and HTTP on Windows. (Works from the config file as well).

However, it does not work on Linux due to mono limitations. (I assume you run Windows in Azure)

br

yuriy

PS: mea culpa about my previous comment. Port numbers have to be retrieved from fabric from within Azure Worker Roles and not Virtual Machines.

Yuriy,
I haven’t tried passing –http-prefix http://*:2113/
I’ll do a test today and report the results.

All, many thanks for the help, guys!

Jakub

Roy,

The persistent internal IP is guaranteed for VNets only - which I want to avoid if possible.

And I hope I will have to change instance size from XSmall to XLarge :wink:

Cheers,
Jakub

Hello,

I can confirm that adding –http-prefix http://*:2113/ solved the problem and allows EventStore to bind to any interface.

My config.json looks like this:

{

“ip” : “0.0.0.0”,

“httpPrefixes” : [“http://*:2113/”]

}

Thank you,

Jakub