MARIADB galera Cluster One-click installation script

Source: Internet
Author: User

#!/bin/bash

# Author:laocao

# date:2016/05/03

# revision:1.0



if [!-F "/etc/yum.repos.d/mariadb.repo"];then

echo "[mariadb]" >>/etc/yum.repos.d/mariadb.repo

echo "name = MariaDB" >>/etc/yum.repos.d/mariadb.repo

echo "BaseURL = Http://yum.mariadb.org/10.0/centos6-amd64" >>/etc/yum.repos.d/mariadb.repo

echo "enabled = 1" >>/etc/yum.repos.d/mariadb.repo

echo "GPGKEY=HTTPS://YUM.MARIADB.ORG/RPM-GPG-KEY-MARIADB" >>/etc/yum.repos.d/mariadb.repo

echo "Gpgcheck=1" >>/etc/yum.repos.d/mariadb.repo

Echo-e "\033[32m add mariadb yum repo successflly \033[0m"

Yum Makecache

Else

Echo-e "\033[31m Mariadb.repo has exist! Noting to do \033[0m "

Fi


echo ""

echo "###### #install mariadb-galera-server galera mariadb-client#######"

Yum-y Install Mariadb-galera-server Galera mariadb-client

Echo-e "\033[32m Install MariaDB success \033[0m"


echo ""

if [!-d/data/dbdata];then

Mkdir/data/dbdata

Mkdir/data/binlog

Chown-r Mysql.mysql/data/dbdata

Chown-r Mysql.mysql/data/binlog

Echo-e "\033[32m Create dbdata and Binlog directories successflly! \033[0m "

Else

Echo-e "\033[31m/data/dbdata has exist! Noting to do \033[0m "

Fi


echo ""

Echo ' # # # #mysql_install_db # #

mysql_install_db--user=mysql--datadir=/data/dbdata

Echo-e "\033[32m mysql_install_db has completed \033[0m"


echo ""

ECHO-E "\033[31m You need copy wsref.cnf to/etc/my.cnf.d/\033[0m"

Echo-e "\033[31m You can start database manually \033[0m"


MARIADB galera Cluster One-click installation script

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.