dnf install iptables-arptables

vi /etc/sysconfig/network-scripts/ifcfg-ens18:0
--------------------------------------------
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=eui64
NAME=ens18
UUID=cfa4dee3-a9a8-4622-8a96-8466755f58fb
DEVICE=ens18:0
ONBOOT=yes
IPADDR=192.168.150.35
PREFIX=24
---------------------------------------------------

reboot
ip a
mkdir /etc/LVS_Vip
vi /etc/LVS_Vip/arp.sh
--------------------------------------
# LVS-Galera

VIP1="192.168.150.35"
RIP1="192.168.150.36"

arptables -A INPUT -j DROP -d $VIP1
arptables -A OUTPUT -j mangle -o ens18 -s $VIP1 --mangle-ip-s $RIP1
--------------------------------------

sh /etc/LVS_Vip/arp.sh

vi /etc/rc.d/rc.local
-----------------------------------------------
[root@mdm-db-01 network-scripts]# cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

sh /etc/LVS_Vip/arp.sh

--------------------------------------------------

 chmod +x /etc/rc.d/rc.local


systemctl enable rc-local.service
systemctl start  rc-local.service
systemctl status rc-local.service
dnf list galera* maria*
dnf install -y mariadb-server-galera
dnf list galera* maria*


vi  /etc/sysctl.conf
-----------------------------------------
net.ipv4.ip_forward = 1
net.ipv4.conf.ens18.arp_ignore = 1
net.ipv4.conf.ens18.arp_announce = 2
vm.swappiness=1

---------------------------------------------
sysctl -p

mkdir /db_data

chown mysql:mysql -R /db_data/

mv mariadb-server.cnf mariadb-server.cnf.Default
cd /etc/my.cnf
cd /etc/my.cnf.d
mv mariadb-server.cnf mariadb-server.cnf.Default
cp mariadb-server.cnf.Default  mariadb-server.cnf
vi mariadb-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
datadir=/db_data
socket=/var/lib/mysql/mysql.sock
log-error=error.log
pid-file=/run/mariadb/mariadb.pid

character_set_server=utf8
collation_server=utf8_general_ci

#
# * 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

innodb_buffer_pool_size=12G

# 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.3 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.3]

-------------------------------------------------------------




cp galera.cnf galera.cnf.Default
vi galera.cnf
 -------------------------------------------------------------
 # This file contains wsrep-related mysqld options. It should be included
# in the main MySQL configuration file.
#
# Options that need to be customized:
#  - wsrep_provider
#  - wsrep_cluster_address
#  - wsrep_sst_auth
# The rest of defaults should work out of the box.

##
## mysqld options _MANDATORY_ for correct opration of the cluster
##
[mysqld]

# (This must be substituted by wsrep_format)
binlog_format=ROW

# Currently only InnoDB storage engine is supported
default-storage-engine=innodb

# to avoid issues with 'bulk mode inserts' using autoinc
innodb_autoinc_lock_mode=2

# Override bind-address
# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST
# it will have (most likely) disastrous consequences on donor node
bind-address=0.0.0.0

##
## WSREP options
##

# Enable wsrep
wsrep_on=1

# Full path to wsrep provider library or 'none'
wsrep_provider=/usr/lib64/galera/libgalera_smm.so

# Provider specific configuration options
#wsrep_provider_options=

# Logical cluster name. Should be the same for all nodes.
wsrep_cluster_name=mdm-db-cluster

# Group communication system handle
wsrep_cluster_address=gcomm://192.168.150.36,192.168.150.37,192.168.150.38

# Human-readable node name (non-unique). Hostname by default.
wsrep_node_name=mdm-db-01

# Base replication <address|hostname>[:port] of the node.
# The values supplied will be used as defaults for state transfer receiving,
# listening ports and so on. Default: address of the first network interface.
wsrep_node_address=192.168.150.36

# Address for incoming client connections. Autodetect by default.
#wsrep_node_incoming_address=

# How many threads will process writesets from other nodes
wsrep_slave_threads=1

# DBUG options for wsrep provider
#wsrep_dbug_option

# Generate fake primary keys for non-PK tables (required for multi-master
# and parallel applying operation)
wsrep_certify_nonPK=1

# Maximum number of rows in write set
wsrep_max_ws_rows=0

# Maximum size of write set
wsrep_max_ws_size=2147483647

# to enable debug level logging, set this to 1
wsrep_debug=0

# convert locking sessions into transactions
wsrep_convert_LOCK_to_trx=0

# how many times to retry deadlocked autocommits
wsrep_retry_autocommit=1

# change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1

# retry autoinc insert, which failed for duplicate key error
wsrep_drupal_282555_workaround=0

# enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0

# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status  - new status of this node
# --uuid    - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index   - index of this node in the list
wsrep_notify_cmd=

##
## WSREP State Transfer options
##

# State Snapshot Transfer method
wsrep_sst_method=rsync

# Address which donor should send State Snapshot to.
# Should be the address of THIS node. DON'T SET IT TO DONOR ADDRESS!!!
# (SST method dependent. Defaults to the first IP of the first interface)
#wsrep_sst_receive_address=

# SST authentication string. This will be used to send SST to joining nodes.
# Depends on SST method. For mysqldump method it is root:<root password>
wsrep_sst_auth=root:

# Desired SST donor name.
#wsrep_sst_donor=

# Reject client queries when donating SST (false)
#wsrep_sst_donor_rejects_queries=0

# Protocol version to use
# wsrep_protocol_version=

 -------------------------------------------------------------
 
 
 
systemctl start mariadb
mysql -uroot -p
