Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
mariadb
Commits
dbe2fe25
Commit
dbe2fe25
authored
Nov 12, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GTID configuration through CWMP
parent
4e47fb66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
Makefile
Makefile
+3
-0
mariadb
mariadb
+45
-0
wsrep-init
wsrep-init
+14
-0
No files found.
Makefile
View file @
dbe2fe25
...
...
@@ -145,6 +145,9 @@ define MARIADB_CONFIG
config
wsrep
'galera'
option
cluster_address
''
option
cluster_options
''
option
server_id
''
option
wsrep_gtid_domain_id
''
option
gtid_domain_id
''
endef
export
MARIADB_CONFIG
...
...
mariadb
View file @
dbe2fe25
...
...
@@ -20,6 +20,9 @@ entry_execute_method_root_MySQL() {
common_execute_method_param
"
$DMROOT
.MySQL.GaleraBootstrap"
"1"
""
"mysql_galera_bootstrap"
"xsd:boolean"
common_execute_method_param
"
$DMROOT
.MySQL.GaleraClusterAddress"
"1"
"mysql_get_cluster_address"
"mysql_set_cluster_address"
common_execute_method_param
"
$DMROOT
.MySQL.GaleraClusterOptions"
"1"
"mysql_get_cluster_options"
"mysql_set_cluster_options"
common_execute_method_param
"
$DMROOT
.MySQL.ServerID"
"1"
"mysql_get_server_id"
"mysql_set_server_id"
common_execute_method_param
"
$DMROOT
.MySQL.WSREPGTIDdomainID"
"1"
"mysql_get_wsrep_gtid_domain_id"
"mysql_set_wsrep_gtid_domain_id"
common_execute_method_param
"
$DMROOT
.MySQL.GTIDdomainID"
"1"
"mysql_get_gtid_domain_id"
"mysql_set_gtid_domain_id"
return
0
;
;;
esac
...
...
@@ -96,3 +99,45 @@ mysql_set_cluster_options() {
systemctl restart mariadb
fi
}
mysql_get_server_id
()
{
echo
`
$UCI_GET
mariadb.galera.server_id
`
}
mysql_set_server_id
()
{
local
server_id
=
`
$UCI_GET
mariadb.galera.server_id
`
if
[
"
$server_id
"
!=
"
$1
"
]
;
then
$UCI_SET
mariadb.galera.server_id
=
"
$1
"
$UCI_COMMIT
wsrep-init
systemctl restart mariadb
fi
}
mysql_get_wsrep_gtid_domain_id
()
{
echo
`
$UCI_GET
mariadb.galera.wsrep_gtid_domain_id
`
}
mysql_set_wsrep_gtid_domain_id
()
{
local
wsrep_gtid_domain_id
=
`
$UCI_GET
mariadb.galera.wsrep_gtid_domain_id
`
if
[
"
$wsrep_gtid_domain_id
"
!=
"
$1
"
]
;
then
$UCI_SET
mariadb.galera.wsrep_gtid_domain_id
=
"
$1
"
$UCI_COMMIT
wsrep-init
systemctl restart mariadb
fi
}
mysql_get_gtid_domain_id
()
{
echo
`
$UCI_GET
mariadb.galera.gtid_domain_id
`
}
mysql_set_gtid_domain_id
()
{
local
gtid_domain_id
=
`
$UCI_GET
mariadb.galera.gtid_domain_id
`
if
[
"
$gtid_domain_id
"
!=
"
$1
"
]
;
then
$UCI_SET
mariadb.galera.gtid_domain_id
=
"
$1
"
$UCI_COMMIT
wsrep-init
systemctl restart mariadb
fi
}
wsrep-init
View file @
dbe2fe25
...
...
@@ -4,6 +4,9 @@ UCI_GET="/sbin/uci -q get"
ADDRESS
=
`
$UCI_GET
mariadb.galera.cluster_address
`
OPTIONS
=
`
$UCI_GET
mariadb.galera.cluster_options
`
SERVER_ID
=
`
$UCI_GET
mariadb.galera.server_id
`
WSREP_GTID
=
`
$UCI_GET
mariadb.galera.wsrep_gtid_domain_id
`
GTID
=
`
$UCI_GET
mariadb.galera.gtid_domain_id
`
if
[
!
-z
$ADDRESS
]
;
then
cat
<<
EOF
> /run/mysqld/wsrep.conf
[mysqld]
...
...
@@ -17,6 +20,17 @@ EOF
if
[
!
-z
"
$OPTIONS
"
]
;
then
echo
"wsrep_provider_options =
$OPTIONS
"
>>
/run/mysqld/wsrep.conf
fi
if
[
!
-z
"
$SERVER_ID
"
]
;
then
echo
"server_id =
$SERVER_ID
"
>>
/run/mysqld/wsrep.conf
fi
if
[
!
-z
"
$WSREP_GTID
"
]
;
then
echo
"wsrep_gtid_mode = ON"
>>
/run/mysqld/wsrep.conf
echo
"wsrep_gtid_domain_id =
$WSREP_GTID
"
>>
/run/mysqld/wsrep.conf
echo
"log_slave_updates = ON"
>>
/run/mysqld/wsrep.conf
fi
if
[
!
-z
"
$GTID
"
]
;
then
echo
"gtid_domain_id =
$GTID
"
>>
/run/mysqld/wsrep.conf
fi
chown
mysql.mysql /run/mysqld/wsrep.conf
else
rm
-f
/run/mysqld/wsrep.conf
...
...
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