
yum -y install wget
安装这个包后,会获得两个mysql的yum repo源:
修改配置文件/etc/my.cnf,添加
MYSQL就可以无密码登录了
删除配置文件my.cnf中的skip-grant-tables
重启服务: systemctl restart mysqld
使用密码登录: mysql -uroot -p
注:需要关闭centos防火墙
查看版本号:
mysql -V
启动mysql服务
systemcl start mysqld.service
停止mysql服务
systemctl stop mysqld.service
重启mysql服务
systemctl restart mysqld.service
查看mysql服务当前状态
systemctl status mysqld.service
设置mysql服务开机自启动
systemctl enable mysqld.service
停止mysql服务开机自启动
systemctl disable mysqld.service
rpm -qa|grep mariadb
rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64
输出内容最后root@localhost:XXXXXXXX中的XXXX为初始密码
编写后保存
这里实验一下把hive.metastore.local参数设置为false的情况下怎么启动hive,当然首先要修改为false,
hive.metastore.local
false
controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM
并加入配置thrift server的配置:
hive.metastore.uris thrift://127.0.0.1:9083
然后启动hadoop集群,启动win上的mysql,保证集群ok,测试mysql ok
然后启动metastore:hive --service metastore
这个过程会测试连接 建立schema 建表
继续启动thrift server:hive --service hiveserver
Starting Hive Thrift Server
这里会卡住,其实这是典型的前台启动,如果退出到shell,那么server就会停止,想后台启动的话可以采用nohup方式。
最后启动hive:hive
hive>show tables
OK
tb
tb2
Time taken: 1.117 seconds
发现hive就可以启动起来了,其实我们只需要把hive理解为几个部分即可:metastore、thrift server和剩下的hive,这几个部分都是可以分开部署的,放在不同的服务器上,这样的设计增加了hive的ha和可扩展性 但是分开部署会牺牲很大的可维护性,也增加了运维的复杂性,所以一般还是把元数据留着mysql中 其他的部分放在一个jvm中。
hive也是个cs结构的东西 thrift是负责client和server通信的
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)