ambari与hortonworks、apache易混淆关系

2024-09-03 21:18

本文主要是介绍ambari与hortonworks、apache易混淆关系,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

百度百科上ambari写的是apache的,并在网页后面附上了apache官网url,但是hortonworks官网上也挂着个ambari,初学者容易混淆;其实两者是差不多的,据我观察:

apache ambari是原始版本,发行的最新版本会高于hortonworks官网里面的最新发行版本;

ambari2.7.1.0在hortonworks官网中已经有Ubuntu18的安装教程了,而apache官网给的文档还只到Ubuntu16;

结论:hortonworks官网给的应该是在apache ambari的稳定版本上有所修改后发布的,而且安装教程更完善;

(在hortonworks官网https://zh.hortonworks.com/apache/ambari/能直接点进apache 官网看安装向导,但两者安装文档不一样!https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.0.0/bk_ambari-installation/content/download_the_ambari_repo_ubuntu16.html

https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.7.1)

 

 

附Ubuntu16安装apache ambari相关链接:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.0/bk_ambari-installation/content/ambari_repositories.html ——源配置,建议大家用这个hdp的文档安装,看起来靠谱些

https://my.oschina.net/ilovetao/blog/1596822 ——看起来可行,还没空试试

https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.6.2 ——原生的这里没说源的问题,我照这里开始的,有点坑

apache ambari2.6.2.0.0需要先安装:

apt-get install git 以及配置jdk8(否则会报jre的问题),还有nodejs和npm(这两个不确定是否必须)

注意修改maven源(建议用阿里云的),不然有可能卡死。

但好几个jar依赖或者pom之类的链接还是卡死了。。。就像下面的链接:

[INFO] Downloading from apache-snapshots: https://repository.apache.org/content/repositories/snapshots/clout/clout/1.0.1/clout-1.0.1.pom
直接Ctrl+c取消,重运行就好了(前提是浏览器能打开链接)

然后还有其他会报错导致退出的链接,点开发现:

这里注意配置好源

wget -O /etc/apt/sources.list.d/ambari.list http://public-repo-1.hortonworks.com/ambari/ubuntu16/2.x/updates/2.6.2.0/ambari.list
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
apt-get update

然后重新执行mvn -B clean install jdeb:jdeb -DnewVersion=2.6.2.0.0 -DbuildNumber=631319b00937a8d04667d93714241d2a0cb17275 -DskipTests -Dpython.ver="python >= 2.6"就好了。

然后可能还会有如下问题

[INFO] Ambari Metrics Monitor ............................. FAILURE [  4.805 s]
........

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (psutils-compile) on project ambari-metrics-host-monitoring: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ...<exec failοnerrοr="true" dir="/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil" executable="/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-metrics/ambari-metrics-host-monitoring/../../ambari-common/src/main/unix/ambari-python-wrap">... @ 4:305 in /home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-metrics/ambari-metrics-host-monitoring/target/antrun/build-psutils-compile.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 

百度一番解决了,参考:https://blog.csdn.net/zyj8170/article/details/72654544 (yum install python-devel改成 apt-get install python-dev

 

然后又出现了创建文件失败导致退出

参考:https://blog.csdn.net/chengyuqiang/article/details/59109789

pom添加:

<plugin>
         <groupId>org.vafer</groupId>
         <artifactId>jdeb</artifactId>
         <version>1.0.1</version>
         <executions>
           <execution>
             <!--Stub execution on direct plugin call - workaround for ambari deb build process-->
             <id>stub-execution</id>
             <phase>none</phase>
             <goals>
               <goal>jdeb</goal>
             </goals>
           </execution>
         </executions>
         <configuration>
           <skip>true</skip>
           <attach>false</attach>
           <submodules>false</submodules>
           <controlDir>${project.basedir}/../src/main/package/deb/control</controlDir>
         </configuration>
       </plugin>
 

还有个问题

这里注意要用sudo执行mvn命令就好了

然后,我们发现退步了,上次能执行到这里:

这次居然到这里failure:

提示:

看样子mvn 加了clean参数把之前的jar都删了,于是安装了nodejs和npm参考:https://blog.csdn.net/weixin_41841992/article/details/81809794 但似乎与这个无关。

