Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
e9aca3b6
Commit
e9aca3b6
authored
May 10, 2021
by
温海元
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify 4.96 to 1.15
parent
ad4a492a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
17 deletions
+18
-17
daily_db_backup.sh
db-utils/daily_db_backup.sh
+3
-3
db_gen_config.sh
db-utils/db_gen_config.sh
+1
-1
db_schema_sync.sh
db-utils/db_schema_sync.sh
+4
-3
db_schema_sync_why.sh
db-utils/db_schema_sync_why.sh
+3
-3
dump.sh
db-utils/dump.sh
+2
-2
1_mount_config_files.sh
qa_shell_script/1_mount_config_files.sh
+4
-4
docker_env_name.sh
qa_shell_script/trash/ngrok/docker_env_name.sh
+1
-1
No files found.
db-utils/daily_db_backup.sh
View file @
e9aca3b6
...
...
@@ -6,8 +6,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder
=
/home/quant_group/daily_db_backup
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/passwd
`
source_db_user
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/passwd
`
target_db_host
=
192.168.6.2
target_db_port
=
3306
...
...
@@ -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
}
database_list
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/all/name
`
database_list
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/all/name
`
echo
"database_list:
${
database_list
}
"
for
db_name
in
$database_list
...
...
db-utils/db_gen_config.sh
View file @
e9aca3b6
...
...
@@ -44,7 +44,7 @@ cache_dir=/home/quant_group/daily_db_backup
# fi
echo
"prepare to get source_port"
conf
=(
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/
$database_name
/all
`
)
conf
=(
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/
$database_name
/all
`
)
source_db_host
=
${
conf
[0]
}
port
=
${
conf
[1]
}
source_db_user
=
${
conf
[2]
}
...
...
db-utils/db_schema_sync.sh
View file @
e9aca3b6
...
...
@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder
=
/home/quant_group/db_backups
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/passwd
`
source_db_user
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/passwd
`
ip_value
=
$4
...
...
@@ -56,6 +56,7 @@ do
echo
>
&1000
done
target_db_host
=
`
sh
$pwd_path
/get-ip.sh
$ip_value
`
function
db_schema_sync
()
...
...
@@ -120,7 +121,7 @@ function run_sql_file()
}
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
database_list
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/all/name
`
database_list
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/all/name
`
if
[[
"
$sync_db_name
"
=
"all"
]]
;
then
echo
"sync all database schema"
...
...
db-utils/db_schema_sync_why.sh
View file @
e9aca3b6
...
...
@@ -29,8 +29,8 @@ sync_config_folder=/home/quant_group/db_sync_configs
db_backup_folder
=
/home/quant_group/db_backups
source_db_host
=
$1
source_db_user
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/xyqb/passwd
`
source_db_user
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/username
`
source_db_pwd
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/xyqb/passwd
`
ip_value
=
$4
...
...
@@ -120,7 +120,7 @@ function run_sql_file()
}
# database_list=`grep database_list $work_dir/config/db_config | cut -d "=" -f 2`
database_list
=
`
curl
-s
http://1
92.168.4.3
:10088/config_server/get_db_config/all/name
`
database_list
=
`
curl
-s
http://1
72.29.1.15
:10088/config_server/get_db_config/all/name
`
if
[[
"
$sync_db_name
"
=
"all"
]]
;
then
echo
"sync all database schema"
...
...
db-utils/dump.sh
View file @
e9aca3b6
...
...
@@ -2,14 +2,14 @@
dbs
=
`
curl http://192.168.4.3:10088/config_server/get_db_config/all/name
`
for
db
in
$dbs
do
sql_command
=
`
curl http://1
92.168.4.3
:10088/config_server/get_db_dump_command/
${
db
}
/opt
`
sql_command
=
`
curl http://1
72.29.1.15
:10088/config_server/get_db_dump_command/
${
db
}
/opt
`
table_opt
=
"mysqldump --opt
$sql_command
> /tmp/
${
db
}
_opt.sql"
echo
"
$table_opt
"
eval
$table_opt
mysql
-h
192.168.6.2
-P
3306
-uqa
-pqatest
db < /tmp/
${
db
}
_opt.sql
sql_tables
=
`
curl http://1
92.168.4.3
:10088/config_server/get_db_dump_command/
${
db
}
/table
`
sql_tables
=
`
curl http://1
72.29.1.15
:10088/config_server/get_db_dump_command/
${
db
}
/table
`
if
[[
sql_tables
==
''
]]
;
then
echo
"这个数据库没有基础数据需要同步"
else
...
...
qa_shell_script/1_mount_config_files.sh
View file @
e9aca3b6
...
...
@@ -25,7 +25,7 @@ if [[ $target_ip == "ALL" ]]; then
send
\"
mkdir -p
$script_path
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
mount -t nfs 1
92.168.4.3
:
$script_path
$script_path
\r\"
send
\"
mount -t nfs 1
72.29.1.15
:
$script_path
$script_path
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
umount -l
$config_files
\\
\r\"
...
...
@@ -37,7 +37,7 @@ if [[ $target_ip == "ALL" ]]; then
send
\"
mkdir
$config_files
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
mount -t nfs 1
92.168.4.3
:/home/sub_config_file_dont_rm/
${
IP_host
}
/
$config_files
\r\"
send
\"
mount -t nfs 1
72.29.1.15
:/home/sub_config_file_dont_rm/
${
IP_host
}
/
$config_files
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
exit
\r\"
...
...
@@ -54,7 +54,7 @@ else
send
\"
mkdir -p /home/qa-deploy-utils/qa_shell_script
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
mount -t nfs 1
92.168.4.3
:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script
\r\"
send
\"
mount -t nfs 1
72.29.1.15
:/home/qa-deploy-utils/qa_shell_script /home/qa-deploy-utils/qa_shell_script
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
umount -l
$config_files
\r\"
...
...
@@ -66,7 +66,7 @@ else
send
\"
mkdir
$config_files
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
mount -t nfs 1
92.168.4.3
:/home/sub_config_file_dont_rm/
${
target_host
}
/
$config_files
\r\"
send
\"
mount -t nfs 1
72.29.1.15
:/home/sub_config_file_dont_rm/
${
target_host
}
/
$config_files
\r\"
set timeout -1
expect
\"
]#
\"
send
\"
exit
\r\"
...
...
qa_shell_script/trash/ngrok/docker_env_name.sh
View file @
e9aca3b6
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|1
92.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.3
2|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|1
72.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.15
2|31460|31452
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment