跳至内容
1.host丢失心跳
解决方案:ambari-agent restart
2.ambari集群服务启动顺序
1.zookeeper
2.HDFS
3.Hive
4.HBase
5.Mapreduce
6.Yarn
7.Infra Solr
8.Kafka
9.Ranger
10.Spark2
11.SmartSense
12.Zeppelin Notebook
3.集群关闭,服务器关机重启之后,重新启动集群,疯狂报错 data-01-test:50070 拒绝连接
发现hdfs的 advance hdfs-site.xml中 dfs.hdfs-http-address处于上锁状态 ,关闭该上锁状态后,hive启动成功
服务器每次关机之后,重启服务器进入ambari管理界面,发现data-01-test总是心跳丢失
修改data-01-test 的 /etc/hosts文件,删除该文件中的 127.0.0.1 data-01-test data-01-test 行,重启ambari-agent即可识别到data-01-test的心跳
如何避免每次服务器重启hosts文件多出一行 127.0.0.1 data-01-test data-01-test (经实践验证,本方案可行)
vim /etc/cloud/cloud.cfg
注释 #manage_etc_hosts:localhost
服务器每次关机之后,重启服务器进入ambari管理界面,发现data-02-test的服务启动总是报错,报错原因为 data-01-test:50070拒绝访问
修改data-02-test 的 /etc/hosts文件,删除该文件中的 127.0.0.1 data-01-test_xxxxxx data-01-test_xxxxxxx 行,重启ambari-agent即可正常启动集群
hive使用count语法(select count(1) /count(*) 进行统计某个表的数据量 时 返回的结果始终为0)
解决办法 (对于类似于“count(1)”的基础查询不使用元数据中的统计信息,而是执行MR Job,即设置参数hive.compute.query.using.stats值为false)
普通用户无权执行hive语句的问题
hiveserver2启动失败
[hdfs@data-01-pro root]$ hdfs dfs -chmod -R 777 /warehouse/tablespace/managed hiveserver2启动成功了 ??? 没有
HiveServer2的功能介绍
解决方案
没有用
原因分析:
经对比,发现云创测试环境服务启动正常,而生产和预发布环境运行失败。大概率是昨天在50070界面 修改了 hive文件夹的权限 以及 做了groupadd supergroup导致的权限问题
测试集群输入hive时 : Connecting to jdbc:hive2://data-01-test:2181,data-02-test:2181,data-03-test:2181/default;password=root;serviceDiscoveryMode=zooKeeper;user=root;zooKeeperNamespace=hiveserver2
生产环境输入hive时: Connecting to jdbc:hive2://data-03-pro:2181,data-01-pro:2181,data-02-pro:2181/default;password=hdfs;serviceDiscoveryMode=zooKeeper;user=hdfs;zooKeeperNamespace=hiveserver2
预发布环境输入hive时:Connecting to jdbc:hive2://data-02-dev:2181,data-01-dev:2181,data-03-dev:2181/default;password=root;serviceDiscoveryMode=zooKeeper;user=root;zooKeeperNamespace=hiveserver2
Unable to read HiveServer2 configs from ZooKeeper (state=,code=0)
在data-02-pro 查看hiveserver2的启动日志,报错如下 hive-server2启动成功
The dir: /tmp/hive on HDFS should be writable. Current permissions are: rwxr-xr-x
解决方案:hadoop fs -chmod -R 777 /tmp
解决
修改datanode数据默认存储位置
云创test环境hive数据库连接异常。卡顿且无法正常连接。下午一觉醒来又突然变正常
hive-jdbc-uber.jar下载
beeline -u jdbc:hive2://cpucode100:10000 -n root
hive的配置参数回退到v9,就会一直卡在hive连接的位置 卡一会儿可以进入hive
hive的配置参数回退到v9,就会一直卡在hive连接的位置 卡一会儿可以进入hive
hive的配置参数回退到v9,就会一直卡在hive连接的位置 卡一会儿可以进入hive 较快 但无法访问 orc格式的数据
?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8
将hive的版本倒退到v3时,发现datagrip和dbeaver都可以连接hive数据库。且都能查询
ALTER TABLE c_supplier SET FILEFORMAT ORC;
CREATE TABLE `c_supplier`(
`id` double,
`ad_client_id` double,
`ad_org_id` double,
`modifierid` double,
`creationdate` string,
`modifieddate` string,
`ownerid` double,
`isactive` string,
`name` string,
`description` string,
`address` string,
`postal` string,
`phone` string,
`contacter` string,
`account` string,
`email` string,
`isstop` string,
`taxno` string,
`feeremain` double,
`mobil` string,
`c_suppliertype_id` double,
`cvenlperson` string,
`dmodifydate` string,
`dvendevdate` string,
`cvenfax` string,
`cvenbank` string,
`code` string,
`m_dim1_id` double,
`legal` string,
`relationship` string,
`city` string,
`legalperson` string,
`c_supcon_id` double,
`c_city_id` double,
`c_supattrib20_id` double,
`c_supattrib19_id` double,
`c_supattrib18_id` double,
`c_supattrib17_id` double,
`c_supattrib16_id` double,
`c_supattrib15_id` double,
`c_supattrib1_id` double,
`c_supattrib14_id` double,
`c_supattrib13_id` double,
`c_supattrib12_id` double,
`c_supattrib11_id` double,
`c_supattrib10_id` double,
`c_supattrib9_id` double,
`c_supattrib8_id` double,
`c_supattrib7_id` double,
`c_supattrib6_id` double,
`c_supattrib5_id` double,
`c_supattrib4_id` double,
`c_supattrib3_id` double,
`c_supattrib2_id` double,
`bankname1` string,
`account1` string,
`bankname2` string,
`account2` string,
`bankname3` string,
`registername` string,
`registeraddr` string,
`companyname` string,
`account3` string,
`fax` string,
`tax_rate` double,
`gl_company` string,
`suptype` string,
`is_self` string,
`is_fab` string,
`is_acc` string,
`use_status` string,
`is_working` string,
`is_towms` string,
`is_mtl` string,
`b_supcode_format_id` double,
`old_code` string,
`c_bigarea_id` double,
`deposit_bank` string,
`nc_code` string,
`nc_name` string,
`nc_supplier_type_id` double,
`nc_account_id` double,
`depositremain` double,
`c_province_id` double,
`c_district_id` double)
COMMENT ‘c_supplier’
ROW FORMAT SERDE
‘org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe’
WITH SERDEPROPERTIES (
‘field.delim’=’\u0001’,
‘line.delim’=’\n’,
‘serialization.format’=’\u0001’)
STORED AS orc
tblproperties (‘orc.compress’=’SNAPPY’);
云创设计项目生产库投入使用时,报root无权访问的错误,导致中台无法正常写入数据
根据报错发现
解决方案:[hdfs@data-01-pro root]$ hdfs dfs -chmod -R 777 /warehouse/tablespace/managed/hive
直接给已有的hive数据库赋777权限
之后新建的hive数据库都赋权就好了
运行成功
关闭集群权限控制
-Xms1G -Xmx1G
集群每次重启都要重新执行一下 ALTER TABLE c_supplier SET FILEFORMAT ORC; 这个指令才行吗?
能否将其在ambari上持久化
云创test环境中hive的hiveserver2会莫名其妙的挂掉。需要排查原因:
对hivemetastore的日志进行排查,有如下报错
文章导航