anchor.diff:      catch
           _:Reason ->
               ?error("Cannot stop database node: ~p", [Reason]),
  +            {error, Host}
  +    end.
  +
  +
  +%% join_cluster/3
  +%% ====================================================================
  +%% @doc Adds database host to cluster. ClusterHost is one of current
  +%% database cluster hosts.
  +%% @end
  +-spec join_cluster(Username :: binary(), Password :: binary(), ClusterHost :: string()) -> Result when
  +    Result :: ok | {error, Reason :: term()}.
  +%% ====================================================================
  +join_cluster(Username, Password, ClusterHost) ->
  +    Host = onepanel_utils:get_host(node()),
  +    try
  +        case ClusterHost of
  +            Host -> throw(cluster_host);
  +            _ -> ok
  +        end,
  +        URL = "http://" ++ ClusterHost ++ ":" ++ ?DEFAULT_PORT ++ "/nodes/" ++ ?DEFAULT_DB_NAME ++ "@" ++ Host,
  +
  +        {ok, "201", _, ResponseBody} = request(Username, Password, URL, put, []),
  +        true = proplists:get_value(<<"ok">>, mochijson2:decode(ResponseBody, [{format, proplist}])),
  +
  +        {ok, Host}
  +    catch
  +        _:cluster_host ->
  +            {ok, Host};
  +        _:Reason ->
  +            ?error("Cannot join database cluster: ~p", [Reason]),
               {error, Host}
       end.
   
  
positive.code:         Username = proplists:get_value(username, Args),
          Password = proplists:get_value(password, Args),
  
          {StartOk, StartError} = onepanel_utils:apply_on_hosts(Dbs, ?MODULE, local_start, [Username, Password, hd(Dbs)], ?RPC_TIMEOUT),
  
          case StartError of
              [] ->
                  case dao:update_record(?GLOBAL_CONFIG_TABLE, ?CONFIG_ID, [{dbs, Dbs}]) of
                      ok -> ok;
                      Other ->
                          ?error("Cannot update database nodes configuration: ~p", [Other]),
                          onepanel_utils:apply_on_hosts(Dbs, ?MODULE, local_stop, [], ?RPC_TIMEOUT),
                          {error, {hosts, Dbs}}
                  end;
              _ ->
                  ?error("Cannot start database nodes on following hosts: ~p", [StartError]),
  
negative.code:         ok = finalize_local_start(DefaultUsername, DefaultPassword, ?FINALIZE_START_ATTEMPTS),
          {ok, _} = local_change_username(DefaultUsername, Username, DefaultPassword),
          {ok, _} = local_change_password(Username, DefaultPassword, Password),
  
          {ok, Host}
      catch
  