vmware 14 CetOS 7をインストールcdh 5を構築する.13.3環境(二)

12766 ワード

作成時間:2019-4-28 10:38:26.

一、データベースの作成

create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database monitor DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

バックアップスナップショット【mysqlhive】


二、インストールCM


2.1アップロード


xmanager 5を使用して、cloudera-manager-centos 7-cm 5のパッケージを作成します.13.3_x86_64.tar.gz CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1 manifest.jsonを[/usr/local/ninja 59 k]にアップロード

2.1.1 sha 1の名前変更


mv CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1 CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha

2.1.2バックアップスナップショット【uploadcdh 5】


2.2インストール

tar -zxvf /usr/local/ninja59k/cloudera-manager-centos7-cm5.13.3_x86_64.tar.gz -C /opt

数分かかります.解凍後2つのフォルダ【cloudera】【cm-5.13.3】
新しい参考資料20190509https://blog.csdn.net/ltliyue/article/details/82734814#CMユーザーの作成(すべてのノード)mysql>create database cm DEFAULT CHARSET utf 8 COLLATE utf 8_general_ci; –許可grant all privileges on hive.*to ‘scm’@’%’ identified by ‘cdh’ with grant option; grant all privileges on amon.* to ‘scm’@’%’ identified by ‘cdh’ with grant option; grant all privileges on hue.* to ‘scm’@’%’ identified by ‘cdh’ with grant option; grant all privileges on oozie.* to ‘scm’@’%’ identified by ‘cdh’ with grant option;
useradd --system --home=/opt/cloudera-manager/cm-5.7.0/run/cloudera-scm-server --no-create-home --comment “Cloudera SCM User” cloudera-scm
阿里云有问题???useradd--system--home=/opt/cm-5.13.3/run/cloudera-scm-server/--no-create-home--shell=/bin/false--comment「Cloudera SCM User」cloudera-scm#id cloudera-scmを表示

2.2.2 CMにconnectorを追加する.lib


XMANAGER 5で【mysql-connector-java-5.1.47.tar.gz】を[/usr/local/ninja 59 k]にアップロードします.解凍:tar-zxvf mysql-connector-java-5.1.47.tar.gz [root@cdh1 mysql-connector-java-5.1.47]# cd/usr/local/ninja59k/mysql-connector-java-5.1.47 [root@cdh1 mysql-connector-java-5.1.47]# ls build.xml CHANGES COPYING mysql-connector-java-5.1.47-bin.jar mysql-connector-java-5.1.47.jar README README.txt srcは【mysql-connector-java-5.147-bin.jar】を2つのディレクトリにコピーする:scp mysql-connector-java-5.147-bin.jar root@cdh1:/opt/cm-5.13.3/share/cmf/lib/#mkdir -p/usr/share/java ??? #scp mysql-connector-java-5.1.47-bin.jar root@cdh1:/usr/share/java/??? scp mysql-connector-java-5.1.47-bin.jar root@cdh1:/usr/java/jdk1.8.0_211#javaインストールディレクトリ
/opt/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql -uroot -p scm scm

2.2.3 SCMデータベースの初期化


[root@cdh1 mysql-connector-java-5.1.47]#/opt/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql-uroot-p scm scm#初期化server
Enter database password: Enter SCM password:
JAVA_HOME=/usr/java/jdk1.8.0_211 Verifying that we can write to/opt/cm-5.13.3/etc/cloudera-scm-server Sun May 05 01:58:50 EDT 2019 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Creating SCM configuration file in/opt/cm-5.13.3/etc/cloudera-scm-server Executing:/usr/java/jdk1.8.0_211/bin/java -cp/usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cm-5.13.3/share/cmf/schema/…/lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor/opt/cm-5.13.3/etc/cloudera-scm-server/db.properties com.cloudera.cmf.db. Sun May 05 01:58:52 EDT 2019 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 2019-05-05 01:58:53,499 [main] INFO com.cloudera.enterprise.dbutil.DbCommandExecutor - Successfully connected to database. All done, your SCM database is configured correctly!

2.2.4 vmwareスナップショットのバックアップ【scmdb】


2.3ポートの構成


2.3.1エージェントのすべてのスレーブノードからプライマリノードへの構成


各ノードは、次のように構成されます.
[root@cdh1 cloudera-scm-agent]# cd /opt/cm-5.13.3/etc/cloudera-scm-agent/
[root@cdh1 cloudera-scm-agent]# vim config.ini
server_host=cdh1 #       IP ?
port=7180

#       
#scp -r /opt/cm-5.13.3/ root@cdh2:/opt/ #  yes,       
#scp -r /opt/cm-5.13.3/ root@cdh3:/opt/ #  yes,       

2.3.2データウェアハウスの構成


この操作は、プライマリノードで実行し、プライマリノードに倉庫を作成するだけです.
[root@cdh1 cloudera-scm-agent]# cd /usr/local/ninja59k/
[root@cdh1 ninja59k]# ls
CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel  CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1  cloudera-manager-centos7-cm5.13.3_x86_64.tar.gz  manifest.json  mysql-connector-java-5.1.47  mysql-connector-java-5.1.47.tar.gz
[root@cdh1 ninja59k]# mv CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1 manifest.json /opt/cloudera/parcel-repo/
[root@cdh1 ninja59k]# cd /opt/cloudera/parcel-repo/
[root@cdh1 parcel-repo]# mv CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha1 CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha
[root@cdh1 parcel-repo]# ls
CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel  CDH-5.13.3-1.cdh5.13.3.p0.2-el7.parcel.sha  manifest.json

2.3.3 vmwareスナップショットのバックアップ【cmrepo】


2.4スタートCM


