1) Ambari MetaStore 설정은 MySQL로 진행
cd ~
wget <https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm>
# (-i : 설치, -v : 상세항목 확인, -h : 패키지를 설치할 때 # 표시출력
sudo rpm -ivh mysql57-community-release-el7-11.noarch.rpm
# mysql-community-server 설치
yum -y install mysql-community-server
# (아래 에러 발생시에만 실행하고 다시 mysql-community-server 설치)
# "The GPG keys listed for the "MySQL 5.7 Community Server"
# repository are already installed but they are not correct for this package.
# Check that the correct key URLs are configured for this repository."
# 라는 에러가 발생하면 새로운 GPG-KEY를 발급받는다
rpm --import <https://repo.mysql.com/RPM-GPG-KEY-mysql-2022>
#mysql 서비스 시작
systemctl start mysqld
#mysql 서비스 허용
systemctl enable mysqld
# mysql 임시 비밀번호 가져오기
awk '/temporary password/{print $11}' /var/log/mysqld.log
# mysql 접속확인
mysql -u root -p {임시비밀번호}
# 접속 종료
exit
# /etc/my.cnf 파일에 아래 설정 추가.
# mysql 비밀번호 간소화, UTF8 설정.
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
#비밀번호 관련 보안 설정.
validate_password-policy=LOW
validate_password-length=4
# mysql 재시작
sudo systemctl restart mysqld
# mysql 접속
mysql -u root -p
Enter password : {임시비밀번호}
# 비밀번호 변경
ALTER USER "root"@"localhost" IDENTIFIED BY "root";
# 재접속
exit
mysql -u root -p
Enter password : "root"
# database 생성.
create database ambari;
create database hive;
# ambari 계정 생성 (hive 계정생성은 하지 않아도 된다.)
create user 'ambari'@'localhost' identified by 'ambari';
create user 'ambari'@'%' identified by 'ambari';
grant all privileges on *.* to 'ambari'@'localhost' identified by 'ambari' with grant option;
grant all privileges on *.* to 'ambari'@'%' identified by 'ambari' with grant option;
flush privileges;
# hive 계정 생성
create user 'hive'@'localhost' identified by 'hive';
create user 'hive'@'%' identified by 'hive';
grant all privileges on *.* to 'hive'@'localhost' identified by 'hive' with grant option;
grant all privileges on *.* to 'hive'@'%' identified by 'hive' with grant option;
flush privileges;
# ambari meta table 생성
use ambari;
SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
# mysql jdbc 커넥터 설치
sudo yum install -y mysql-connector-java*
# mysql 커넥터 경로 설정
sudo ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
# mpack 설치: 이것이 있어야 ambari 설치시에 필요한 Hadoop ecosystem stack(BGTP)이 등록 된다
sudo ambari-server install-mpack --mpack=/usr/lib/bigtop-ambari-mpack/bgtp-ambari-mpack-1.0.0.0-SNAPSHOT-bgtp-ambari-mpack.tar.gz --verbose
# ambari server 셋업
sudo ambari-server setup
# ambari server 시작
sudo ambari-server start