anchor.diff:  %%     log_file_appender(T, [{?LOG_ID_ZMQ, ?LOG_APPENDER_ZMQ}|Acc]).
   
   
  -%% @doc load a system config file. a system config file store to mnesia.
  -%% @end
  -%% @private
  --spec(load_system_config_with_store_data() ->
  -             {ok, #system_conf{}} | {error, any()}).
  -load_system_config_with_store_data() ->
  +%% @doc load a system config file
  +%% @end
  +%% @private
  +load_system_config() ->
       {ok, Props} = application:get_env(leo_manager, system),
       SystemConf = #system_conf{n = proplists:get_value(n, Props, 1),
                                 w = proplists:get_value(w, Props, 1),
                                 r = proplists:get_value(r, Props, 1),
                                 d = proplists:get_value(d, Props, 1),
                                 bit_of_ring = proplists:get_value(bit_of_ring, Props, 128)},
  +    SystemConf.
  +
  +%% @doc load a system config file. a system config file store to mnesia.
  +%% @end
  +%% @private
  +-spec(load_system_config_with_store_data() ->
  +             {ok, #system_conf{}} | {error, any()}).
  +load_system_config_with_store_data() ->
  +    SystemConf = load_system_config(),
   
       case leo_manager_mnesia:update_system_config(SystemConf) of
           ok ->
  
positive.code: %% ---------------------------------------------------------------------
  %% @doc Create mnesia tables
  %% @private
  -spec(create_mnesia_tables1(master | slave, list(), list()) ->
               ok | {error, any()}).
  create_mnesia_tables1(master = Mode, RedundantNode0, Nodes) ->
      case mnesia:create_schema(Nodes) of
          ok ->
              try
                  %% create mnesia's schema.
                  mnesia:create_schema(Nodes),
                  rpc:multicall(Nodes, application, stop,  [mnesia]),
                  rpc:multicall(Nodes, application, start, [mnesia]),
  
                  %% create table into the mnesia.
                  leo_manager_mnesia:create_system_config(disc_copies, Nodes),
                  leo_manager_mnesia:create_storage_nodes(disc_copies, Nodes),
                  leo_manager_mnesia:create_gateway_nodes(disc_copies, Nodes),
                  leo_manager_mnesia:create_rebalance_info(disc_copies, Nodes),
                  leo_manager_mnesia:create_histories(disc_copies, Nodes),
                  leo_redundant_manager_mnesia:create_members(disc_copies, Nodes),
                  leo_redundant_manager_mnesia:create_ring_current(disc_copies, Nodes),
                  leo_redundant_manager_mnesia:create_ring_prev(disc_copies, Nodes),
                  leo_s3_auth_api:create_credential_table(disc_copies, Nodes),
                  leo_s3_bucket_api:create_bucket_table(disc_copies, Nodes)
              catch _:Reason ->
                      ?error("create_mnesia_tables1/3", "cause:~p", [Reason])
              end,
  
              {ok, SystemConf} = load_system_config_with_store_data(),
              ok = leo_redundant_manager_api:start(Mode, Nodes, ?env_queue_dir(leo_manager),
                                                   [{n,           SystemConf#system_conf.n},
                                                    {r,           SystemConf#system_conf.r},
                                                    {w,           SystemConf#system_conf.w},
                                                    {d,           SystemConf#system_conf.d},
                                                    {bit_of_ring, SystemConf#system_conf.bit_of_ring}]),
              ok;
          {error,{_,{already_exists, _}}} ->
              create_mnesia_tables2(Mode, Nodes);
          {_, Cause} ->
              timer:apply_after(?CHECK_INTERVAL, ?MODULE, create_mnesia_tables, [Mode, [RedundantNode0]]),
              ?error("create_mnesia_tables1/3", "cause:~p", [Cause]),
              {error, Cause}
      end;
  create_mnesia_tables1(slave = Mode, _, Nodes) ->
      create_mnesia_tables2(Mode, Nodes).
  
  
  -spec(create_mnesia_tables2(manster | slave, list()) ->
               ok | {error, any()}).
  create_mnesia_tables2(Mode, Nodes) ->
      application:start(mnesia),
      timer:sleep(1000),
  
      case catch mnesia:system_info(tables) of
          Tbls when length(Tbls) > 1 ->
              ok = mnesia:wait_for_tables(Tbls, 30000),
  
              case leo_manager_mnesia:get_system_config() of
                  {ok, SystemConf} ->
                      ok = leo_redundant_manager_api:start(Mode, Nodes, ?env_queue_dir(leo_manager),
                                                           [{n,           SystemConf#system_conf.n},
                                                            {r,           SystemConf#system_conf.r},
                                                            {w,           SystemConf#system_conf.w},
                                                            {d,           SystemConf#system_conf.d},
                                                            {bit_of_ring, SystemConf#system_conf.bit_of_ring}]);
                  Error ->
                      ?error("create_mnesia_tables2/2", "cause:~p", [Error]),
                      Error
              end;
          Tbls when length(Tbls) =< 1 ->
              {error, no_exists};
          Error ->
  
negative.code:     ListenPort     = ?env_listening_port(leo_manager),
      NumOfAcceptors = ?env_num_of_acceptors(leo_manager),
      Mode           = ?env_mode_of_manager(),
  
      [RedundantNodes0|_] = ?env_partner_of_manager_node(),
      RedundantNodes1     = [{Mode, node()},
                             {'partner', case is_atom(RedundantNodes0) of
                                             true  -> RedundantNodes0;
                                             false -> list_to_atom(RedundantNodes0)
                                         end}],
  
      case supervisor:start_link({local, ?MODULE}, ?MODULE,
                                 [#tcp_server_params{port = ListenPort,
  