然后又遇到问题:下载Phoenix的时候卡住不动了,浏览器也打不开对应链接(网上有人说到浏览器手动下,看样子有时候不行,然后第二天又能打开对应链接下载tar了,也不需要手动下了!应该是服务器问题,但还是建议手动下载到自己的路径存下,预防下次报错后重编译mvn -clear后要重下),参考:

# https://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.4.0/tars/hbase/hbase-1.1.2.2.6.4.0-91.tar.gz

# https://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.4.0/tars/phoenix/phoenix-4.7.0.2.6.4.0-91.tar.gz

# https://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.4.0/tars/hadoop/hadoop-2.7.3.2.6.4.0-91.tar.gz

# https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz

# 手动下载以上tar.gz放入相应位置,修改ambari-metric->pom.xml使用本地文件模式 <hbase.tar>file:///home/wenbin/bigData/bak/hbase-1.1.2.2.6.4.0-91.tar.gz</hbase.tar> <hadoop.tar>file:///home/wenbin/bigData/bak/hadoop-2.7.3.2.6.4.0-91.tar.gz</hadoop.tar> <phoenix.tar>file:///home/wenbin/bigData/bak/phoenix-4.7.0.2.6.4.0-91.tar.gz</phoenix.tar> <grafana.tar>file:///home/wenbin/bigData/bak/grafana-2.6.0.linux-x64.tar.gz</grafana.tar>


接下来的其他问题ambari-funtest:

[ERROR] Failed to create debian package /home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-funtest/target/ambari-funtest_2.6.2.0.0_all.deb
org.vafer.jdeb.PackagingException: "/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-funtest/src/main/package/deb/control" is not a valid 'control' directory)

......

[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Main ........................................ SUCCESS [ 31.934 s]
[INFO] Apache Ambari Project POM .......................... SUCCESS [  0.383 s]
[INFO] Ambari Web ......................................... SUCCESS [05:16 min]
[INFO] Ambari Views ....................................... SUCCESS [  5.652 s]
[INFO] Ambari Admin View .................................. SUCCESS [ 50.109 s]
[INFO] utility ............................................ SUCCESS [  1.404 s]
[INFO] ambari-metrics ..................................... SUCCESS [  3.439 s]
[INFO] Ambari Metrics Common .............................. SUCCESS [ 15.337 s]
[INFO] Ambari Metrics Hadoop Sink ......................... SUCCESS [ 10.076 s]
[INFO] Ambari Metrics Flume Sink .......................... SUCCESS [  5.298 s]
[INFO] Ambari Metrics Kafka Sink .......................... SUCCESS [  5.729 s]
[INFO] Ambari Metrics Storm Sink .......................... SUCCESS [  7.920 s]
[INFO] Ambari Metrics Storm Sink (Legacy) ................. SUCCESS [  6.662 s]
[INFO] Ambari Metrics Collector ........................... SUCCESS [06:33 min]
[INFO] Ambari Metrics Monitor ............................. SUCCESS [  8.517 s]
[INFO] Ambari Metrics Grafana ............................. SUCCESS [ 33.038 s]
[INFO] Ambari Metrics Assembly ............................ SUCCESS [05:13 min]
[INFO] Ambari Server ...................................... SUCCESS [54:58 min]
[INFO] Ambari Functional Tests ............................ FAILURE [02:15 min]
[INFO] Ambari Agent ....................................... SKIPPED
[INFO] ambari-logsearch ................................... SKIPPED
[INFO] Ambari Logsearch Appender .......................... SKIPPED
[INFO] Ambari Logsearch Portal ............................ SKIPPED
[INFO] Ambari Logsearch Log Feeder ........................ SKIPPED
[INFO] Ambari Logsearch Solr Client ....................... SKIPPED
[INFO] Ambari Infra Solr Plugin ........................... SKIPPED
[INFO] Ambari Logsearch Assembly .......................... SKIPPED
[INFO] Ambari Logsearch Integration Test .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:17 h
[INFO] Finished at: 2018-12-10T12:00:49+08:00
[INFO] Final Memory: 194M/483M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.vafer:jdeb:1.0.1:jdeb (default-cli) on project ambari-funtest: Failed to create debian package /home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-funtest/target/ambari-funtest_2.6.2.0.0_all.deb: "/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-funtest/src/main/package/deb/control" is not a valid 'control' directory) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :ambari-funtest

参考:https://blog.csdn.net/wang1472jian1110/article/details/68924794 ambari-funtes/pom.xml添加plugin

