Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

CM Path B, MySQL

1. Launch instance from image.

1.5. Enable repos if disabled

---#Refer centos repo move script

2. Install MySQL

# MYSQL For MYSQL Instance


# Make sure you are in the root folder of Centos user

sudo yum install yum-utils -y


wget https://dev.mysql.com/get/mysql80-community-release-el6-3.noarch.rpm
sudo rpm -Uvh mysql80-community-release-el6-3.noarch.rpm
yum repolist all | grep mysql
sudo yum-config-manager --disable mysql80-community
sudo yum-config-manager --enable mysql56-community
sudo yum install mysql-community-server -y
sudo service mysqld start

NOTE:
Do not use the yum install command to install the MySQL driver package,
because it installs openJDK, and then uses the Linux alternatives command to set
the system JDK to be openJDK.
And several other reasons

sudo /usr/bin/mysql_secure_installation
[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
All done!

# to check if secure mysql is installed properly


mysql -u root -p

3. Creating databases for CM/CDH Services

create database hive DEFAULT CHARACTER SET utf8;


grant all on hive.* TO 'hive'@'%' IDENTIFIED BY 'P@ssw0rd';

create database hue DEFAULT CHARACTER SET utf8;


grant all on hue.* TO 'hue'@'%' IDENTIFIED BY 'P@ssw0rd';

create database rman DEFAULT CHARACTER SET utf8;


grant all on rman.* TO 'rman'@'%' IDENTIFIED BY 'P@ssw0rd';
create database navs DEFAULT CHARACTER SET utf8;
grant all on navs.* TO 'navs'@'%' IDENTIFIED BY 'P@ssw0rd';

create database navms DEFAULT CHARACTER SET utf8;


grant all on navms.* TO 'navms'@'%' IDENTIFIED BY 'P@ssw0rd';

create database oozie DEFAULT CHARACTER SET utf8;


grant all on oozie.* TO 'oozie'@'%' IDENTIFIED BY 'P@ssw0rd';

create database amon DEFAULT CHARACTER SET utf8;


grant all on amon.* TO 'amon'@'%' IDENTIFIED BY 'P@ssw0rd';

create database sentry DEFAULT CHARACTER SET utf8;


grant all on sentry.* TO 'sentry'@'%' IDENTIFIED BY 'P@ssw0rd';

create database metastore DEFAULT CHARACTER SET utf8;


grant all on metastore.* TO 'metastore'@'%' IDENTIFIED BY 'P@ssw0rd';

4. Create a temporary root user to create SCM database and user.

grant all on *.* to 'temp'@'%' identified by 'P@ssw0rd' with grant option;

5. Refer naya b script

6. Remove the temp user after scm server databases is configured and connected

drop user 'temp'@'%';

7. Refer naya b script for further steps

Thank me later ;)

Pratyush

Last edited on October 05, 2020

You might also like