diff --git a/CMakeLists.txt b/CMakeLists.txt index 1046a30..def7f41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ PROJECT(node_mgr VERSION 1.0) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) -set(CMAKE_BUILD_TYPE "Debug") +#set(CMAKE_BUILD_TYPE "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -DENABLE_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -DENABLE_DEBUG") diff --git a/resource/node_mgr.cnf b/resource/node_mgr.cnf index 52a72b8..b674393 100644 --- a/resource/node_mgr.cnf +++ b/resource/node_mgr.cnf @@ -25,7 +25,7 @@ statement_retry_interval_ms = 1000 # Log verbosity or amount of details, options are(in increasing details): # {ERROR, WARNING, INFO, LOG, DEBUG1, DEBUG2, DEBUG3}. -log_verbosity = INFO +#log_verbosity = INFO # 100MB, if log grows larger than this it's rotated max_log_file_size = 100 @@ -43,10 +43,10 @@ node_mgr_tmp_data_path = ../data # for meta # meta data server listening port -meta_port = 58100 +#meta_port = 58100 # meta data server ip address -meta_host = 192.168.0.128 +#meta_host = 192.168.0.128 # meta data server user account meta_user = pgx diff --git a/resource/util/backup b/resource/util/backup new file mode 100755 index 0000000..6001480 Binary files /dev/null and b/resource/util/backup differ diff --git a/resource/util/lz4 b/resource/util/lz4 new file mode 100755 index 0000000..e3f7a28 Binary files /dev/null and b/resource/util/lz4 differ diff --git a/resource/util/pv b/resource/util/pv new file mode 100755 index 0000000..b24d056 Binary files /dev/null and b/resource/util/pv differ diff --git a/resource/util/restore b/resource/util/restore new file mode 100755 index 0000000..eb969f1 Binary files /dev/null and b/resource/util/restore differ diff --git a/resource/util/tablecatchup b/resource/util/tablecatchup index 23f3fef..2ef05da 100755 Binary files a/resource/util/tablecatchup and b/resource/util/tablecatchup differ diff --git a/resource/util/xbstream b/resource/util/xbstream new file mode 100755 index 0000000..cfd1bf6 Binary files /dev/null and b/resource/util/xbstream differ diff --git a/resource/util/xtrabackup b/resource/util/xtrabackup new file mode 100644 index 0000000..e69de29 diff --git a/src/install_task/mysql_install_dealer.cc b/src/install_task/mysql_install_dealer.cc index 55c5459..c3041b0 100644 --- a/src/install_task/mysql_install_dealer.cc +++ b/src/install_task/mysql_install_dealer.cc @@ -72,6 +72,11 @@ bool MySQLInstallDealer::constructCommand() { std::string command_name = para_json["command_name"].asString(); std::string port = para_json["port"].asString(); exporter_port_ = para_json["exporter_port"].asString(); + std::string mgr_port = para_json["mgr_port"].asString(); + std::string xport = para_json["xport"].asString(); + std::string mgr_seed = para_json["mgr_seed"].asString(); + std::string mgr_uuid = para_json["mgr_uuid"].asString(); + std::string is_master = para_json["is_master"].asString(); std::string innodb_buffer_size_M = para_json["innodb_buffer_size_M"].asString(); std::string db_cfg = para_json["db_cfg"].asString(); @@ -80,16 +85,16 @@ bool MySQLInstallDealer::constructCommand() { "%s/kunlun_install_%s.log", kunlun::GetBasePath(program_binaries_path).c_str(), port.c_str()); execute_command_ = kunlun::string_sprintf( - "%s/%s/dba_tools/%s --port=%s --innodb_buffer_poll_size_M=%s " + "%s/%s/dba_tools/%s --port=%s --mgr_port=%s --xport=%s --innodb_buffer_poll_size_M=%s " "--datadir_prefix=%s --logdir_prefix=%s --waldir_prefix=%s " - "--install_prefix=%s/storage --user=%s --bind_address=%s --db_cfg=%s " + "--install_prefix=%s/storage --user=%s --bind_address=%s --mgr_seed=%s --db_cfg=%s --uuid=%s --is_master=%s " "--prog_name=%s >> %s ", program_binaries_path.c_str(), storage_prog_package_name.c_str(), - command_name.c_str(), port.c_str(), innodb_buffer_size_M.c_str(), + command_name.c_str(), port.c_str(), mgr_port.c_str(), xport.c_str(), innodb_buffer_size_M.c_str(), data_prefix_.c_str(), log_prefix_.c_str(), wal_prefix_.c_str(), instance_binaries_path.c_str(), - kunlun::getCurrentProcessOwnerName().c_str(), local_ip.c_str(), - db_cfg.c_str(), storage_prog_package_name.c_str(), install_log.c_str()); + kunlun::getCurrentProcessOwnerName().c_str(), local_ip.c_str(), mgr_seed.c_str(), + db_cfg.c_str(), mgr_uuid.c_str(), is_master.c_str(), storage_prog_package_name.c_str(), install_log.c_str()); return true; } diff --git a/src/install_task/mysql_uninstall_dealer.cc b/src/install_task/mysql_uninstall_dealer.cc index 0f6f789..b3d1e80 100644 --- a/src/install_task/mysql_uninstall_dealer.cc +++ b/src/install_task/mysql_uninstall_dealer.cc @@ -71,6 +71,8 @@ bool MySQLUninstallDealer::constructCommand() { Json::Value para_json = json_root_["paras"]; std::string command_name = para_json["command_name"].asString(); std::string port = para_json["port"].asString(); + std::string mgr_port = para_json["mgr_port"].asString(); + std::string xport = para_json["xport"].asString(); std::string innodb_buffer_size_M = para_json["innodb_buffer_size_M"].asString(); // fetch related directory prefix from Metadata cluster @@ -78,12 +80,12 @@ bool MySQLUninstallDealer::constructCommand() { "%s/kunlun_install.log", kunlun::GetBasePath(program_binaries_path).c_str()); execute_command_ = kunlun::string_sprintf( - "%s/%s/dba_tools/%s --port=%s --innodb_buffer_poll_size_M=%s " + "%s/%s/dba_tools/%s --port=%s --mgr_port=%s --xport=%s --innodb_buffer_poll_size_M=%s " "--datadir_prefix=%s --logdir_prefix=%s --waldir_prefix=%s " "--install_prefix=%s/storage --user=%s --bind_address=%s --prog_name=%s " ">> %s ", program_binaries_path.c_str(), storage_prog_package_name.c_str(), - command_name.c_str(), port.c_str(), innodb_buffer_size_M.c_str(), + command_name.c_str(), port.c_str(), mgr_port.c_str(), xport.c_str(), innodb_buffer_size_M.c_str(), data_prefix_.c_str(), log_prefix_.c_str(), wal_prefix_.c_str(), instance_binaries_path.c_str(), kunlun::getCurrentProcessOwnerName().c_str(), local_ip.c_str(),