Bug 230302 - databases/mariadb103-server port over galera_new_cluster and galera_recovery scripts
Summary: databases/mariadb103-server port over galera_new_cluster and galera_recovery ...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Bernard Spil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-02 19:43 UTC by Vincent Milum Jr
Modified: 2020-07-24 18:43 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (brnrd)


Attachments
galera_new_cluster and galera_recovery scripts from Debian (4.60 KB, text/plain)
2018-08-02 19:43 UTC, Vincent Milum Jr
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Milum Jr 2018-08-02 19:43:33 UTC
Created attachment 195772 [details]
galera_new_cluster and galera_recovery scripts from Debian

The official Debian (and possible other OS) packages for MariaDB 10.x include a pair of scripts to help with managing Galera clusters. These would be handy for the FreeBSD port, since there appears to be no other officially documented way to bootstrap a Galera cluster with the FreeBSD binaries. 

Alternatively, some OSes have the "service mysql bootstrap" command, but there is no "service mysql-server bootstrap" command on the FreeBSD port.

The official docs for MariaDB also list "mysqld --wsrep-new-cluster" as the direct method to start a new cluster, however FreeBSD only has the mysqld_safe binary, and not mysqld (it works the same way, but will be confusing to new users)

More details at: https://mariadb.com/kb/en/library/getting-started-with-mariadb-galera-cluster/
Comment 1 gnoma 2019-09-29 10:25:28 UTC
Hello, 

Workaround: 

For the bootstrap functionality I got part of the rc.d script of mysql and it works fine: 


extra_commands="bootstrap"
bootstrap_cmd="mysql_bootstrap"

mysql_bootstrap()
{
       # Bootstrap the cluster, start the first node that initiate the cluster
       check_startmsgs && echo "Bootstrapping cluster"
       shift
       command_args="$command_args --wsrep-new-cluster"
       run_rc_command ${_rc_prefix}start
}


Put this one into your /usr/local/etc/rc.d/mysql-server 

Then you can do bootstrap on your cluster with the rc.d script. 


This however has to be ported into the package.
Comment 2 Bernard Spil freebsd_committer 2020-07-24 18:43:57 UTC
Hi Vincent,

These look like useful additions, but they're ridden with Linux-isms. Can you fix these to actually work with FreeBSD? `systemctl` sounds like systemd and luckily we have none of that. /usr/sbin/mysqld is not where we will ever install the port, ...

Cheers, Bernard.