irpas技术客

ambari添加安装hive服务和Hbase服务_Coca可口_ambari安装hive

大大的周 2224

在此处选择添加服务,我这里不光勾选了hive还勾选了hbase

后面两步一直next就行,会提醒需前置安装yarn+mapreduce2和tez,点右边的同意继续就行。忘记截图了,也不影响

到此处开始重点,在非master节点,安装hive元存储。

例:如图,如果选择了hdp-3,则在hdp-3上安装。

然后点next,点hive,先不配置,等把数据库装好,配置完成再来该页面进行hive的配置

此时我们先切换到xshell进行操作,在hdp-3节点安装mysql数据库,这里选择装的mariadb

yum install -y mariadb-server

将mariadb启动起来,并设置mariadb自启动

systemctl start mariadb && systemctl enable mariadb

执行初始化设置

mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] n ... skipping. By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!

进入mysql

mysql -uroot -proot

创建hive数据库,并设置编码utf-8

MariaDB [(none)]> CREATE DATABASE hive DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; Query OK, 1 row affected (0.00 sec)

创建hive用户,并设置密码为hive

MariaDB [(none)]> CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'; Query OK, 0 rows affected (0.00 sec)

设置hive用户拥有所有数据库权限

MariaDB [(none)]> GRANT ALL ON hive.* TO 'hive'@'%'; Query OK, 0 rows affected (0.00 sec)

刷新权限表

MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)

在master节点上设置mysql的驱动(“jdbc-driver=”后面接着驱动存放的位置,如果没有驱动,我准备好了下载地址"http://114.55.237.251/mysql-connector-java/",存放到该目录即可)

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

然后回到hive配置页面,这里我们选择existing mysql ,即现有的mysql数据库

配置

其中jdbcurl

jdbc:mysql://XXX:3306/hive?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8

?配置完next,一般会出现如图

这个意思就是hbase的堆内存大小,小于默认值1024,这里我们可以不管他,点击

proceed anyway

?这个页面就是汇总报告,配置信息列出来给我们看,继续下一步就行

点 deploy部署

进入初始化加载页面,耐心等待会即可

?

这里报错了,咱们看看是什么原因

Traceback (most recent call last): File "arbbari-agent/cacheacks/HDP/3.0rvices/HBASE/package/scriptsase_client.py", line 69, in <module> HbaseClient().execute() File "/usrbbari-agentb/resource_managementbraries/script/script.py", line 353, in execute method(env) File "arbbari-agent/cacheacks/HDP/3.0rvices/HBASE/package/scriptsase_client.py", line 35, in install self.install_packages(env) File "/usrbbari-agentb/resource_managementbraries/script/script.py", line 836, in install_packages retry_count=agent_stack_retry_count) File "/usrbbari-agentb/resource_management/core/base.py", line 166, in __init__ self.env.run() File "/usrbbari-agentb/resource_management/core/environment.py", line 160, in run self.run_action(resource, action) File "/usrbbari-agentb/resource_management/core/environment.py", line 124, in run_action provider_action() File "/usrbbari-agentb/resource_management/core/providers/packaging.py", line 30, in action_install self._pkg_manager.install_package(package_name, self.__create_context()) File "/usrbbari-agentbbari_commons/repo_manager/yum_manager.py", line 219, in install_package shell.repository_manager_executor(cmd, self.properties, context) File "/usrbbari-agentbbari_commonsell.py", line 749, in repository_manager_executor raise RuntimeError(message) RuntimeError: Failed to execute command '/usr/bin/yum -y install phoenix_3_0_0_0_1634', exited with code '1', message: 'http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.0.0.0/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden

看到最后一行,这里的意思就是镜像网址出问题了(http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.0.0.0/repodata/repomd.xml)用的是别人的镜像,出问题很正常

RuntimeError: Failed to execute command '/usr/bin/yum -y install phoenix_3_0_0_0_1634', exited with code '1', message: 'http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.0.0.0/repodata/repomd.xml: [Errno 14] HTTP Error 403 - Forbidden

我们这里连接下master节点的数据库,即安装ambari-server节点的(一般ambari数据库都装到master节点,如果不是该节点,自行找到ambari库的节点,并连接),然后找到该表

?将该hdp-gpl的base_url替换成我们自己的yum源

?在主节点关掉ambari-server,即输入命令ambari-server stop

ambari-server stop

?然后进入/etc/yum.repos.d/目录,并删除所有?ambari-hdp-开头的文件

cd /etc/yum.repos.d/ rm -f ambari-hdp-*

再将ambari启动起来

?再重新登陆页面,会提醒你安装出问题,点击继续之类的词(此处的点击过快,忘记截图了,影响不大)

在回到首页,点击

Hosts ,先点击hdp-2?

接着再该页面选择刚刚未安装成功的hive,进行重新安装

再该页面等待安装成功即可

?

如果点出来还想看进度,点击此处就行

?这样就安装成功了

?现在是一个节点安装成功了HIVE服务基于YARN-Mapreduce2和Tez。所以像这种设置图片的都得点击重新安装?

这是全部安装好之后,其他节点也这样重新安装,如果一开始配置好了GPL就会直接安装成功。

其他像这样的红色三角形都是没启动的,这种启动也有一定顺序,一般都先启动HDFS在启动其他的

?安装教程就结束了

额外补充一句,在该页面可以,配置自启动


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #ambari安装hive #install #y #START