MariaDB 10.5 - add replication to existing installation
When I try to add replication to an existing installation, mariadb refuses to start (I'm a novice at MariaDB). This is on RHEL 9. This is my server.cnf: # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ # # this is read by the standalone daemon and embedded servers [server] # this is only for the mysqld standalone daemon # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mysqld/mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mariadb/mariadb.log pid-file=/run/mariadb/mariadb.pid # next stuff copied from the original zabbix 5 server.cnf default-storage-engine=innodb innodb_autoinc_lock_mode=2 innodb_buffer_pool_size=1GB innodb_doublewrite=1 innodb_file_per_table=1 innodb_flush_method = O_DIRECT innodb_log_file_size=128M long_query_time=1 max-allowed-packet=16M max_connections=800 max_heap_table_size=256M performance_schema=on query_cache_size=0 query_cache_type=0 slow_query_log=1 slow_query_log_file=/var/lib/mysql/slowlog/mysql-slow.log thread-cache-size=50 tmp_table_size=512M # # * Galera-related settings # [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0 # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb] # This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.5] # server-id=1 log_bin = /var/log/mysql/mysql-bin.log log_bin_index =/var/log/mysql/mysql-bin.log.index relay_log = /var/log/mysql/mysql-relay-bin relay_log_index = /var/log/mysql/mysql-relay-bin.index The error I get is: # systemctl status mariadb × mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2024-11-11 16:31:02 MST; 12min ago Duration: 2h 35min 21.402s Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 426050 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 426072 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE) CPU: 281ms Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: the maria-discuss email list at https://launchpad.net/~maria-discuss Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: Please check all of the above before submitting a bug report Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: at https://mariadb.org/jira Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database failed. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Perhaps /etc/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database was not finished successfully. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Files created so far will be removed. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAILURE Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Failed with result 'exit-code'. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: Failed to start MariaDB 10.5 database server.
Are there any obvious errors in: /var/log/mariadb/mariadb.log ? Are your SELinux contexts and ownership correct on /var/lib/mysql and /var/log/mysql? On Tue, Nov 12, 2024 at 6:10 PM Dan O'Reilly via discuss <discuss@lists.mariadb.org> wrote:
When I try to add replication to an existing installation, mariadb refuses to start (I'm a novice at MariaDB). This is on RHEL 9.
This is my server.cnf:
# These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ #
# this is read by the standalone daemon and embedded servers [server]
# this is only for the mysqld standalone daemon # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mysqld/mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mariadb/mariadb.log pid-file=/run/mariadb/mariadb.pid
# next stuff copied from the original zabbix 5 server.cnf
default-storage-engine=innodb innodb_autoinc_lock_mode=2 innodb_buffer_pool_size=1GB innodb_doublewrite=1 innodb_file_per_table=1 innodb_flush_method = O_DIRECT innodb_log_file_size=128M long_query_time=1 max-allowed-packet=16M max_connections=800 max_heap_table_size=256M performance_schema=on query_cache_size=0 query_cache_type=0 slow_query_log=1 slow_query_log_file=/var/lib/mysql/slowlog/mysql-slow.log thread-cache-size=50 tmp_table_size=512M
# # * Galera-related settings # [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0
# this is only for embedded server [embedded]
# This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb]
# This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.5]
# server-id=1 log_bin = /var/log/mysql/mysql-bin.log log_bin_index =/var/log/mysql/mysql-bin.log.index relay_log = /var/log/mysql/mysql-relay-bin relay_log_index = /var/log/mysql/mysql-relay-bin.index
The error I get is:
# systemctl status mariadb × mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2024-11-11 16:31:02 MST; 12min ago Duration: 2h 35min 21.402s Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 426050 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 426072 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE) CPU: 281ms
Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: the maria-discuss email list at https://launchpad.net/~maria-discuss Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: Please check all of the above before submitting a bug report Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: at https://mariadb.org/jira Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database failed. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Perhaps /etc/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database was not finished successfully. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Files created so far will be removed. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAILURE Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Failed with result 'exit-code'. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: Failed to start MariaDB 10.5 database server. _______________________________________________ discuss mailing list -- discuss@lists.mariadb.org To unsubscribe send an email to discuss-leave@lists.mariadb.org
AAAARG! Wrong owner on /var/log/mysql directory. Changed it to mysql:mysql all is OK. Thanks for your time! On Tue, Nov 12, 2024 at 9:16 AM Gordan Bobic <gordan.bobic@gmail.com> wrote:
Are there any obvious errors in: /var/log/mariadb/mariadb.log ?
Are your SELinux contexts and ownership correct on /var/lib/mysql and /var/log/mysql?
On Tue, Nov 12, 2024 at 6:10 PM Dan O'Reilly via discuss <discuss@lists.mariadb.org> wrote:
When I try to add replication to an existing installation, mariadb refuses to start (I'm a novice at MariaDB). This is on RHEL 9.
This is my server.cnf:
# These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ #
# this is read by the standalone daemon and embedded servers [server]
# this is only for the mysqld standalone daemon # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mysqld/mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mariadb/mariadb.log pid-file=/run/mariadb/mariadb.pid
# next stuff copied from the original zabbix 5 server.cnf
default-storage-engine=innodb innodb_autoinc_lock_mode=2 innodb_buffer_pool_size=1GB innodb_doublewrite=1 innodb_file_per_table=1 innodb_flush_method = O_DIRECT innodb_log_file_size=128M long_query_time=1 max-allowed-packet=16M max_connections=800 max_heap_table_size=256M performance_schema=on query_cache_size=0 query_cache_type=0 slow_query_log=1 slow_query_log_file=/var/lib/mysql/slowlog/mysql-slow.log thread-cache-size=50 tmp_table_size=512M
# # * Galera-related settings # [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0
# this is only for embedded server [embedded]
# This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb]
# This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.5]
# server-id=1 log_bin = /var/log/mysql/mysql-bin.log log_bin_index =/var/log/mysql/mysql-bin.log.index relay_log = /var/log/mysql/mysql-relay-bin relay_log_index = /var/log/mysql/mysql-relay-bin.index
The error I get is:
# systemctl status mariadb × mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2024-11-11 16:31:02 MST; 12min ago Duration: 2h 35min 21.402s Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 426050 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 426072 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE) CPU: 281ms
Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: the maria-discuss email list at https://launchpad.net/~maria-discuss Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: Please check all of the above before submitting a bug report Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: at https://mariadb.org/jira Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database failed. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Perhaps /etc/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database was not finished successfully. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Files created so far will be removed. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAILURE Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Failed with result 'exit-code'. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: Failed to start MariaDB 10.5 database server. _______________________________________________ discuss mailing list -- discuss@lists.mariadb.org To unsubscribe send an email to discuss-leave@lists.mariadb.org
If you want systemctl status mariadb.service and journalctl -u mariadb.service to contain useful information recommend removing log-error=/var/log/mariadb/mariadb.log This will save you troubles of log rotation on this file and make everything just in a standard way for your OS. On Wed, 13 Nov 2024 at 04:55, Dan O'Reilly via discuss <discuss@lists.mariadb.org> wrote:
AAAARG! Wrong owner on /var/log/mysql directory. Changed it to mysql:mysql all is OK. Thanks for your time!
On Tue, Nov 12, 2024 at 9:16 AM Gordan Bobic <gordan.bobic@gmail.com> wrote:
Are there any obvious errors in: /var/log/mariadb/mariadb.log ?
Are your SELinux contexts and ownership correct on /var/lib/mysql and /var/log/mysql?
On Tue, Nov 12, 2024 at 6:10 PM Dan O'Reilly via discuss <discuss@lists.mariadb.org> wrote:
When I try to add replication to an existing installation, mariadb refuses to start (I'm a novice at MariaDB). This is on RHEL 9.
This is my server.cnf:
# These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # # See the examples of server my.cnf files in /usr/share/mysql/ #
# this is read by the standalone daemon and embedded servers [server]
# this is only for the mysqld standalone daemon # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mysqld/mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock log-error=/var/log/mariadb/mariadb.log pid-file=/run/mariadb/mariadb.pid
# next stuff copied from the original zabbix 5 server.cnf
default-storage-engine=innodb innodb_autoinc_lock_mode=2 innodb_buffer_pool_size=1GB innodb_doublewrite=1 innodb_file_per_table=1 innodb_flush_method = O_DIRECT innodb_log_file_size=128M long_query_time=1 max-allowed-packet=16M max_connections=800 max_heap_table_size=256M performance_schema=on query_cache_size=0 query_cache_type=0 slow_query_log=1 slow_query_log_file=/var/lib/mysql/slowlog/mysql-slow.log thread-cache-size=50 tmp_table_size=512M
# # * Galera-related settings # [galera] # Mandatory settings #wsrep_on=ON #wsrep_provider= #wsrep_cluster_address= #binlog_format=row #default_storage_engine=InnoDB #innodb_autoinc_lock_mode=2 # # Allow server to accept connections on all interfaces. # bind-address=0.0.0.0 # # Optional setting #wsrep_slave_threads=1 #innodb_flush_log_at_trx_commit=0
# this is only for embedded server [embedded]
# This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadb]
# This group is only read by MariaDB-10.5 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-10.5]
# server-id=1 log_bin = /var/log/mysql/mysql-bin.log log_bin_index =/var/log/mysql/mysql-bin.log.index relay_log = /var/log/mysql/mysql-relay-bin relay_log_index = /var/log/mysql/mysql-relay-bin.index
The error I get is:
# systemctl status mariadb × mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2024-11-11 16:31:02 MST; 12min ago Duration: 2h 35min 21.402s Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 426050 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 426072 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=1/FAILURE) CPU: 281ms
Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: the maria-discuss email list at https://launchpad.net/~maria-discuss Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: Please check all of the above before submitting a bug report Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426111]: at https://mariadb.org/jira Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database failed. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Perhaps /etc/my.cnf is misconfigured or there is some problem with permissions of /var/lib/mysql. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Initialization of MariaDB database was not finished successfully. Nov 11 16:31:02 tmv1zbdb01 mariadb-prepare-db-dir[426072]: Files created so far will be removed. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAILURE Nov 11 16:31:02 tmv1zbdb01 systemd[1]: mariadb.service: Failed with result 'exit-code'. Nov 11 16:31:02 tmv1zbdb01 systemd[1]: Failed to start MariaDB 10.5 database server. _______________________________________________ discuss mailing list -- discuss@lists.mariadb.org To unsubscribe send an email to discuss-leave@lists.mariadb.org
_______________________________________________ discuss mailing list -- discuss@lists.mariadb.org To unsubscribe send an email to discuss-leave@lists.mariadb.org
participants (3)
-
Dan O'Reilly
-
Daniel Black
-
Gordan Bobic