首页 > 其他分享 >hadoop2.7.2上安装hive

hadoop2.7.2上安装hive

时间:2023-07-08 14:44:38浏览次数:46  
标签:bin app hadoop hive mysql HOME hadoop2.7 安装

hive版本1.21

mysql版本5.6.24

1.解压hive

tar -zxf apache-hive-1.2.1-bin.tar.gz  -C ../app/
cd ../app/
ln -s apache-hive-1.2.1-bin hive

2.安装mysql  注:参考Linux安装MySQL_5.6 - Watcher123 - 博客园 (cnblogs.com)

##解压安装包
tar -zxf mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz -C ../app/

##初始化
yum -y install autoconf  ##安装初始化依赖
cd ../app
ln -s mysql-5.6.24-linux-glibc2.5-x86_64 mysql

./scripts/mysql_install_db --user=hadoop --basedir=/hadoop/app/mysql --datadir=/hadoop/app/mysql/data
......
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /hadoop/app/mysql/bin/mysqladmin -u root password 'new-password'
  /hadoop/app/mysql/bin/mysqladmin -u root -h node1 password 'new-password'

Alternatively you can run:

  /hadoop/app/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; /hadoop/app/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /hadoop/app/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

[hadoop@node1 mysql]$ echo $?
0

##修改配置文件
vim /etc/my.cnf
[sudo] password for hadoop: 
[mysqld]
datadir=/hadoop/app/mysql/data
socket=/hadoop/app/mysql/data/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

user=hadoop

[mysqld_safe]
log-error=/hadoop/app/mysql/data/error.log
pid-file=/hadoop/app/mysql/data/mysql.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


##将启动脚本添加到/etc/init.d/下
cp support-files/mysql.server /etc/init.d/mysql
vim  /etc/init.d/mysql
basedir=/hadoop/app/mysql
datadir=/hadoop/app/mysql/data


###启动mysql
service mysql start
Starting MySQL.. SUCCESS! 

##配置环境变量
vim /etc/profile
export MYSQL_HOME=/hadoop/app/mysql
export PATH=$PATH:$JAVA_HOME:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$MYSQL_HOME/bin

source /etc/profile

##修改mysql密码
mysqladmin -u root password '123' -S app/mysql/data/mysql.sock  ##-S为指定需要连接的sock文件

##修改允许的连接主机
mysql -uroot -p123 -S app/mysql/data/mysql.sock
mysql> grant all privileges on *.* to 'root'@'%' identified by '123' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

使用navicat连接测试

 

 

3.配置hive

将mysql-connector-java-5.1.27-bin.jar包放在hive/lib下

进入hive/conf

touch hive-site.xml
vim hive-site.xml

<configuration>
  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:mysql://node1:3306/hive?createDatabaseIfNotExist=true</value>
    <description>JDBC connect string for a JDBC metastore</description>
  </property>
  
  <property>  
	  <name>javax.jdo.option.ConnectionDriverName</name>
	<value>com.mysql.jdbc.Driver</value>
	<description>Driver class name for a JDBCmetastore</description>
  </property>
  
  <property>
	<name>javax.jdo.option.ConnectionUserName</name>
	<value>hive</value>
	<description>username to use against metastoredatabase</description>
  </property>
  
  <property>
	<name>javax.jdo.option.ConnectionPassword</name>
	<value>123</value>
	<description>password to use against metastoredatabase</description>
  </property>

</configuration>

  

配置环境变量

vim /etc/profile

export HIVE_HOME=/hadoop/app/hive
export PATH=$PATH:$JAVA_HOME:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$MYSQL_HOME/bin:$HIVE_HOME/bin

启动hive客户端

[hadoop@node1 ~]$ hive

Logging initialized using configuration in jar:file:/hadoop/app/apache-hive-1.2.1-bin/lib/hive-common-1.2.1.jar!/hive-log4j.properties
hive>

将hive分发到其他主机

scp -r app/hive node2:/hadoop/app/hive

scp -r app/hive node3:/hadoop/app/hive

