CDH集群安装详细步骤——CM安装

2019-03-19  本文已影响0人  冰T弦

本文记录的是笔者在CentOS上安装CM的过程,后续通过CM的监控页面安装部署CDH集群非常方便;由于安装的时候管理员只安装了操作系统,很多东西都没有,根据个人情况,可以酌情跳过。笔者使用的用户具有sudo权限,建议大家使用root用户进行安装。另外:安装时使用的机器是可以访问公网的,因此没有下载CDH的parcel包。
1、查看是否安装java

[user@node1 ~]$ java -version
-bash: java: command not found

说明没有安装过jdk,通过yum安装jdk

[user@node1 ~]$ sudo yum install -y java-1.8.0-openjdk.x86_64

2、安装mysql

[user@node1 ~]$ rpm -qa|grep -i mysql
[user@node1 ~]$ sudo mkdir -p /data1/mysql/data
[user@node1 ~]$ wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
--2019-03-15 11:23:47--  http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm [following]
--2019-03-15 11:23:47--  https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm [following]
--2019-03-15 11:23:49--  https://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm
Resolving repo.mysql.com (repo.mysql.com)... 2.19.60.91
Connecting to repo.mysql.com (repo.mysql.com)|2.19.60.91|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9116 (8.9K) [application/x-redhat-package-manager]
Saving to: ‘mysql57-community-release-el7-8.noarch.rpm’


100%[===================================================================================================================================================>] 9,116       --.-K/s   in 0.03s   


2019-03-15 11:23:49 (287 KB/s) - ‘mysql57-community-release-el7-8.noarch.rpm’ saved [9116/9116]

[user@node1 ~]$
[user@node1 ~]$ sudo yum -y localinstall mysql57-community-release-el7-8.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Examining mysql57-community-release-el7-8.noarch.rpm: mysql57-community-release-el7-8.noarch
Marking mysql57-community-release-el7-8.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql57-community-release.noarch 0:el7-8 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================================================
Package                                            Arch                            Version                           Repository                                                        Size
=============================================================================================================================================================================================
Installing:
mysql57-community-release                          noarch                          el7-8                             /mysql57-community-release-el7-8.noarch                          8.2 k


Transaction Summary
=============================================================================================================================================================================================
Install  1 Package


Total size: 8.2 k
Installed size: 8.2 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql57-community-release-el7-8.noarch                                                                                                                                    1/1
  Verifying  : mysql57-community-release-el7-8.noarch                                                                                                                                    1/1


Installed:
  mysql57-community-release.noarch 0:el7-8                                                                                                                                                   


Complete!
[user@node1 ~]$
[user@node1 ~]$ yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64       MySQL Connectors Community           95
mysql-tools-community/x86_64            MySQL Tools Community                84
mysql57-community/x86_64                MySQL 5.7 Community Server          327
[user@node1 ~]$
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1    #这里默认安装的就是5.7版本,不需要修改
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql


[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[user@node1 ~]$ sudo yum -y install mysql-community-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.25-1.el7 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.25-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.25-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.25-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.25-1.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be obsoleted
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-5.7.2-28.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.25-1.el7 will be obsoleting
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.7.25-1.el7 will be obsoleting
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================================================
Package                                                  Arch                                Version                                   Repository                                      Size
=============================================================================================================================================================================================
Installing:
mysql-community-libs                                     x86_64                              5.7.25-1.el7                              mysql57-community                              2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
mysql-community-libs-compat                              x86_64                              5.7.25-1.el7                              mysql57-community                              2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
mysql-community-server                                   x86_64                              5.7.25-1.el7                              mysql57-community                              165 M
Installing for dependencies:
mysql-community-client                                   x86_64                              5.7.25-1.el7                              mysql57-community                               24 M
mysql-community-common                                   x86_64                              5.7.25-1.el7                              mysql57-community                              274 k


Transaction Summary
=============================================================================================================================================================================================
Install  3 Packages (+2 Dependent packages)


Total download size: 194 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql57-community/packages/mysql-community-common-5.7.25-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY kB/s | 276 kB  00:10:29 ETA
Public key for mysql-community-common-5.7.25-1.el7.x86_64.rpm is not installed
(1/5): mysql-community-common-5.7.25-1.el7.x86_64.rpm                                                                                                                 | 274 kB  00:00:01     
(2/5): mysql-community-libs-5.7.25-1.el7.x86_64.rpm                                                                                                                   | 2.2 MB  00:00:06     
(3/5): mysql-community-libs-compat-5.7.25-1.el7.x86_64.rpm                                                                                                            | 2.0 MB  00:00:05     
(4/5): mysql-community-client-5.7.25-1.el7.x86_64.rpm                                                                                                                 |  24 MB  00:00:38     
(5/5): mysql-community-server-5.7.25-1.el7.x86_64.rpm                                                                                                                 | 165 MB  00:03:39     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        853 kB/s | 194 MB  00:03:52     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
Package    : mysql57-community-release-el7-8.noarch (installed)
From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-community-common-5.7.25-1.el7.x86_64                                                                                                                                1/6
  Installing : mysql-community-libs-5.7.25-1.el7.x86_64                                                                                                                                  2/6
  Installing : mysql-community-client-5.7.25-1.el7.x86_64                                                                                                                                3/6
  Installing : mysql-community-server-5.7.25-1.el7.x86_64                                                                                                                                4/6
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
  Installing : mysql-community-libs-compat-5.7.25-1.el7.x86_64                                                                                                                           5/6
  Erasing    : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                        6/6
  Verifying  : mysql-community-libs-5.7.25-1.el7.x86_64                                                                                                                                  1/6
  Verifying  : mysql-community-common-5.7.25-1.el7.x86_64                                                                                                                                2/6
  Verifying  : mysql-community-server-5.7.25-1.el7.x86_64                                                                                                                                3/6
  Verifying  : mysql-community-client-5.7.25-1.el7.x86_64                                                                                                                                4/6
  Verifying  : mysql-community-libs-compat-5.7.25-1.el7.x86_64                                                                                                                           5/6
  Verifying  : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                        6/6


Installed:
  mysql-community-libs.x86_64 0:5.7.25-1.el7                 mysql-community-libs-compat.x86_64 0:5.7.25-1.el7                 mysql-community-server.x86_64 0:5.7.25-1.el7                


Dependency Installed:
  mysql-community-client.x86_64 0:5.7.25-1.el7                                                  mysql-community-common.x86_64 0:5.7.25-1.el7                                                 


Replaced:
  mariadb-libs.x86_64 1:5.5.56-2.el7                                                                                                                                                         


Complete!
[user@node1 ~]$ sudo systemctl start mysqld
[user@node1 ~]$ systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-03-15 11:39:54 CST; 40s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 25317 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 25241 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 25321 (mysqld)
   CGroup: /system.slice/mysqld.service
           └─25321 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
[user@node1 ~]$ sudo systemctl enable mysqld
[user@node1 ~]$ sudo systemctl daemon-reload
[user@node1 ~]$ sudo vi /etc/my.cnf


[mysqld]
datadir=/data1/mysql/data
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
skip-grant-tables   #加上这句
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

重启使配置生效。
[user@node1 ~]$ sudo systemctl restart mysqld

[user@node1 log]$ mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25 MySQL Community Server (GPL)


Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A


Database changed
mysql> update user set authentication_string=password('Abc_2019') where user='root';          
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
[user@node1 log]$ sudo vi /etc/my.cnf


[mysqld]
datadir=/data1/mysql/data
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
#skip-grant-tables
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[user@node1 log]$ sudo systemctl restart mysqld
[user@node1 log]$ mysql -uroot -pAbc_2019
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25


Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc_2019';
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A


Database changed
mysql> GRANT ALL ON *.* TO mysql@'%' IDENTIFIED BY 'Abc_2019' WITH GRANT OPTION;           
Query OK, 0 rows affected, 1 warning (0.00 sec)


mysql> GRANT ALL ON *.* TO mysql@'localhost' IDENTIFIED BY 'Abc_2019' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)


mysql>
[user@node1 my.cnf.d]$ service iptables status
Redirecting to /bin/systemctl status iptables.service
● iptables.service - IPv4 firewall with iptables
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled; vendor preset: disabled)
   Active: active (exited) since Thu 2019-02-28 13:29:29 CST; 2 weeks 0 days ago
