Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
c7f0d9a6
Commit
c7f0d9a6
authored
Feb 26, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update mysql repl script
parent
0af35eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
mysql_repl_restore.sh
auth/mysql_repl_restore.sh
+11
-2
No files found.
auth/mysql_repl_restore.sh
View file @
c7f0d9a6
...
...
@@ -29,14 +29,23 @@ if [ "$1" = "--status" ] ; then
exit
fi
if
[
"$"
!=
"--force"
]
;
then
echo
"Call LAV before run this script. 28.11.2015"
exit
fi
mysqldump
--routines
-h
mysql.auth
-p
$PASSWD
mail
>
mail-dump.sql
mycommand
"stop slave"
mycommand
"reset slave"
myrcommand
"show master status
\G
"
#mycommand "show slave status\G"
POSITION
=
$(
myrcommand
"show master status
\G
"
|
grep
"Position:"
|
sed
-e
"s|.*Position: ||g"
)
MASTERFILE
=
/var/lib/mysql/db/
$(
myrcommand
"show master status
\G
"
|
grep
"File:"
|
sed
-e
"s|.*File: ||g"
)
# file name only
MASTERFILE
=
$(
myrcommand
"show master status
\G
"
|
grep
"File:"
|
sed
-e
"s|.*File: ||g"
)
mysql mail
-p
$PASSWD
<mail-dump.sql
#mycommand "CHANGE MASTER TO MASTER_LOG_FILE='$MASTERFILE', MASTER_LOG_POS=$POSITION"
mycommand
"CHANGE MASTER TO MASTER_LOG_POS=
$POSITION
"
#mycommand "CHANGE MASTER TO MASTER_LOG_POS=$POSITION"
# TODO: use special user for replication
mycommand
"CHANGE MASTER TO MASTER_HOST='mysql.auth', MASTER_PORT=3306, MASTER_USER='root', MASTER_PASSWORD='
$PASSWD
', MASTER_LOG_FILE='
$MASTERFILE
', MASTER_LOG_POS=
$POSITION
"
mycommand
"start slave"
mycommand
"show slave status
\G
"
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