How do I run Juju on a local server?
Ok, solved!
Setup bridged network br0 in /etc/network/interfaces.
auto eth1
iface eth1 inet manual
auto br0
iface br0 inet static
bridge_ports eth1
address 192.168.1.2
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1
bridge_stp off
bridge_fd 0
bridge_maxwait 0
Edit /etc/lxc/lxc.conf and set lxc.network.link=br0
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
Edit /etc/default/lxc and set LXC_BRIDGE, LXC_ADDR, LXC_NETMASK, LXC_NETWORK, LXC_DHCP_RANGE & LXC_DHCP_MAX appropriately for my LAN (192.168.1.0/24 type settings) now juju status shows 192.168.1.0/24 addresses for my units and I can access them over the LAN from another machine
LXC_BRIDGE="br0"
LXC_ADDR="192.168.1.2"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="192.168.1.0/24"
LXC_DHCP_RANGE="192.168.1.50,192.168.1.99"
LXC_DHCP_MAX="49"
For what I am able to understand, you have Juju installed and working but you want to expose a service to other computers on your network. I will assume all the computers on your network can see each other and have their IP addresses correct.
I am also guessing the tutorial you are talking about is one of this:
- How do I configure juju for local usage?
- Getting started with Juju
then I would imagine that if you want to make the service available for other computers you would do this:
juju expose SERVICE
Using How to install Hadoop? as the example I would:
juju expose hadoop-master
Juju Expose - https://jujucharms.com/docs/stable/charms-exposing
juju status SERVICE
also helps in figuring out how the service is working.
Of course there are a couple of things I would need to know about the network and the server, for instance:
- Does the server have a firewall setup (iptables, ufw...)
- Does the network have a router configured to do something related to blocking, forwarding and such that would create a problem trying to access the server?
- Do the computers on the LAN see the server?
- Is there any special connection that is not common (Wireless or Wired) or security in used that could create a problem with the clients and server?
- Are all the steps to setup Juju correctly done (As provided by the tutorials mentioned, specially the part about
environments.yaml
which I tend to forget or get wrong). - Does
juju status
give you some insight of what the problem could be? - Do you have multiple environments set up in the
environments.yaml
file?
In case the service is not shown to the outside because of LXC, do the following (Provided by the answer popey gave and a lot of research):
Setup bridged network br0 in /etc/network/interfaces
Edit
/etc/lxc/lxc.conf
and setlxc.network.link=br0
Edit
/etc/default/lxc
and set LXC_BRIDGE, LXC_ADDR, LXC_NETMASK, LXC_NETWORK, LXC_DHCP_RANGE & LXC_DHCP_MAX appropriately to the LAN (192.168.1.0/24 type settings)Now
juju status
should show 192.168.1.0/24 addresses for my units and can be access over the LAN from another machine.