Skip to content

1.2 MariaDB configuration.md

couplewith edited this page Mar 29, 2017 · 1 revision

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


[root@Stage-Mysql02 DBMS]# cat /etc/my.cnf.d/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
[mysqld]

#   UTF8 SECTION
#character-set-server = utf8
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
#collation-server=utf8_general_ci


lower_case_table_names=1

user            = mysql
pid-file        = /var/run/mysql/mysql.pid
socket          = /var/run/mysql/mysql.sock
port            = 3306
basedir         = /usr
datadir         = /DATABASE/MyData

plugin_dir      = /usr/lib64/mysql/plugin
tmpdir          = /tmp
#language       = /usr/share/mysql/english
lc-messages-dir = /usr/share/mysql

skip-external-locking

log-error           = /DATABASE/MyData/mysql-error.log
general_log_file    = /DATABASE/MyData/mysql-general.log
general_log         = 1

# Slow Query-------------------
slow_query_log
long_query_time = 20
slow_query_log_file = /DATABASE/MyData/mysql-slowquery.log
log-output=FILE
#log-output=FILE,TABLE

#log-bin=mysql-bin
log-bin=/DATABASE/MyLogs/MyDb-bin
binlog_format=ROW
sync_binlog=1
max_binlog_size = 1024M
expire_logs_days = 20

#----------------------------------------------------------
#* back_log is the number of connections the operating system can keep in
back_log = 1000
max_connections = 400
max_connect_errors = 200
table_open_cache = 2048

max_allowed_packet = 200M

#        * cache to hold the SQL statements for the binary log for tranaction
binlog_cache_size = 2M

#        * size for a single HEAP (in memory) table
max_heap_table_size = 64M

#        * size for a internal (in-memory) temporary tables.
tmp_table_size = 64M

#        * used for doing full table scans.
read_buffer_size = 8M

#        * reading rows in sorted order after a sort
read_rnd_buffer_size = 16M

#        * perform sorts for some ORDER BY and GROUP BY SQL
sort_buffer_size = 16M

#        *used for the optimization of full JOINs (JOINs without indexes)
join_buffer_size = 16M


#        *should keep in a cache for reuse.
thread_cache_size = 8
# thread_concurrency = 8   #derprecated
thread_stack = 240K

query_cache_size = 64M
query_cache_limit = 2M


ft_min_word_len = 2
ft_max_word_len = 20
ft_stopword_file = /etc/my.cnf.d/stopwords.ko


#default-storage-engine = MYISAM

# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE
transaction_isolation = REPEATABLE-READ

#*** MyISAM Specific options
#--------------------------------------
key_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 100M
myisam_repair_threads = 1

# OFF DEFAULT BACKUP FORCE
myisam-recover-options=BACKUP



#
# * 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.1 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.1]


[root@Stage-Mysql02 DBMS]# cat /etc/my.cnf.d/galera.cnf
[galera]

wsrep_on = ON

wsrep_cluster_name = "stg_maria_cluster"
wsrep_node_name=Mysql02
wsrep_node_address=172.25.5.31
wsrep_cluster_address = 'gcomm://172.25.5.30,172.25.5.31,172.25.5.32'
wsrep_retry_autocommit= 0

wsrep_sst_method = rsync
wsrep_data_home_dir = /DATABASE/WSREP_Data

wsrep_provider=/usr/lib64/galera/libgalera_smm.so
#wsrep_provider_options="pc.bootstrap=true;pc.ignore_sb=no;ist.recv_addr=172.25.5.31;gmcast.listen_addr=tcp://0.0.0.0:4567"
#wsrep_provider_options="gcs.fc_limit=500; gcs.fc_master_slave=YES; gcs.fc_factor=1.0";
wsrep_provider_options="gcache.dir=/tmp;gcache.page_size=128M;gcs.fc_limit=500; gcs.fc_master_slave=YES;gcs.fc_factor=1.0"

wsrep_slave_threads = 16

# for experiment opts
#wsrep_replication_myisam = 1
#wsrep_receive_address = 172.25.5.30
#wsrep_replication_myisam = 1
#

# For Galera Override

innodb_autoinc_lock_mode = 1


Clone this wiki locally