本文主要是介绍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/
|
然后发现要先安装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易混淆关系的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!