Centos7.5服务器安装HDP的坑

版权声明:本文为博主原创文章,未经允许不得转载! https://blog.csdn.net/weixin_41919236/article/details/84892906

制作本地源
cd /root/ambari/centos/ambari.repo
配置网络源 配置网络源 要开启http服务
python -m SimpleHTTPServer & 备注:&为开启后台进程
netstat -nltp|grep 8000

yum list | grep mariadb

systemctl status mariadb

yum -y install mariadb.x86_64 mariadb-server.x86_64

systemctl enable mariadb //开机启动

systemctl start mariadb

mysql_secure_installation
回车
y
root
root
n
n
n
n


在这里插入图片描述
在这里插入图片描述

mysql -uroot -p

GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;

use mysql;

select * from user;

flush privileges; 刷新

rpm -qa |grep -i mysql
perl-DBD-MySQL-4.023-6.el7.x86_64

rpm -qa |grep -i mariadb
mariadb-libs-5.5.56-2.el7.x86_64
mariadb-5.5.56-2.el7.x86_64
mariadb-server-5.5.56-2.el7.x86_64

删除 yum -y remove mariadb-5.5.56-2.el7.x86_64

1.9 安装ambari服务
yum list | grep ambari

ambari-agent.x86_64 2.5.0.3-7 ambari-2.5.0.3
ambari-infra-solr.noarch 2.5.0.3-7 ambari-2.5.0.3
ambari-infra-solr-client.noarch 2.5.0.3-7 ambari-2.5.0.3
ambari-logsearch-logfeeder.noarch 2.5.0.3-7 ambari-2.5.0.3
ambari-logsearch-portal.noarch 2.5.0.3-7 ambari-2.5.0.3
ambari-metrics-collector.x86_64 2.5.0.3-7 ambari-2.5.0.3
ambari-metrics-common.noarch 2.5.0.3-7 ambari-2.5.0.3
ambari-metrics-grafana.x86_64 2.5.0.3-7 ambari-2.5.0.3
ambari-metrics-hadoop-sink.x86_64 2.5.0.3-7 ambari-2.5.0.3
ambari-metrics-monitor.x86_64 2.5.0.3-7 ambari-2.5.0.3
ambari-server.x86_64 2.5.0.3-7 ambari-2.5.0.3
smartsense-hst.x86_64 1.4.0.2.5.0.3-7 ambari-2.5.0.3

yum -y install ambari-server.x86_64

服务端下载

[root@bigdata01 ~]# yum -y install ambari-server.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
–> Running transaction check
—> Package ambari-server.x86_64 0:2.5.0.3-7 will be installed
–> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-2.5.0.3-7.x86_64
–> Running transaction check
—> Package postgresql-server.x86_64 0:9.2.23-3.el7_4 will be installed
–> Processing Dependency: postgresql-libs(x86-64) = 9.2.23-3.el7_4 for package: postgresql-server-9.2.23-3.el7_4.x86_64
–> Processing Dependency: postgresql(x86-64) = 9.2.23-3.el7_4 for package: postgresql-server-9.2.23-3.el7_4.x86_64
–> Processing Dependency: libpq.so.5()(64bit) for package: postgresql-server-9.2.23-3.el7_4.x86_64
–> Running transaction check
—> Package postgresql.x86_64 0:9.2.23-3.el7_4 will be installed
—> Package postgresql-libs.x86_64 0:9.2.23-3.el7_4 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================

Package Arch Version Repository Size
================================================================================================================================================
Installing:
ambari-server x86_64 2.5.0.3-7 ambari-2.5.0.3 663 M
Installing for dependencies:
postgresql x86_64 9.2.23-3.el7_4 iso-soft 3.0 M
postgresql-libs x86_64 9.2.23-3.el7_4 iso-soft 234 k
postgresql-server x86_64 9.2.23-3.el7_4 iso-soft 3.8 M

Transaction Summary
================================================================================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 670 M
Installed size: 755 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/ambari-2.5.0.3/packages/ambari-server-2.5.0.3-7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 07513cad: NOKEY
Public key for ambari-server-2.5.0.3-7.x86_64.rpm is not installed
ambari-server-2.5.0.3-7.x86_64.rpm | 663 MB 00:00:15


Total 42 MB/s | 670 MB 00:00:15
Retrieving key from http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.5.0.3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

在这里插入图片描述

安装过程中报错

Total 175 MB/s | 7.0 MB 00:00:00 warning: /var/cache/yum/x86_64/7/ambari-2.5.0.3/packages/ambari-server-2.5.0.3-7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 07513cad: NOKEY Retrieving key from http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.5.0.3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

GPG key retrieval failed: [Errno 14] curl#6 - "Could not resolve host: public-repo-1.hortonworks.com; Unknown error"

解决:

[root@bigdata01 yum.repos.d]# cd /etc/yum.repos.d/ [root@bigdata01 yum.repos.d]# ls ambari.repo hanrun.repo hdp.repo

#VERSION_NUMBER=2.5.0.3-7 [ambari-2.5.0.3] name=ambari Version - ambari-2.5.0.3 baseurl=http://192.168.1.20:8000/root/ambari/centos7/ gpgcheck=0 gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.5.0.3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1

