Mariadb-10.1yum Installation Method

Source: Internet
Author: User
Tags gpg

Mariadb-yum Warehouse Construction Method:

Related Reference sites:

http://yum.mariadb.org/

https://mariadb.com/kb/en/mariadb/yum/

MariaDB 10.X

CENTOS6 Repo

# MariaDB 10.1 CentOS repository list-created 2015-11-20 14:01 UTC

# http://mariadb.org/mariadb/repositories/

[MARIADB]

Name = MariaDB

BaseURL = Http://yum.mariadb.org/10.1/centos6-amd64

Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb

Gpgcheck=1

Centos7 Repo

[MARIADB]

Name = MariaDB

BaseURL = Http://yum.mariadb.org/10.1/centos7-amd64

Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb

Gpgcheck=1

MariaDB 5.X

CENTOS6 Repo

[MARIADB]

Name = MariaDB-5.5.39

baseurl=https://downloads.mariadb.com/files/mariadb/mariadb-5.5.39/yum/rhel6-amd64/

# alternative:baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/

Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb

Gpgcheck=1

installation MariaDB 10.1

Yum Install Mariadb-server mariadb-client-y

Initialize the database:

/usr/bin/mysql_install_db--datadir=/data/mysql--user=mysql

Configuration parameters:

Vim/etc/my.cnf.d/server.cnf

[Mysqld]

Server-id = 1

DataDir =/data/mysql

Log_error =/data/mysql/err.log

Log_bin = Mysql-bin

Slow_query_log = On

Slow_query_log_file =/data/mysql/slow.log

Long_query_time = 2

Skip-name-resolve

Lower_case_table_names = 1

innodb_file_per_table = 1

Back_log = 50

max_connections = 2000

Max_connect_errors = 1000000

Thread_cache_size = 128

Table_open_cache = 2048

Max_allowed_packet = 1G

Binlog_cache_size = 8M

Character_set_server = UTF8

Innodb_data_file_path = Ibdata1:10m;ibdata2:10m:autoextend

innodb_thread_concurrency = 0

Innodb_read_io_threads = 10

Innodb_write_io_threads = 10

Innodb_flush_method=o_direct

Innodb_buffer_pool_size = 400M

Innodb_log_file_size = 100M

Innodb_log_buffer_size = 16M

Innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 60

Innodb_lock_wait_timeout = 60

Log_bin_trust_function_creators = 1

Innodb_flush_log_at_trx_commit = 2

Innodb_locks_unsafe_for_binlog = 1

#innodb_log_group_home_dir =

[Galera]

# Mandatory Settings

Wsrep_on=on

#wsrep_provider =

Wsrep_provider =/usr/lib64/galera/libgalera_smm.so

wsrep_cluster_address= ' gcomm://192.168.0.241:4567,192.168.0.243:4567 '

Binlog_format=row

Default_storage_engine=innodb

innodb_autoinc_lock_mode=2

Wsrep_retry_autocommit = 0

Wsrep_provider_options= "gcache.size=200m; base_port=4567; gcache.page_size=100m "

Wsrep_slave_threads=4

Wsrep_cluster_name= ' Mysql_db_cluster '

wsrep_node_address= ' 192.168.0.242 '

Wsrep_provider_options= "base_port=4567;"

Wsrep_node_name= ' Test2 '

wsrep_sst_method= rsync

Wsrep_sst_auth= "Sst:[email protected]"

# Allow server to accept connections on all interfaces.

bind-address=0.0.0.0

start the first database:192.168.0.241

/etc/init.d/mysql start--wsrep-new-cluster

Note: When you start the first database in a cluster, you must add the parameters --wsrep-new-cluster

start multiple databases in turn:192.168.0.242 192.168.0.243

/etc/init.d/mysql Start --wsrep_cluster_address=gcomm://192.168.0.241

Note: When you start multiple databases sequentially, you need to add parameters --wsrep_cluster_address and specify an IP address to join the cluster

When all databases in the cluster are shut down after the first database is started:

need to add --wsrep-new-cluster selection

No additional parameters need to be added for other cluster nodes to start when one database is not shut down in the cluster

Note: Shutting down the database must be off gracefully or the database may not start

To view cluster status:

mysql>show status like ' wsrep% ' ;

Faults encountered during initial start-up:

[ERROR] innodb:auto-extending data file./ibdata1 is an different size 640 pages (rounded down to MB) than Specifi Ed in the. CNF file:initial 768 pages, max 0 (relevant if non-zero) pages!

Cause of the problem:

the system automatically establishes several files ibdata1,ib_logfile0,ib_logfile1 when initializing the database

in the configuration file due to configuration:Innodb_data_file_path = Ibdata1:10m;ibdata2:10m:autoextend, followed by ibdata1 at initialization caused by inconsistent size.

the default ibdata1 size is 8M, and I'm configuring 10Mhere, which is the causeof the problem

Workaround:

in MySQL 's data directory, delete ibdata1,ib_logfile0,ib_logfile1;

after restarting MySQL, the system will generate the ibdata file again according to the configuration

This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1923077

Mariadb-10.1yum Installation Method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.