<plugin>

<groupId>org.vafer</groupId>

<artifactId>jdeb</artifactId>

<version>1.0.1</version>

<executions>

<execution>

<!--Stub execution on direct plugin call - workaround for ambari deb build process-->

<id>stub-execution</id>

<phase>none</phase>

<goals>

<goal>jdeb</goal>

</goals>

</execution>

</executions>

<configuration>

<skip>true</skip>

<attach>false</attach>

<submodules>false</submodules>

<controlDir>${project.basedir}/../src/main/package/deb/control</controlDir>

</configuration>

</plugin>

 

类似问题ambari-logsearch

[ERROR] Failed to create debian package /home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-logsearch/target/ambari-logsearch_2.6.2.0.0_all.deb
org.vafer.jdeb.PackagingException: "/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-logsearch/src/main/package/deb/control" is not a valid 'control' directory)

...

[INFO] Ambari Main ........................................ SUCCESS [ 48.972 s]
[INFO] Apache Ambari Project POM .......................... SUCCESS [  0.373 s]
[INFO] Ambari Web ......................................... SUCCESS [01:39 min]
[INFO] Ambari Views ....................................... SUCCESS [  5.748 s]
[INFO] Ambari Admin View .................................. SUCCESS [ 36.395 s]
[INFO] utility ............................................ SUCCESS [  1.641 s]
[INFO] ambari-metrics ..................................... SUCCESS [  2.845 s]
[INFO] Ambari Metrics Common .............................. SUCCESS [ 17.088 s]
[INFO] Ambari Metrics Hadoop Sink ......................... SUCCESS [ 11.639 s]
[INFO] Ambari Metrics Flume Sink .......................... SUCCESS [  5.361 s]
[INFO] Ambari Metrics Kafka Sink .......................... SUCCESS [  5.351 s]
[INFO] Ambari Metrics Storm Sink .......................... SUCCESS [  8.007 s]
[INFO] Ambari Metrics Storm Sink (Legacy) ................. SUCCESS [  7.614 s]
[INFO] Ambari Metrics Collector ........................... SUCCESS [14:19 min]
[INFO] Ambari Metrics Monitor ............................. SUCCESS [  4.362 s]
[INFO] Ambari Metrics Grafana ............................. SUCCESS [ 27.135 s]
[INFO] Ambari Metrics Assembly ............................ SUCCESS [04:36 min]
[INFO] Ambari Server ...................................... SUCCESS [09:07 min]
[INFO] Ambari Functional Tests ............................ SUCCESS [  8.668 s]
[INFO] Ambari Agent ....................................... SUCCESS [03:52 min]
[INFO] ambari-logsearch ................................... FAILURE [  0.452 s]
[INFO] Ambari Logsearch Appender .......................... SKIPPED
[INFO] Ambari Logsearch Portal ............................ SKIPPED
[INFO] Ambari Logsearch Log Feeder ........................ SKIPPED
[INFO] Ambari Logsearch Solr Client ....................... SKIPPED
[INFO] Ambari Infra Solr Plugin ........................... SKIPPED
[INFO] Ambari Logsearch Assembly .......................... SKIPPED
[INFO] Ambari Logsearch Integration Test .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36:49 min
[INFO] Finished at: 2018-12-10T14:45:02+08:00
[INFO] Final Memory: 195M/483M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.vafer:jdeb:1.0.1:jdeb (default-cli) on project ambari-logsearch: Failed to create debian package /home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-logsearch/target/ambari-logsearch_2.6.2.0.0_all.deb: "/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-logsearch/src/main/package/deb/control" is not a valid 'control' directory) -> [Help 1]
 

解决方式类似一个问题,pom.xml增加plugin

wenbin@wenbin-VirtualBox:~/bigData/apache-ambari-2.6.2-src/ambari-logsearch$ vim pom.xml

<plugin>

<groupId>org.vafer</groupId>

<artifactId>jdeb</artifactId>

<version>1.0.1</version>

<executions>

<execution>

<!--Stub execution on direct plugin call - workaround for ambari deb build process-->

<id>stub-execution</id>

<phase>none</phase>

<goals>

<goal>jdeb</goal>
</goals>

</execution>

</executions>

<configuration>

<skip>true</skip>

<attach>false</attach>

<submodules>false</submodules>

<controlDir>${project.basedir}/../src/main/package/deb/control</controlDir>

