rhel 7

I need a HA MariaDB Server

VM NEtwork

VirtualBox -> Preferences -> Network

Create a Host Only Network

Note IP Address is in the range of 10.0.20.1/24

VM

  • New VM
  • Have 2 Network
    • NAT
    • Host Only Network
  • Add RHEL 7_1 Iso file

Build

In the Network Option

  • 1st NIC card - DHCP
  • 2nd NIC card
    • 10.0.2.20/24
    • gw 10.0.2.20
  • hostname
    • mariadb1.com

Defaults for everything else

User: tim Pass: ducati

Add ssh Server

When the machine reboots - I add the RHEL Disk - and install the ssh Server

Copy MariaDB Config into

From my Mac - I already have the mariaDB RPM and yum configs

scp tim@<MAC IP Address>:~/Downloads/maria_db/* .

I unpack - move the files and then when I do a yum list available I can see the mariaDb files

We now need the RHEL ISO

We are in a Black Screen Server in the VirtualBox - so I use the BlackScreen interface and at the top select

  • Optical Drives
    • RHEL_71

To access this

mkdir  /media/ISO
mount -t iso9660 /dev/cdrom /media/ISO

Now make a repo yum file

[rhel71]
name=rhel 71
baseurl=file:///media/ISO/
enabled=1
gpgcheck=0

Again check that the Report is available

yum list available

Disable the Internet connection

I want to make sure I am not using any new files

As I have 2 NIC cards - I disable the first one (the NAT)

ifdown enp0s3

To Check

ping www.google.com

FAILS :)

Disable the Firewall

I just want to temporary disable the firewall

systemctl stop firewalld

This will restart when the server is rebooted.

Install MAriaDb-Server & Client

As we are in a priv account the command is

yum install Mariadb-Server MariaDb-Client

Configure the database

Simple script

select User,Host from mysql.user;

DROP USER 'tim'@'localhost';
DROP USER 'tim'@'10.0.2.%';

CREATE USER 'tim'@'localhost' IDENTIFIED BY 'ducati';
CREATE USER 'tim'@'10.0.2.%' IDENTIFIED BY 'ducati';
GRANT ALL PRIVILEGES ON *.* TO 'tim'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'tim'@'10.0.2.%' WITH GRANT OPTION;

CREATE database if not exists Bob;
use Bob;
drop table if exists Person;
create table Person(Name Varchar(20), Title Varchar(20), age Integer);
insert into Person values ('tim','Mr',21);
insert into Person values ('shabib','Sheik',20);
commit;

Check

  • MariaDB Is running
  • Firewalld stopped
  • localhost works
  • 10.0.2.20 works

All these Work !!!

I Now edit the MariaDB Server connection and make it listen only on the public port.

HA Time