Commit e9aca3b6 authored by 温海元's avatar 温海元

modify 4.96 to 1.15

parent ad4a492a
...@@ -6,8 +6,8 @@ sync_config_folder=/home/quant_group/db_sync_configs ...@@ -6,8 +6,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder=/home/quant_group/daily_db_backup db_backup_folder=/home/quant_group/daily_db_backup
source_db_host=$1 source_db_host=$1
source_db_user=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/username` source_db_user=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/username`
source_db_pwd=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/passwd` source_db_pwd=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/passwd`
target_db_host=192.168.6.2 target_db_host=192.168.6.2
target_db_port=3306 target_db_port=3306
...@@ -48,7 +48,7 @@ function db_schema_sync() ...@@ -48,7 +48,7 @@ function db_schema_sync()
# sh $work_dir/db_import.sh $database $target_db_host $db_backup_sub_folders $target_db_port # sh $work_dir/db_import.sh $database $target_db_host $db_backup_sub_folders $target_db_port
} }
database_list=`curl -s http://192.168.4.3:10088/config_server/get_db_config/all/name` database_list=`curl -s http://172.29.1.15:10088/config_server/get_db_config/all/name`
echo "database_list:${database_list}" echo "database_list:${database_list}"
for db_name in $database_list for db_name in $database_list
......
...@@ -44,7 +44,7 @@ cache_dir=/home/quant_group/daily_db_backup ...@@ -44,7 +44,7 @@ cache_dir=/home/quant_group/daily_db_backup
# fi # fi
echo "prepare to get source_port" echo "prepare to get source_port"
conf=(`curl -s http://192.168.4.3:10088/config_server/get_db_config/$database_name/all`) conf=(`curl -s http://172.29.1.15:10088/config_server/get_db_config/$database_name/all`)
source_db_host=${conf[0]} source_db_host=${conf[0]}
port=${conf[1]} port=${conf[1]}
source_db_user=${conf[2]} source_db_user=${conf[2]}
......
...@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs ...@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder=/home/quant_group/db_backups db_backup_folder=/home/quant_group/db_backups
source_db_host=$1 source_db_host=$1
source_db_user=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/username` source_db_user=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/username`
source_db_pwd=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/passwd` source_db_pwd=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/passwd`
ip_value=$4 ip_value=$4
...@@ -56,6 +56,7 @@ do ...@@ -56,6 +56,7 @@ do
echo >&1000 echo >&1000
done done
target_db_host=`sh $pwd_path/get-ip.sh $ip_value` target_db_host=`sh $pwd_path/get-ip.sh $ip_value`
function db_schema_sync() function db_schema_sync()
...@@ -120,7 +121,7 @@ function run_sql_file() ...@@ -120,7 +121,7 @@ function run_sql_file()
} }
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2` # database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
database_list=`curl -s http://192.168.4.3:10088/config_server/get_db_config/all/name` database_list=`curl -s http://172.29.1.15:10088/config_server/get_db_config/all/name`
if [[ "$sync_db_name" = "all" ]];then if [[ "$sync_db_name" = "all" ]];then
echo "sync all database schema" echo "sync all database schema"
......
...@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs ...@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder=/home/quant_group/db_backups db_backup_folder=/home/quant_group/db_backups
source_db_host=$1 source_db_host=$1
source_db_user=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/username` source_db_user=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/username`
source_db_pwd=`curl -s http://192.168.4.3:10088/config_server/get_db_config/xyqb/passwd` source_db_pwd=`curl -s http://172.29.1.15:10088/config_server/get_db_config/xyqb/passwd`
ip_value=$4 ip_value=$4
...@@ -120,7 +120,7 @@ function run_sql_file() ...@@ -120,7 +120,7 @@ function run_sql_file()
} }
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2` # database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
database_list=`curl -s http://192.168.4.3:10088/config_server/get_db_config/all/name` database_list=`curl -s http://172.29.1.15:10088/config_server/get_db_config/all/name`
if [[ "$sync_db_name" = "all" ]];then if [[ "$sync_db_name" = "all" ]];then
echo "sync all database schema" echo "sync all database schema"
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
dbs=`curl http://192.168.4.3:10088/config_server/get_db_config/all/name` dbs=`curl http://192.168.4.3:10088/config_server/get_db_config/all/name`
for db in $dbs for db in $dbs
do do
sql_command=`curl http://192.168.4.3:10088/config_server/get_db_dump_command/${db}/opt` sql_command=`curl http://172.29.1.15:10088/config_server/get_db_dump_command/${db}/opt`
table_opt="mysqldump --opt $sql_command > /tmp/${db}_opt.sql" table_opt="mysqldump --opt $sql_command > /tmp/${db}_opt.sql"
echo "$table_opt" echo "$table_opt"
eval $table_opt eval $table_opt
mysql -h 192.168.6.2 -P 3306 -uqa -pqatest db < /tmp/${db}_opt.sql mysql -h 192.168.6.2 -P 3306 -uqa -pqatest db < /tmp/${db}_opt.sql
sql_tables=`curl http://192.168.4.3:10088/config_server/get_db_dump_command/${db}/table` sql_tables=`curl http://172.29.1.15:10088/config_server/get_db_dump_command/${db}/table`
if [[ sql_tables == '' ]];then if [[ sql_tables == '' ]];then
echo "这个数据库没有基础数据需要同步" echo "这个数据库没有基础数据需要同步"
else else
......
...@@ -25,7 +25,7 @@ if [[ $target_ip == "ALL" ]]; then ...@@ -25,7 +25,7 @@ if [[ $target_ip == "ALL" ]]; then
send \"mkdir -p $script_path\r\" send \"mkdir -p $script_path\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"mount -t nfs 192.168.4.3:$script_path $script_path\r\" send \"mount -t nfs 172.29.1.15:$script_path $script_path\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"umount -l $config_files\\ \r\" send \"umount -l $config_files\\ \r\"
...@@ -37,7 +37,7 @@ if [[ $target_ip == "ALL" ]]; then ...@@ -37,7 +37,7 @@ if [[ $target_ip == "ALL" ]]; then
send \"mkdir $config_files\r\" send \"mkdir $config_files\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${IP_host}/ $config_files\r\" send \"mount -t nfs 172.29.1.15:/home/sub_config_file_dont_rm/${IP_host}/ $config_files\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
...@@ -54,7 +54,7 @@ else ...@@ -54,7 +54,7 @@ else
send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\" send \"mkdir -p /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script\r\" send \"mount -t nfs 172.29.1.15:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"umount -l $config_files\r\" send \"umount -l $config_files\r\"
...@@ -66,7 +66,7 @@ else ...@@ -66,7 +66,7 @@ else
send \"mkdir $config_files\r\" send \"mkdir $config_files\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"mount -t nfs 192.168.4.3:/home/sub_config_file_dont_rm/${target_host}/ $config_files\r\" send \"mount -t nfs 172.29.1.15:/home/sub_config_file_dont_rm/${target_host}/ $config_files\r\"
set timeout -1 set timeout -1
expect \"]#\" expect \"]#\"
send \"exit\r\" send \"exit\r\"
......
dongmeifeng|192.168.4.78|32093|32093 tower|192.168.4.78|30886|30084 zhangbo|192.168.4.77|31091|32056 wangfei|192.168.4.77|32389|31374 renmingxing|192.168.4.78|30169|32509 songruili|192.168.4.18|32355|30265 yiwei|192.168.4.77|30352|30286 lishuang|192.168.4.77|30011|31185 chenyadong|192.168.4.77|30384|32523 chenxingchun|192.168.4.33|30445|30583 yanxiaoyu|192.168.4.18|32116|30133 cloner|192.168.6.9|32566|32560 c2|192.168.6.8|30492|31481 withdb|192.168.6.9|30321|30896 base|192.168.6.9|31440|32685 dbtest|192.168.6.9|31669|31647 ggggg|192.168.6.9|30451|32069 |192.168.6.9|| kube-system|192.168.6.9|32747|31034 yangchunlian|192.168.4.32|31460|31452 dongmeifeng|192.168.4.78|32093|32093 tower|192.168.4.78|30886|30084 zhangbo|192.168.4.77|31091|32056 wangfei|192.168.4.77|32389|31374 renmingxing|192.168.4.78|30169|32509 songruili|192.168.4.18|32355|30265 yiwei|192.168.4.77|30352|30286 lishuang|192.168.4.77|30011|31185 chenyadong|192.168.4.77|30384|32523 chenxingchun|172.29.1.153|30445|30583 yanxiaoyu|192.168.4.18|32116|30133 cloner|192.168.6.9|32566|32560 c2|192.168.6.8|30492|31481 withdb|192.168.6.9|30321|30896 base|192.168.6.9|31440|32685 dbtest|192.168.6.9|31669|31647 ggggg|192.168.6.9|30451|32069 |192.168.6.9|| kube-system|192.168.6.9|32747|31034 yangchunlian|172.29.1.152|31460|31452
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment