赞
踩
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
Systemctl start mysqld
Grep “password” /var/log/mysqld.log
Alter user user() identified by ‘admin123’;
# 在[mysqld]下添加
collation_server=utf8_general_ci
character_set_server=utf8
default-storage-engine=INNODB
# 在[client]下添加(如果没有[client],则创建)
default_character-set=utf8
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
mysql> create database ambari character set utf8;
Query OK, 1 row affected (5.00 sec)
mysql> CREATE USER 'ambari'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> create database hive character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'hive'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> create database oozie character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'oozie'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> create database ranger character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'rangeradmin'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ranger.* TO 'rangeradmin'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Yum -y install httpd
Systemctl start httpd
[root@localhost yum.repos.d]# cat ambari.repo
# VERSION_NUMBER=2.7.3.0-139
[ambari-2.7.3.0]
# json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
name=ambari Version - ambari-2.7.3.0
baseurl=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139
gpgcheck=1
gpgkey=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[root@localhost yum.repos.d]# cat HDP.repo # VERSION_NUMBER=3.1.0.0-78 [HDP-3.1.0.0] name=HDP Version - HDP-3.1.0.0 baseurl=http://172.16.10.119/hdp/HDP/centos7 gpgcheck=1 gpgkey=http://172.16.10.119/hdp/HDP/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 [HDP-UTILS-1.1.0.22] name=HDP-UTILS Version - HDP-UTILS-1.1.0.22 baseurl=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22 gpgcheck=1 gpgkey=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 [HDP-GPL-3.1.0.0] name=HDP-UTILS Version - HDP-GPL-3.1.0.0 baseurl=http://172.16.10.119/hdp/HDP-GPL gpgcheck=1 gpgkey=http://172.16.10.119/hdp/HDP-GPL/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
Mkdir /var/www/html/ambari
Mkdir /var/www/html/hdp
tar -zxvf ambari-2.7.3.0-centos7.tar.gz -C /var/www/html/ambari/
tar -zxvf HDP-3.1.0.0-centos7-rpm.tar.gz -C /var/www/html/hdp/
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.22/
tar -zxf HDP-GPL-3.1.0.0-centos7-gpl.tar.gz -C /var/www/html/hdp/
createrepo /var/www/html/hdp/HDP/centos7/
createrepo /var/www/html/hdp/HDP-UTILS-1.1.0.22/
createrepo /var/www/html/hdp/HDP-GPL/
Scp ambari.repo HDP.repo root@172.16.10.106:/etc/yum.repo.d/
Scp ambari.repo HDP.repo root@172.16.10.107:/etc/yum.repo.d/
ssh-keygen -t rsa
ssh-copy-id -i root@172.16.10.105
ssh-copy-id -i root@172.16.10.106
ssh-copy-id -i root@172.16.10.107
Cat /etc/hosts
172.16.10.119 yum yum.hdp
172.16.10.105 nd-00 nd-00.hdp
172.16.10.106 nd-01 nd-01.hdp
172.16.10.107 nd-02 nd-02.hdp
Hostnamectl set-hostname nd-00.hdp
cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=nd-00.hdp
tar -zxf jdk-8u171-linux-x64.tar.gz -C /data/java
tee -a /etc/profile.d/java.sh <<EOF
export JAVA_HOME=/data/java/jdk1.8.0_171
export JRE_HOME=/data/java/jdk1.8.0_171/jre
export PATH=$PATH:/data/java/jdk1.8.0_171/bin
export CLASSPATH=./:/data/java/jdk1.8.0_171/lib:/data/java/jdk1.8.0_171/jre/lib
EOF
Source /etc/profile.d/java.sh
mv mysql-connector-java-8.0.5.jar /usr/share/java/mysql-connector-java.jar
yum -y install ambari-server
Ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root):root # 用户 Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Custom JDK ============================================================================== Enter choice (1): 2 # 选择自定义jdk WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts. WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts. Path to JAVA_HOME: /data/java/jdk1.8.0_171 # jdk安装路径 Validating JDK on Ambari Server...done. Check JDK version for Ambari Server... JDK version found: 8 Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server. Checking GPL software agreement... GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? y Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y Configuring database... ============================================================================== Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ============================================================================== Enter choice (1): 3 # 选择安装的mysql Hostname (localhost): nd-00 # 配置hostname Port (3306): # 默认 Database name (ambari): Username (ambari): Enter Database Password (bigdata): # 密码不显示 Re-enter password: Configuring ambari database... Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? y Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql # 此处需注意,启动ambari之前需要执行此句 Proceed with configuring remote database connection properties [y/n] (y)? y Extracting system views... ambari-admin-2.7.3.0.139.jar .... Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully. # 安装成功
Mysql -uambari -p
Use ambari
Source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
Ambari-server start
Yum -y install ambari-server
Ambari-agent start
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。