Main PID: 818 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/iptables.service
[user@node1 my.cnf.d]$ sudo service iptables stop
Redirecting to /bin/systemctl stop iptables.service

3、下载CM

[user@node1 ~]$ mkdir /home/user/cm
[user@node1 ~]$ cd /home/user/cm
[user@node1 cm]$ wget --recursive --no-parent --no-host-directories  https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/5.16.1/RPMS
[user@node1 cm]$ wget --recursive --no-parent --no-host-directories  https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/5.16.1/repodata
[user@node1 cm]$ wget https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/cloudera-manager.repo

这里建议可以把需要下载的列表放到一个文件里,统一下载,下载完成的目录结构是下面这样子:

[user@node1 cm]$ pwd
/home/user/cm
[user@node1 cm]$ sudo tree -a
.
├── cloudera-manager.repo
├── repodata
│   ├── filelists.xml.gz
│   ├── filelists.xml.gz.asc
│   ├── other.xml.gz
│   ├── other.xml.gz.asc
│   ├── primary.xml.gz
│   ├── primary.xml.gz.asc
│   ├── repomd.xml
│   └── repomd.xml.asc
└── RPMS
    ├── noarch
    └── x86_64
        ├── cloudera-manager-agent-5.16.1-1.cm5161.p0.1.el7.x86_64.rpm
        ├── cloudera-manager-daemons-5.16.1-1.cm5161.p0.1.el7.x86_64.rpm
        ├── cloudera-manager-server-5.16.1-1.cm5161.p0.1.el7.x86_64.rpm
        ├── cloudera-manager-server-db-2-5.16.1-1.cm5161.p0.1.el7.x86_64.rpm
        ├── enterprise-debuginfo-5.16.1-1.cm5161.p0.1.el7.x86_64.rpm
        ├── jdk-6u31-linux-amd64.rpm
        └── oracle-j2sdk1.7-1.7.0+update67-1.x86_64.rpm

4 directories, 16 files
[user@node1 cm]$ 

4、配置repo文件,并将其拷贝到/etc/yum.repos.d/下

[user@node1 cm]$ vi cloudera-manager.repo

[cloudera-manager]
# Packages for Cloudera Manager, Version 5, on RedHat or CentOS 7 x86_64                  
name=Cloudera Manager
#baseurl=https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/5/
baseurl=file:///home/user/cm/
gpgkey =https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/RPM-GPG-KEY-cloudera
gpgcheck = 0

[user@node1 cm]$ sudo cp cloudera-manager.repo /etc/yum.repos.d/

5、安装CM

[user@node1 ~]$ sudo yum -y install cloudera-manager-daemons cloudera-manager-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package cloudera-manager-daemons.x86_64 0:5.16.1-1.cm5161.p0.1.el7 will be installed
---> Package cloudera-manager-server.x86_64 0:5.16.1-1.cm5161.p0.1.el7 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================================================
Package                                             Arch                              Version                                             Repository                                   Size
=============================================================================================================================================================================================
Installing:
cloudera-manager-daemons                            x86_64                            5.16.1-1.cm5161.p0.1.el7                            cloudera-manager                            753 M
cloudera-manager-server                             x86_64                            5.16.1-1.cm5161.p0.1.el7                            cloudera-manager                            8.5 k


Transaction Summary
=============================================================================================================================================================================================
Install  2 Packages


Total download size: 753 M
Installed size: 935 M
Downloading packages:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        511 MB/s | 753 MB  00:00:01     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cloudera-manager-daemons-5.16.1-1.cm5161.p0.1.el7.x86_64                                                                                                                  1/2
  Installing : cloudera-manager-server-5.16.1-1.cm5161.p0.1.el7.x86_64                                                                                                                   2/2
  Verifying  : cloudera-manager-server-5.16.1-1.cm5161.p0.1.el7.x86_64                                                                                                                   1/2
  Verifying  : cloudera-manager-daemons-5.16.1-1.cm5161.p0.1.el7.x86_64                                                                                                                  2/2


Installed:
  cloudera-manager-daemons.x86_64 0:5.16.1-1.cm5161.p0.1.el7                                    cloudera-manager-server.x86_64 0:5.16.1-1.cm5161.p0.1.el7                                   