#プライマリノード[root@cdh1 parcel-repo]#/opt/cm-5.13.3/etc/init.d/cloudera-scm-server start/opt/cm-5.13.3/etc/init.d/cloudera-scm-server: line 109: pstree: command not found Starting cloudera-scm-server: [ OK ]
[root@cdh1~]#yum install psmisc-y#pstree依存
#プライマリノードおよびその他のノード[root@cdh1~]#yum install psmisc-y#pstree依存[root@cdh1 parcel-repo]#/opt/cm-5.13.3/etc/init.d/cloudera-scm-agent start/opt/cm-5.13.3/etc/init.d/cloudera-scm-agent:line 102:pstree:command not found Starting cloudera-scm-agent:[OK]起動に時間がかかり、データベースscmのhostsテーブルを表示し、ノード情報が表示されるとserver起動完了を示す.または「OK」表示待ちで完了します.

2.5 vmwareスナップショットのバックアップ【cmweb】


この章は終わります。


その他の情報:

xxxxxxxx2.3.4ノードディレクトリ(すべてのノード)からの構成(元のチュートリアルは適用されませんか?)


すべてのスレーブノードで次の操作を行います.
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels

2.4データベースの初期化

mysql -uroot -pSa123sa4
mysql> set global validate_password_policy=0;
mysql> set global validate_password_mixed_case_count=0;
mysql>  set global validate_password_number_count=3;
mysql> set global validate_password_special_char_count=0;
mysql>  set global validate_password_length=3;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Sa123sa4' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

このスクリプトは、CMSに必要なデータベースを作成および構成するためのスクリプトです.各パラメータは、mysqlです.データベースはmysqlです.インストール中にoracleを使用する場合は、oracleに変更する必要があります.-hcdh 1:データベースはcdh 1ホスト上に構築されます.つまり、プライマリノードの上です.-uroot:rootアイデンティティmysqlを実行します.-proot:mysqlのrootパスワードはrootです.–scm-host cdh 1:CMSのホストで、一般的にmysqlにインストールされているホストと同じホストです.最後の3つのパラメータは、データベース名、データベースユーザー名、データベースパスワードです.
エラーメッセージの続行:
[root@cdh1 ~]# /opt/cloudera-manager/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql -hcdh1 -uroot -pSa123sa4 --scm-host cdh1 scmdbn scmdbu scmdbp
JAVA_HOME=/usr/java
Verifying that we can write to /opt/cloudera-manager/cm-5.13.3/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.
2019-04-28 01:48:48,282 [main] ERROR com.cloudera.enterprise.dbutil.DbProvisioner  - Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://cdh1/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
      
	at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)
	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
	... 8 more
--> Error 1, giving up (use --force if you wish to ignore the error)

この問題は、【タイムゾーン設定】が一致しないためです.
date
#   Sun Apr 28 02:28:53 EDT 2019
mv /etc/localtime /etc/localtime.bak
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #       
timedatectl status #    

shスクリプトエラーの再実行:
/opt/cloudera-manager/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql -hcdh1 -uroot -pSa123sa4 --scm-host cdh1 scmdbn scmdbu scmdbp
#    :
2019-04-28 04:07:57,209 [main] ERROR com.cloudera.enterprise.dbutil.DbProvisioner  - Stack Trace:
java.sql.SQLException: Can't create database 'scmdbn'; database exists
--> Error 1, giving up (use --force if you wish to ignore the error)

さっき実行回数が多くなったのか、データベースが作成されました.ここでdropは落ちます.
mysql:>drop database if exists scmdbn;
>exit

shの再実行
[root@cdh1 ~]# /opt/cloudera-manager/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql -hcdh1 -uroot -pSa123sa4 --scm-host cdh1 scmdbn scmdbu scmdbp
JAVA_HOME=/usr/java
Verifying that we can write to /opt/cloudera-manager/cm-5.13.3/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.
2019-04-28 04:14:08,423 [main] ERROR com.cloudera.enterprise.dbutil.DbProvisioner  - Exception when creating/dropping database with user 'root' and jdbc url 'jdbc:mysql://cdh1/?useUnicode=true&characterEncoding=UTF-8'
java.sql.SQLException: Your password does not satisfy the current policy requirements

デフォルトのパスワードポリシーを変更するには、次の手順に従います.
:>set global validate_password_policy=0;
:>set global validate_password_length=1;
:>FLUSH PRIVILEGES;

やっと成功しました.
[root@cdh1 ~]# /opt/cloudera-manager/cm-5.13.3/share/cmf/schema/scm_prepare_database.sh mysql -hcdh1 -uroot -pSa123sa4 --scm-host cdh1 scmdbn scmdbu scmdbp
JAVA_HOME=/usr/java
Verifying that we can write to /opt/cloudera-manager/cm-5.13.3/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 /opt/cloudera-manager/cm-5.13.3/etc/cloudera-scm-server
Executing:  /usr/java/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/opt/cloudera-manager/cm-5.13.3/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /opt/cloudera-manager/cm-5.13.3/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.
2019-04-28 04:20:06,986 [main] INFO  com.cloudera.enterprise.dbutil.DbCommandExecutor  - Successfully connected to database.
All done, your SCM database is configured correctly!

2.5 vmwareスナップショット【scmdbn】をバックアップし、時間2019-4-28 16:23:23。


3、サービスを開始する

[root@cdh1 ~]# /opt/cloudera-manager/cm-5.13.3/etc/init.d/cloudera-scm-server start
Starting cloudera-scm-server:                              [  OK  ]
[root@cdh1 ~]# /opt/cloudera-manager/cm-5.13.3/etc/init.d/cloudera-scm-agent start
Starting cloudera-scm-agent:                               [  OK  ]

締め切り時間:2019-4-28 16:30:24.