hhorak/mariadb-wrapper
Project ID: 12778
Description
This is a testing repository with rh-mariadb101 Software Collection, which includes a new feature (sub-package) to make the server available system-wide (without using scl enable). It is a proof-of-concept which I'd like to get some more feedback to.
Installation Instructions
You can still use the rh-mariadb101 as normal SCL. The following examples show how to enable MariaDB 10.1 SCL as system-wide package and then get back again.
Install the package SCL from this copr:
#> curl https://copr.fedorainfracloud.org/coprs/hhorak/mariadb-wrapper/repo/epel-7/hhorak-mariadb-wrapper-epel-7.repo >/etc/yum.repos.d/hhorak-mariadb-wrapper-epel-7.repo
#> yum install rh-mariadb101
At this point the package is available as normal Software Collection, i.e. it does not influence the system:
$> mysql
bash: mysql: command not found
#> systemctl status mariadb
Unit mariadb.service could not be found.
Install rh-mariadb101-mariadb-system-wide:
#> yum install rh-mariadb101-mariadb-system-wide
And you can now use the MariaDB 10.1 Software Collection as it would be normal package:
#> service mariadb start
#> service mariadb status
● rh-mariadb101-mariadb.service - MariaDB 10.1 database server
Loaded: loaded (/usr/lib/systemd/system/rh-mariadb101-mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2017-03-19 21:19:37 EDT; 8min ago
Process: 1896 ExecStartPost=/usr/bin/scl enable $RH_MARIADB101_SCLS_ENABLED -- /opt/rh/rh-mariadb101/root/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
...
#> service rh-mariadb101-mariadb status
● rh-mariadb101-mariadb.service - MariaDB 10.1 database server
Loaded: loaded (/usr/lib/systemd/system/rh-mariadb101-mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2017-03-19 21:19:37 EDT; 8min ago
Process: 1896 ExecStartPost=/usr/bin/scl enable $RH_MARIADB101_SCLS_ENABLED -- /opt/rh/rh-mariadb101/root/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
...
#> echo "select @@version;" | mysql
@@version
10.1.19-MariaDB
#> mysql_upgrade --force
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
...
#> less /etc/rh-mariadb101-my.cnf
#> less /etc/rh-mariadb101-my.cnf.d/mariadb-server.cnf
#> ls /var/lib/rh-mariadb101/
aria_log.00000001 aria_log_control ibdata1 ib_logfile0 ib_logfile1 multi-master.info mysql ...
#> tail -n 4 /var/log/rh-mariadb101/mariadb.log
2017-03-19 21:19:37 139729498236672 [Note] InnoDB: Dumping buffer pool(s) not yet started
2017-03-19 21:19:37 139730319116480 [Note] Server socket created on IP: '::'.
2017-03-19 21:19:37 139730319116480 [Note] /opt/rh/rh-mariadb101/root/usr/libexec/mysqld: ready for connections.
Version: '10.1.19-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
Obviously installing the mariadb or mariadb-server packages from the base system will result in conflict now. But IMO it is safe and transparent way to tell users what is going on.
#> yum install mariadb
...
Transaction check error:
file /usr/bin/aria_chk from install of mariadb-1:5.5.52-1.el7.x86_64 conflicts with file from package rh-mariadb101-mariadb-system-wide-1:10.1.19-7.el7.centos.x86_64
file /usr/bin/aria_dump_log from install of mariadb-1:5.5.52-1.el7.x86_64 conflicts with file from package rh-mariadb101-mariadb-system-wide-1:10.1.19-7.el7.centos.x86_64
...
Getting back to standard
When you want to make your installation again isolated from the system, removing the rh-mariadb101-mariadb-system-wide package allows you to do that:
#> yum remove rh-mariadb101-mariadb-system-wide
The service was not interrupted:
#> systemctl status rh-mariadb101-mariadb.service
● rh-mariadb101-mariadb.service - MariaDB 10.1 database server
Loaded: loaded (/usr/lib/systemd/system/rh-mariadb101-mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2017-03-20 04:48:10 EDT; 2min 58s ago
...
Now you can also install the mariadb or mariadb-server packages from the base system, without conflicts:
#> yum install mariadb mariadb-server
Further thoughts
I was thinking about separating the client tools and server tools into rh-mariadb101-mariadb-system-wide-client and rh-mariadb101-mariadb-system-wide-server, so user would be for example able to run the client tools from the base system, but server from SCL. However, there is no strict line which tools are meant to be client only and which server only, plus the tools might use each other. So, it might cause troubles in the end, which is reason why I decided to come only with one subpackage and users will either use both server and client tools system-wide or none of them.
Obviously, client library (libmysqlclient.so) does not conflict with the SCL even when the system-wide package is installed, so it can be installed for the other depended packages without any issue.
I'm looking for any feedback, let me know what you think!
Active Releases
The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla).
Release | Architectures | Repo Download |
---|---|---|
EPEL 6 | x86_64 (85)* | EPEL 6 (0 downloads) |
EPEL 7 | x86_64 [modified] (89)* | EPEL 7 (422 downloads) |
* Total number of downloaded packages.