Merge pull request #551 from rade/weave_port

make weave port configurable via WEAVE_PORT
This commit is contained in:
rade committed 2015-04-16 14:44:39 +01:00
commit af51aef33f
3 files changed
+19 -8

No files matched your search

+5 -4
View File
@@ -92,10 +92,11 @@ We repeat similar steps on `$HOST2`...
The only difference, apart from the choice of IP address for the
application container, is that we tell our weave that it should peer
with the weave on `$HOST1` (specified as the IP address or hostname, and
optional `:port`, by which `$HOST2` can reach it). NB: if there is a
firewall between `$HOST1` and `$HOST2`, you must open port 6783 for TCP
and UDP.
with the weave on `$HOST1` (specified as the IP address or hostname,
and optional `:port`, by which `$HOST2` can reach it). NB: if there is
a firewall between `$HOST1` and `$HOST2`, you must open the weave port
(6783 by default; this can be overriden by setting `WEAVE_PORT`) for
TCP and UDP.
Note that we could instead have told the weave on `$HOST1` to connect to
`$HOST2`, or told both about each other. Order does not matter here;
+4 -1
View File
@@ -316,7 +316,10 @@ data centres. So, for example, one could run an application consisting
of containers on GCE, EC2 and in local data centres.
To enable this, the network must be configured to permit TCP and UDP
connections to port 6783 of the docker hosts.
connections to the weave port of the docker hosts. The weave port
defaults to 6783. This can be overriden by setting `WEAVE_PORT`, but
it is highly recommended that all peers in a weave network are given
the same port setting.
### <a name="multi-hop-routing"></a>Multi-hop routing
+10 -3
View File
@@ -59,6 +59,7 @@ exec_remote() {
-e WEAVE_DOCKER_ARGS \
-e WEAVEDNS_DOCKER_ARGS \
-e WEAVE_PASSWORD \
-e WEAVE_PORT \
-e WEAVE_CONTAINER_NAME \
-e DOCKER_BRIDGE \
-e PROCFS=/hostproc --privileged --net=host \
@@ -86,7 +87,7 @@ DNS_CONTAINER_NAME=weavedns
BRIDGE=weave
CONTAINER_IFNAME=ethwe
MTU=65535
PORT=6783
PORT=${WEAVE_PORT:-6783}
HTTP_PORT=6784
DNS_HTTP_PORT=6785
@@ -610,6 +611,7 @@ case "$COMMAND" in
shift 1
fi
NICKNAME=$(hostname)
CONTAINER_PORT=$PORT
while true; do
case "$1" in
-password)
@@ -623,6 +625,11 @@ case "$COMMAND" in
NICKNAME="$2"
shift 2
;;
-port)
[ $# -gt 1 ] || usage
CONTAINER_PORT="$2"
shift 2
;;
*)
break
;;
@@ -632,8 +639,8 @@ case "$COMMAND" in
# additional parameters, such as resource limits, to docker
# when launching the weave container.
CONTAINER=$(docker run --privileged -d --name=$CONTAINER_NAME \
-p $PORT:$PORT/tcp -p $PORT:$PORT/udp -e WEAVE_PASSWORD \
$WEAVE_DOCKER_ARGS $IMAGE -iface $CONTAINER_IFNAME -name $MACADDR -nickname "$NICKNAME" "$@")
-p $PORT:$CONTAINER_PORT/tcp -p $PORT:$CONTAINER_PORT/udp -e WEAVE_PASSWORD \
$WEAVE_DOCKER_ARGS $IMAGE -iface $CONTAINER_IFNAME -port $CONTAINER_PORT -name $MACADDR -nickname "$NICKNAME" "$@")
with_container_netns $CONTAINER launch >/dev/null
wait_for_status $CONTAINER_NAME $HTTP_PORT
echo $CONTAINER