标签:bin,app,hadoop,hive,mysql,HOME,hadoop2.7,安装
From: https://www.cnblogs.com/hxy0001/p/17537210.html

相关文章

  • 解决MySQL5.5安装无响应的具体操作步骤
    MySQL5.5安装无响应MySQL是一种开源的关系型数据库管理系统,被广泛应用于Web应用程序的后台数据存储和管理。然而,在安装MySQL5.5版本时,有时候会出现无响应的情况,给用户带来困扰。本文将介绍可能导致MySQL5.5安装无响应的原因,并提供相应的解决方案。原因分析系统冲突:安装MySQL5.......
  • docker 安装pgsq
    1、拉镜像(指定版本或者不指定)dockerpullpostgresdockerpullpostgres:10.21-alpine2、根据镜像创建容器dockerrun-d-p5432:5432-vd:/mydata/postgres:/mydata/postgres/pgdata-ePOSTGRES_PASSWORD=123456--namepgsqlpostgres参数说明:-d:表示在后台运行容器;-......
  • Appium环境搭建 - Appium安装
    Appium环境搭建-Appium安装下载官方网站:http://appium.ioappium/appium-desktop(github.com) https://github.com/appium/appium-desktop/releases/tag/v1.210开启与配置参数配置platformName系统名 AndroidplatformVersion系统版本 7.1.2deviceName手......
  • docker-compose安装MySQL8并开启远程登录(1045)
    docker-compose安装MySQL8并开启远程登录(1045)编写docke-compose.yml文件vimdocker-compose.ymlversion:'3'services:mysql:image:mysql:8.0.31container_name:mysqlenvironment:#时区上海TZ:Asia/Shanghai#root密码M......
  • 2023全新FL Studio 21中文版水果编曲制作软件下载安装教程
    音乐在人们心中的地位日益增高,近几年音乐选秀的节目更是层出不穷,喜爱音乐,创作音乐的朋友们也是越来越多,音乐的类型有很多,好比古典,流行,摇滚等等。对新手友好程度基本上在首位,电音类制作支持仅次于AbletonPush,调用音色和素材很方便。因此初学阶段以及对电音需求高、依赖素材偏多的制......
  • postgresql-安装过程
    1、初始化系统配置#useradd-d/opt/postgrespostgres#yumgroupinstall-y"DevelopmentTools""LegacyUNIXCompatibility"-y#yuminstall-ybisonflexreadline*zlib-develgcc*gmake-y#mkdir/pgdata#mkdir/archive#chownpostgres.pos......
  • Ubuntu23.04 anaconda安装+国内源
    anaconda安装下载官网https://repo.anaconda.com/archive/国内镜像https://mirrors.bfsu.edu.cn/anaconda/archive/https://mirrors.xjtu.edu.cn/anaconda/archive/https://mirror.bjtu.edu.cn/anaconda/archive/https://mirrors.hit.edu.cn/anaconda/archive/https:/......
  • Linux中Postfix邮件安装配置(二)
    摘自:http://www.ywnds.com/?p=1764Postfix安装配置本套邮件系统的搭建,从如何发邮件到收邮件到认证到虚拟用户虚拟域以及反病毒和反垃圾邮件等都有详细的介绍。在搭建过程中必须的参数解释以及原理都有告诉,这样才能更好地理解邮件系统。一、卸载自带postfix 123......
  • PostgreSQL 16.2安装
    1、postgresql安装-软件包安装 1.1下载安装包,官网下载地址:https://www.postgresql.org/download/。 如果服务器有网络,可以选择yum安装。在服务器没有网络的情况下,需要先下载rpm包,我们选择这种方式。 现在最新版本是PostgreSQL16.2,2023-06-29:postgresql16-16-beta2_1......
  • 利用Docker安装Airflow
    mkdirairflowcdairflowmkdir-p./dags./logs./pluginsecho-e"AIRFLOW_UID=$(id-u)">.envwgethttps://airflow.apache.org/docs/apache-airflow/2.5.0/docker-compose.yamlsudoaptinstalldocker-composedocker-composeup在浏览器中,输入l......