</configuration>

</plugin>

最后用root权限用户再执行:mvn -B clean install jdeb:jdeb -DnewVersion=2.6.2.0.0 -DbuildNumber=631319b00937a8d04667d93714241d2a0cb17275 -DskipTests -Dpython.ver="python >= 2.6"
完成:

[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Main ........................................ SUCCESS [ 48.207 s]
[INFO] Apache Ambari Project POM .......................... SUCCESS [  0.494 s]
[INFO] Ambari Web ......................................... SUCCESS [01:37 min]
[INFO] Ambari Views ....................................... SUCCESS [  5.256 s]
[INFO] Ambari Admin View .................................. SUCCESS [ 35.157 s]
[INFO] utility ............................................ SUCCESS [  1.373 s]
[INFO] ambari-metrics ..................................... SUCCESS [  3.692 s]
[INFO] Ambari Metrics Common .............................. SUCCESS [ 17.312 s]
[INFO] Ambari Metrics Hadoop Sink ......................... SUCCESS [ 10.614 s]
[INFO] Ambari Metrics Flume Sink .......................... SUCCESS [  6.326 s]
[INFO] Ambari Metrics Kafka Sink .......................... SUCCESS [  5.726 s]
[INFO] Ambari Metrics Storm Sink .......................... SUCCESS [  8.977 s]
[INFO] Ambari Metrics Storm Sink (Legacy) ................. SUCCESS [  7.608 s]
[INFO] Ambari Metrics Collector ........................... SUCCESS [31:04 min]
[INFO] Ambari Metrics Monitor ............................. SUCCESS [  5.188 s]
[INFO] Ambari Metrics Grafana ............................. SUCCESS [ 36.404 s]
[INFO] Ambari Metrics Assembly ............................ SUCCESS [05:23 min]
[INFO] Ambari Server ...................................... SUCCESS [08:37 min]
[INFO] Ambari Functional Tests ............................ SUCCESS [  9.220 s]
[INFO] Ambari Agent ....................................... SUCCESS [01:28 min]
[INFO] ambari-logsearch ................................... SUCCESS [  0.530 s]
[INFO] Ambari Logsearch Appender .......................... SUCCESS [ 12.483 s]
[INFO] Ambari Logsearch Portal ............................ SUCCESS [02:37 min]
[INFO] Ambari Logsearch Log Feeder ........................ SUCCESS [02:22 min]
[INFO] Ambari Logsearch Solr Client ....................... SUCCESS [  3.378 s]
[INFO] Ambari Infra Solr Plugin ........................... SUCCESS [01:23 min]
[INFO] Ambari Logsearch Assembly .......................... SUCCESS [  0.638 s]
[INFO] Ambari Logsearch Integration Test .................. SUCCESS [ 50.381 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59:07 min
[INFO] Finished at: 2018-12-10T16:00:06+08:00
[INFO] Final Memory: 233M/483M
[INFO] ------------------------------------------------------------------------

继续:
root@wenbin-VirtualBox:/home/wenbin/bigData/apache-ambari-2.6.2-src# cd ambari-server/target/

apt-get install ./ambari-server*.deb   #This should also pull in postgres packages as well.

然后发现要先安装mysql才能往下了(参考https://blog.csdn.net/u013303361/article/details/82753552):

    1. sudo apt-get install mysql-server

  2. apt-get isntall mysql-client

  3.  sudo apt-get install libmysqlclient-dev

  安装过程中不会提示设置密码,默认装的mysql5.7,图方便就手动改/etc/mysql/debian.cnf里面client用户账户+密码;

  sudo netstat -tap | grep mysql

  通过上述命令检查之后,如果看到有mysql 的socket处于 listen 状态则表示安装成功。

 

执行ambari-server setup接下来的问题

Enter advanced database configuration [y/n] (n)? n
Configuring database...
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.
ERROR: 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.
ERROR: Exiting with exit code -1. 
REASON: 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.

这里mysql-connector-java_8.0.12-1ubuntu18.04_all.deb无法直接给ambari使用,要改名为.jar后缀的(参考https://www.jianshu.com/p/f62947a88527)并配置/etc/ambari-server/conf/ambari.properties

server.jdbc.driver.path=/usr/share/java/mysql-jdbc-driver-5.7.24.jar

实际上我改成.jar后缀后,Scala都起不来了(虽然ambari-server setup成功但是ambari-server start失败),报

 Error: Could not find or load main class scala.tools.nsc.MainGenericRunner

,然后试下安装:

1、sudo dpkg -i mysql-connector-java_8.0.12-1ubuntu18.04_all.deb 但是这也没看到jar驱动。
于是重新下https://dev.mysql.com/downloads/connector/j/5.7.html 驱动jar我用的tar.gz里的:

 

 

现在可以执行ambari-server setup成功(参考https://www.jianshu.com/p/f62947a88527):

root@wenbin-VirtualBox:/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-server/target# ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
WARNING: Could not run /usr/sbin/sestatus: OK
Customize user account for ambari-server daemon [y/n] (n)? n
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? n
Checking GPL software agreement...
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 (3): 3
Hostname (localhost): localhost
Port (3306): 33.6
Invalid port.
Port (3306): 3306
Database name (ambari): ambari
Username (root): root
Enter Database Password (123456): 
Configuring ambari database...
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.6.2.0.0.jar

Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

 

问题:
root@wenbin-VirtualBox:/home/wenbin/bigData/apache-ambari-2.6.2-src/ambari-server/target# ambari-server start
Using python  /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.................ERROR: Exiting with exit code -1. 
REASON: Ambari Server java process has stopped. Please check the logs for more information.
参考解决方式:

root@wenbin-VirtualBox:/home/wenbin/bigData# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.7.24-0ubuntu0.18.04.1 (Ubuntu)

mysql> use ambari;
Database changed
mysql> source  /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

后面还有问题:ambari完全连不上mysql,直接报 Connection Refused;但我的Scala能正常连接mysql;

百度无果,想了想应该是Ambari默认安装的数据库连接文件有问题,检查下 /etc/ambari-server/conf/ambari.properties ,发现需要修改的有如下2点:

默认自动生成的url其实是Telnet不通的:

server.jdbc.rca.url=jdbc:mysql://wenbin-VirtualBox:3306/ambari
server.jdbc.url=jdbc:mysql://wenbin-VirtualBox:3306/ambari

root@wenbin-VirtualBox:/home/wenbin/bigData/apache-ambari-2.6.2-src# telnet wenbin-VirtualBox 3306
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
root@wenbin-VirtualBox:/home/wenbin/bigData/apache-ambari-2.6.2-src# telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

手动改成:

server.jdbc.rca.url=jdbc:mysql://localhost:3306/ambari
server.jdbc.url=jdbc:mysql://localhost:3306/ambari

问题:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

解决方式:

use mysql;
update user set plugin='' where user='root';
flush privileges;

参考:http://www.zhimengzhe.com/shujuku/MySQL/185802.html

然后变成了问题:ERROR 1045 (28000)

解决方式:

1.打开/etc/mysql/mysql.conf.d/mysqld.cnf 文件,命令如下

    $ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

2.找到[mysqld]段,并加入一行“skip-grant-tables”,如下图,

3.重启mysql服务,用空密码进入mysql管理命令行,切换到mysql库,操作命令如下,

    $ mysql

        Welcome to the MySQL monitor.  Commands end with ; or \g. 

    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 mysql.user set authentication_string=password('newpass') where user='root' and Host ='localhost';
        Query OK, 1 row affected, 1 warning (0.00 sec)
        Rows matched: 1  Changed: 1  Warnings: 1

    mysql> update user set plugin="mysql_native_password"; 
        Query OK, 0 rows affected (0.00 sec)
        Rows matched: 3  Changed: 0  Warnings: 0

    mysql> flush privileges;
        Query OK, 0 rows affected (0.01 sec)

    mysql> quit;
        Bye

4.回到sudo vi  /etc/mysql/mysql.conf.d/mysqld.cnf,把刚才加入的那一行“skip-grant-tables”注释或删除掉。

5.再次重启mysql服务sudo service mysql restart,使用新的密码登陆,修改成功。

    $ mysql -u root -p new_pass  
        Welcome to the MySQL monitor.  Commands end with ; or \g.  
    mysql> 

6.至此,问题解决

参考:https://blog.csdn.net/learner_lps/article/details/62887343

 

此时执行ambari-server start就能成功了!

进入 http://localhost:8080/ 

采用admin/admin登录

 

总结:各种坑好多,ambari各种安装博客实际情况和自己的不一样,Ubuntu默认的mysql5.7也好坑!

这篇关于ambari与hortonworks、apache易混淆关系的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1134071

相关文章

POJ1269 判断2条直线的位置关系

题目大意:给两个点能够确定一条直线,题目给出两条直线(由4个点确定),要求判断出这两条直线的关系:平行,同线,相交。如果相交还要求出交点坐标。 解题思路: 先判断两条直线p1p2, q1q2是否共线, 如果不是,再判断 直线 是否平行, 如果还不是, 则两直线相交。  判断共线:  p1p2q1 共线 且 p1p2q2 共线 ,共线用叉乘为 0  来判断,  判断 平行:  p1p

pip-tools:打造可重复、可控的 Python 开发环境,解决依赖关系,让代码更稳定

在 Python 开发中,管理依赖关系是一项繁琐且容易出错的任务。手动更新依赖版本、处理冲突、确保一致性等等,都可能让开发者感到头疼。而 pip-tools 为开发者提供了一套稳定可靠的解决方案。 什么是 pip-tools? pip-tools 是一组命令行工具,旨在简化 Python 依赖关系的管理,确保项目环境的稳定性和可重复性。它主要包含两个核心工具:pip-compile 和 pip

Apache Tiles 布局管理器

陈科肇 =========== 1.简介 一个免费的开源模板框架现代Java应用程序。  基于该复合图案它是建立以简化的用户界面的开发。 对于复杂的网站,它仍然最简单,最优雅的方式来一起工作的任何MVC技术。 Tiles允许作者定义页面片段可被组装成在运行一个完整的网页。  这些片段,或Tiles,可以用于为了降低公共页面元素的重复,简单地包括或嵌入在其它瓦片,制定了一系列可重复使用

Apache HttpClient使用详解

转载地址:http://eksliang.iteye.com/blog/2191017 Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且也方便了开发人员测试接口(基于Http协议的),即提高了开发的效率,也方便提高代码的健壮性。因此熟

读软件设计的要素04概念的关系

1. 概念的关系 1.1. 概念是独立的,彼此间无须相互依赖 1.1.1. 一个概念是应该独立地被理解、设计和实现的 1.1.2. 独立性是概念的简单性和可重用性的关键 1.2. 软件存在依赖性 1.2.1. 不是说一个概念需要依赖另一个概念才能正确运行 1.2.2. 只有当一个概念存在时,包含另一个概念才有意义 1.3. 概念依赖关系图简要概括了软件的概念和概念存在的理

开源Apache服务器安全防护技术精要及实战

Apache 服务简介   Web服务器也称为WWW服务器或HTTP服务器(HTTPServer),它是Internet上最常见也是使用最频繁的服务器之一,Web服务器能够为用户提供网页浏览、论坛访问等等服务。   由于用户在通过Web浏览器访问信息资源的过程中,无须再关心一些技术性的细节,而且界面非常友好,因而Web在Internet上一推出就得到了爆炸性的发展。现在Web服务器已

数据依赖基础入门:函数依赖与数据库设计的关系

在数据库设计中,数据依赖 是一个重要的概念,它直接影响到数据库的结构和性能。函数依赖 作为数据依赖的一种,是规范化理论的基础,对数据库设计起着至关重要的作用。如果你是一名数据库设计的初学者,这篇文章将帮助你理解函数依赖及其在数据库设计中的应用。 什么是数据依赖? 数据依赖 是指同一关系中属性间的相互依赖和制约关系,它是数据库设计中语义的体现。在现实世界中,数据之间往往存在某种依赖关系,而这

c++ 和C语言的兼容性关系

C++ 和 C 语言有很高的兼容性,但也存在一些差异和限制。下面是它们的兼容性关系的详细介绍: 兼容性 C++ 是 C 的超集: C++ 语言设计为兼容 C 语言的语法和功能,大部分 C 代码可以在 C++ 编译器中编译运行。 标准库兼容性: C++ 标准库包含了 C 标准库的内容,如 stdio.h、stdlib.h、string.h 等头文件,但 C++ 的标准库也提供了额外的功能,如

七、Maven继承和聚合关系、及Maven的仓库及查找顺序

1.继承   2.聚合   3.Maven的仓库及查找顺序

file-max与ulimit的关系与差别

http://zhangxugg-163-com.iteye.com/blog/1108402 http://ilikedo.iteye.com/blog/1554822