Permalink
Browse files

MB-4160 Set rest port on per node basis.

Change-Id: I2d9d039c073e3045c822ca92f6948bff7bdcb082
Reviewed-on: http://review.couchbase.org/8719
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
aartamonau authored and alk committed Aug 8, 2011
1 parent 6a1f686 commit bcf3b5b4cfd8b719de11dde19b7f5a5ccf8d587e
Showing with 6 additions and 4 deletions.
  1. +2 −1 src/menelaus_event.erl
  2. +2 −2 src/menelaus_web.erl
  3. +2 −1 src/ns_cluster.erl
View
@@ -91,7 +91,8 @@ init(_) ->
terminate(_Reason, _State) -> ok.
code_change(_OldVsn, State, _) -> {ok, State}.
-handle_event({rest, _}, #state{webconfig = WebConfigOld} = State) ->
+handle_event({{node, _, rest}, _},
+ #state{webconfig = WebConfigOld} = State) ->
WebConfigNew = menelaus_web:webconfig(),
case WebConfigNew =:= WebConfigOld of
true -> {ok, State};
View
@@ -1083,8 +1083,8 @@ handle_settings_web_post(Req) ->
case build_settings_web() =:= build_settings_web(PortInt, U, P) of
true -> ok; % No change.
false ->
- ns_config:set(rest,
- [{port, PortInt}]),
+ ns_config:set_sub({node, node(), rest},
+ port, PortInt),
if
{[], []} == {U, P} ->
ns_config:set(rest_creds, [{creds, []}]);
View
@@ -117,7 +117,8 @@ handle_cast(leave, State) ->
ns_config:clear([directory]),
case WebPort of
false -> false;
- _ -> ns_config:set(rest, [{port, WebPort}])
+ _ -> ns_config:set_sub({node, node(), rest},
+ port, WebPort)
end,
ns_config:set_initial(nodes_wanted, [node()]),
ns_cookie_manager:cookie_sync(),

0 comments on commit bcf3b5b

Please sign in to comment.