gpgcheck=0修改成0;   ======>成功了  下面为成功的例子
[root@bigdata01 yum.repos.d]# yum -y install ambari-server.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
ambari-2.5.0.3                                                                                                           | 2.9 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package ambari-server.x86_64 0:2.5.0.3-7 will be installed
--> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-2.5.0.3-7.x86_64
--> Running transaction check
---> Package postgresql-server.x86_64 0:9.2.23-3.el7_4 will be installed
--> Processing Dependency: postgresql-libs(x86-64) = 9.2.23-3.el7_4 for package: postgresql-server-9.2.23-3.el7_4.x86_64
--> Processing Dependency: postgresql(x86-64) = 9.2.23-3.el7_4 for package: postgresql-server-9.2.23-3.el7_4.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql-server-9.2.23-3.el7_4.x86_64
--> Running transaction check
---> Package postgresql.x86_64 0:9.2.23-3.el7_4 will be installed
---> Package postgresql-libs.x86_64 0:9.2.23-3.el7_4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
 Package                               Arch                       Version                              Repository                          Size
================================================================================================================================================
Installing:
 ambari-server                         x86_64                     2.5.0.3-7                            ambari-2.5.0.3                     663 M
Installing for dependencies:
 postgresql                            x86_64                     9.2.23-3.el7_4                       iso-soft                           3.0 M
 postgresql-libs                       x86_64                     9.2.23-3.el7_4                       iso-soft                           234 k
 postgresql-server                     x86_64                     9.2.23-3.el7_4                       iso-soft                           3.8 M

Transaction Summary
================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total size: 670 M
Total download size: 7.0 M
Installed size: 755 M
Downloading packages:
------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                           177 MB/s | 7.0 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : postgresql-libs-9.2.23-3.el7_4.x86_64                                                                                        1/4 
  Installing : postgresql-9.2.23-3.el7_4.x86_64                                                                                             2/4 
  Installing : postgresql-server-9.2.23-3.el7_4.x86_64                                                                                      3/4 
  Installing : ambari-server-2.5.0.3-7.x86_64                                                                                               4/4 
  Verifying  : ambari-server-2.5.0.3-7.x86_64                                                                                               1/4 
  Verifying  : postgresql-9.2.23-3.el7_4.x86_64                                                                                             2/4 
  Verifying  : postgresql-server-9.2.23-3.el7_4.x86_64                                                                                      3/4 
  Verifying  : postgresql-libs-9.2.23-3.el7_4.x86_64                                                                                        4/4 

Installed:
  ambari-server.x86_64 0:2.5.0.3-7                                                                                                              

Dependency Installed:
  postgresql.x86_64 0:9.2.23-3.el7_4         postgresql-libs.x86_64 0:9.2.23-3.el7_4         postgresql-server.x86_64 0:9.2.23-3.el7_4        

Complete!

对ambari进行配置

ambari-server setup ---->设置ambari-server
报错

[root@bigdata01 ~]# 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
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.
[root@bigdata01 ~]# 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)? n
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.
[root@bigdata01 ~]# 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)? n
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.
[root@bigdata01 ~]# 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)? n
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.
[root@bigdata01 ~]# 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):
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.




解决

重要事情说三遍,chown root ambari.repo 修改属主


[root@bigdata01 ~]# 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):
ERROR: Unexpected error 'getpwuid(): uid not found: 1001'
ERROR: Exiting with exit code 1. 
REASON: Failed to create user. Exiting.
[root@bigdata01 ~]# cd /etc/yum.repos.d/
[root@bigdata01 yum.repos.d]# ls
ambari.repo  hanrun.repo  hdp.repo
[root@bigdata01 yum.repos.d]# ls -l
total 12
-rw-r--r-- 1 1001 users 278 Dec  8 16:04 ambari.repo
-rw-r--r-- 1 root root   85 Dec  8 11:12 hanrun.repo
-rw-r--r-- 1 1001 users 520 Dec  8 15:57 hdp.repo
[root@bigdata01 yum.repos.d]# ll
total 12
-rw-r--r-- 1 1001 users 278 Dec  8 16:04 ambari.repo
-rw-r--r-- 1 root root   85 Dec  8 11:12 hanrun.repo
-rw-r--r-- 1 1001 users 520 Dec  8 15:57 hdp.repo
[root@bigdata01 yum.repos.d]# chown root ambari.repo 
[root@bigdata01 yum.repos.d]# ls -l
total 12
-rw-r--r-- 1 root users 278 Dec  8 16:04 ambari.repo
-rw-r--r-- 1 root root   85 Dec  8 11:12 hanrun.repo
-rw-r--r-- 1 1001 users 520 Dec  8 15:57 hdp.repo

备注:下面为一整套成功流程

[root@bigdata01 yum.repos.d]# 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):
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
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: /opt/jdk/
Validating JDK on Ambari Server...done.
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
Hostname (localhost): 
Port (3306): 
Database name (ambari): 
Username (ambari): root
Enter Database Password (bigdata): 
Re-enter password: 
Configuring ambari database...
WARNING: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.
Press <enter> to continue.
Copying JDBC drivers to server resources...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.5.0.3.7.jar
...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.


报错
Host Checks found 1 issues on 2 hosts.
After manually resolving the issues, click Rerun Checks.
To manually resolve issues on each host run the HostCleanup script (Python 2.6 or greater is required):
python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent --skip=users
Note: Clean up of Firewall and Transparent Huge Page issues are not supported by the HostCleanup script.
Note: To clean up in interactive mode, remove --silent option. To clean up all resources, including users, remove --skip=users option. Use --help for a list of available options.

猜你喜欢

转载自blog.csdn.net/weixin_41919236/article/details/84892906