Complete!

6、下载mysqsl jdbc 并解压

[user@node1 ~]$ wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.15.tar.gz
--2019-03-15 15:52:15--  https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.15.tar.gz
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.15.tar.gz [following]
--2019-03-15 15:52:16--  https://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-8.0.15.tar.gz
Resolving cdn.mysql.com (cdn.mysql.com)... 104.127.195.16
Connecting to cdn.mysql.com (cdn.mysql.com)|104.127.195.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5989463 (5.7M) [application/x-tar-gz]
Saving to: ‘mysql-connector-java-8.0.15.tar.gz’


100%[===================================================================================================================================================>] 5,989,463    978KB/s   in 5.9s   


2019-03-15 15:52:23 (991 KB/s) - ‘mysql-connector-java-8.0.15.tar.gz’ saved [5989463/5989463]

[user@node1 ~]$ tar -zxvf mysql-connector-java-8.0.15.tar.gz

7、将jar包拷贝并重命名

[user@node1 ~]$ cd mysql-connector-java-8.0.15/
[user@node1 mysql-connector-java-8.0.15]$ cp mysql-connector-java-8.0.15.jar /usr/share/java/mysql-connector-java.jar

8、初始化mysql,这里报了个错,应该是在mysql中创建数据库、用户和密码的时候没有满足密码的安全策略,这里记录下报错信息,正常安装可以跳过这步,先做下面步骤9的配置。

[user@node1 ~]$ sudo /usr/share/cmf/schema/scm_prepare_database.sh mysql -hnode1 -uroot -pAbc_2019 --scm-host dmbnn3 scm scm scm
JAVA_HOME=/usr/lib/jvm/jre-openjdk
Verifying that we can write to /etc/cloudera-scm-server
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[                          main] DbProvisioner                  ERROR Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://node1/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLException: Your password does not satisfy the current policy requirements
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)[mysql-connector-java.jar:8.0.15]
        at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:299)[db-common-5.16.1.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.16.1.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.16.1.jar:]
[                          main] DbProvisioner                  ERROR Stack Trace:
java.sql.SQLException: Your password does not satisfy the current policy requirements
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)[mysql-connector-java.jar:8.0.15]
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)[mysql-connector-java.jar:8.0.15]
        at com.cloudera.enterprise.dbutil.DbProvisioner.executeSql(DbProvisioner.java:299)[db-common-5.16.1.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.doMain(DbProvisioner.java:104)[db-common-5.16.1.jar:]
        at com.cloudera.enterprise.dbutil.DbProvisioner.main(DbProvisioner.java:123)[db-common-5.16.1.jar:]
--> Error 1, giving up (use --force if you wish to ignore the error)

9、关闭密码复杂度限制,并重启mysql

[user@node1 ~]$ sudo vi /etc/my.cnf


[mysqld]
datadir=/data1/mysql/data
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
bind-address=0.0.0.0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
#skip-grant-tables
validate_password = off  #加上这一句
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[user@node1 ~]$ sudo systemctl restart mysqld

10、重新进行初始化,如果之前执行了,发生步骤8中的错误,那么可能会提示scm数据库已经存在,用root用户登录之后删掉即可。

[user@node1 ~]$ sudo /usr/share/cmf/schema/scm_prepare_database.sh mysql -hnode1 -uroot -pAbc_2019 --scm-host node1 scm scm scm
JAVA_HOME=/usr/lib/jvm/jre-openjdk
Verifying that we can write to /etc/cloudera-scm-server
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Creating SCM configuration file in /etc/cloudera-scm-server
Executing:  /usr/lib/jvm/jre-openjdk/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[                          main] DbCommandExecutor              INFO  Successfully connected to database.
All done, your SCM database is configured correctly!

11、数据库初始化成功。启动 cloudera-scm-server,并设置开机启动:

[user@node1 ~]$ service cloudera-scm-server start
[user@node1 ~]$ sudo systemctl enable cloudera-scm-server

稍等一会儿通过页面访问http://你的服务器IP:7180/cmf/即可访问到CM监控页面,通过页面的安装引导就可以实现CDH的安装。

上一篇 下一篇

猜你喜欢

热点阅读