1. Install command
yum -y install mariadb-server mariadb
2. Go mariadb database
Password for mysql -u root -p // first log is empty
3. Modify the database password mariadb
update user set password=password('sugar') where user='root';
4. Set the root user can log in from any host, have access to any library and table
grant all privileges on *.* to root@'%' identified by 'sugar';
grant all privileges on *.* to root@'sugar01' identified by 'sugar';
grant all privileges on *.* to root@'localhost' identified by 'sugar';
flush privileges;
5. Modify mariadb address database, real cluster nodes need to set
1. Stop Service
systemctl stop mariadb.service
2. Copy the original configuration of the disk tray outside the system (for example a / data01)
cp /var/lib/mysql/ /data01/
3. Back up the original settings
mv /var/lib/mysql /var/lib/mysql.bak
4. Modify your disk permissions in folder
chown -R mysql:mysql /data01/mysql
5. Create a soft link
ln -s /data01/mysql/ /var/lib/mysql
6. Restart mariadb
systemctl start mariadb
6. Set character encoding UTF-8 (if necessary)
1. Check the default encoding
show variables like 'character%';
show variables like 'collation_%';
2. Modify coding
1. Back up configuration files
cp /etc/my.cnf /etc/my.cnf.bak
2. modify the configuration file
we /etc/my.cnf
Inserts charater_set_server = utf8
3. Restart the database
systemctl restart mariadb
4. Re-log in to view the character encoding
show variables like 'character%';
show variables like 'collation_%';
7. All nodes installed driver mysql-connector-java
yum -y install mysql-connector-java
Path after the installation is /usr/share/java/mysql-connector-java.jar
8. install other dependencies
yum -y install psmisc
yum -y install perl
yum -y install nfs-utils portmap
systemctl start rpcbind
system enable rpcbind
9. Create a database and user
Subsequent need to use components of the database, also created together here. Here create hive, amon, hue, monitor and oozie
Log database, execute the following statement
Note include the host name changed to its own host name
create database hive default charset utf8 collate utf8_general_ci;
create user 'hive'@'sugar01' identified by 'hive';
grant all privileges on hive.* to 'hive'@'sugar01';
flush privileges;