• [问题求助] spark连接dws报The authentication type 5 is not support
    业务需求从hive以及dws分别读取数据,进行关联查询分析,最后将结果写入到dws中源代码使用SparkHiveToHbaseJavaExample修改,代码中用户、密码、表名等信息已经隐去public static void main(String[] args) throws Exception { Configuration hadoopConf = new Configuration(); if ("kerberos".equalsIgnoreCase(hadoopConf.get("hadoop.security.authentication"))) { //security mode final String userPrincipal = "username"; final String USER_KEYTAB_FILE = "user.keytab"; String filePath = System.getProperty("user.dir") + File.separator; String krbFile = "/opt/Bigdata/FusionInsight_BASE/KerberosClient/etc/krb5.conf"; String userKeyTableFile = filePath + USER_KEYTAB_FILE; LoginUtil.login(userPrincipal, userKeyTableFile, krbFile, hadoopConf); } // Obtain the data in the table through the Spark interface. SparkConf conf = new SparkConf().setAppName("SparkHivetoHbase"); conf.set("spark.yarn.user.classpath.first", "true"); conf.set("spark.driver.userClassPathFirst", "true"); conf.set("spark.executor.userClassPathFirst", "true"); String sql = "select id, pap_r, rap_r from table where ds = date_format(current_date(), 'YYYYMMDD')"; SparkSession session = SparkSession.builder().config(conf).getOrCreate(); Dataset dataFrame = session.sql(sql).alias("r"); Properties pg = new Properties(); pg.setProperty("user", "username"); pg.setProperty("password", "password"); pg.setProperty("driver", "org.postgresql.Driver"); Dataset gauss = session.read() .jdbc("jdbc:postgresql://host:port/db", "dws.table1", pg) .select("id") .union(session.read() .jdbc("jdbc:postgresql://host:port/db", "dws.table2", pg) .select("id") ).alias("a"); dataFrame.join(gauss, new Column("r.id").equalTo(new Column("a.id"))) .select("r.id", "r.pap_r", "r.rap_r") .limit(10) .toJavaRDD().foreachPartition(new VoidFunction>() { public void call(Iterator iterator) throws Exception { printRow(iterator); } }); // .write() // .mode(SaveMode.Overwrite) // .jdbc("jdbc:postgresql://host:port/db", "dws.table3", pg); session.close(); }存在问题执行时报错2022-08-19 10:09:21,316 [main] INFO org.apache.spark.deploy.yarn.Client - client token: Token { kind: YARN_CLIENT_TOKEN, service: } diagnostics: User class threw exception: org.postgresql.util.PSQLException: The authentication type 5 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver. at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:556) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:195) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65) at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:124) at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:29) at org.postgresql.jdbc3g.AbstractJdbc3gConnection.(AbstractJdbc3gConnection.java:21) at org.postgresql.jdbc4.AbstractJdbc4Connection.(AbstractJdbc4Connection.java:31) at org.postgresql.jdbc4.Jdbc4Connection.(Jdbc4Connection.java:23) at org.postgresql.Driver.makeConnection(Driver.java:394) at org.postgresql.Driver.connect(Driver.java:267) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:63) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:54) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:56) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:213) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:40) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:335) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:242) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:230) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:186) at org.apache.spark.sql.DataFrameReader.jdbc(DataFrameReader.scala:257) at com.huawei.bigdata.spark.examples.SparkHivetoHbase.main(SparkHivetoHbase.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:694)参考了【业务连接】spark连接dws报The authentication type 5 is not support怀疑是驱动问题,尝试了文中提到的几种方法,在代码中增加配置参数 conf.set("spark.yarn.user.classpath.first", "true"); conf.set("spark.driver.userClassPathFirst", "true"); conf.set("spark.executor.userClassPathFirst", "true");将gsjdbc4.jar中的class打包到jar包中但仍然报相同的错误,由于打包时没有携带gsjdbc4.jar时,报的错误相同,现在我很怀疑程序运行时加载的org.postgresql.Driver驱动包仍然来自于环境变量中的jar包,而不是我打包到jar中的org.postgresql.Driver.class请问各位有没有什么解决办法或者思路,不胜感激
  • [环境搭建] DWS内核版本集群安装与问题
    1 准备安装包与环境1.1 准备如下安装包FusionInsight-MPPDB-8.1.3.tar.gzFusionInsight_SetupTool_8.1.2.2.tar.gz1.2 创建目录并上传1.2.1 以root用户登录待安装集群的任意主机,并按规划创建存放安装包的目录。为了保证安装包的完整性,建议包的存储和解压缩都在root属主的目录下进行,目录权限建议为700。mkdir -p /opt/software/GaussDB_Kernelchmod 700 -R /opt/software1.2.2 在安装包所在的目录下,解压安装包。cd /opt/software/GaussDB_Kerneltar -zxvf GaussDB-Kernel-VxxxRxxxCxx_xxx_xxx_SERVER_PACKAGE.tar.gz --no-same-owner1.2.3 如果安装的操作系统版本为麒麟V10,则需要提前联系操作系统厂商获取如下rpm文件:iputils-20190709-5.ky10.aarch64.rpmopenldap-2.4.49-4.ky10.aarch64.rpmopenldap-clients-2.4.49-4.ky10.aarch64.rpmopenldap-servers-2.4.49-4.ky10.aarch64.rpm在操作系统安装完成后,手工安装如下rpm文件:rpm -Uvh iputils-20190709-5.ky10.aarch64.rpm openldap-2.4.49-4.ky10.aarch64.rpm openldap-clients-2.4.49-4.ky10.aarch64.rpm openldap-servers-2.4.49-4.ky10.aarch64.rpm1.2.4 操作系统已安装Python3请确认操作系统是否已经安装了Python3,且安装在“/usr/bin”目录下(安装位置可执行which python3命令查看),且Python3版本为3.7.x或3.8.x。若未安装,需手动安装Python3,推荐安装Python 3.8.5,且指定“/usr/bin”目录安装,具体安装方法可参考如何批量为集群中的节点安装Python3或者官方指导文档。1.2.5 如何编译Python3下载相关软件包将下载好的软件包上传到编译机器,放在同一目录下在该目录下上传脚本build.sh运行build.sh编译Python 3.8.5[step  1]Build libffi-3.3.                       done[step  2]Build zlib-1.2.11.                      done[step  3]Build openssl-1.1.1a.                   done[step  4]Build readline-8.0.                     done[step  5]Build Python-3.8.5.                     done获得编译成功的Python 3.8.5压缩包python3.tar.gz检查编译好的python3,在python3.tar.gz同级目录下执行如下命令,不报错即可。rm -rf tmp && mkdir tmp && tar -zxf python3.tar.gz -C tmp && ./tmp/python3/bin/python3 -c "import ctypes; import ssl; import zlib"1.3 进行安装前环境检查进入到工具脚本存放目录下cd /opt/software/GaussDB_Kernel/script执行命令采用交互模式执行前置,并在执行过程中自动创建root用户互信和集群用户互信:sudo ./gs_preinstall -U omm -G dbgrp -X /opt/software/GaussDB_Kernel/clusterconfig.xml --alarm-type=1 --sep-env-file=/opt/m4c4/install/.mppdbgs_profile(--sep-env-file=/opt/m4c4/install/.mppdbgs_profile)添加后后续会报错,可以尝试1.4 执行安装1.4.1 检查安装包和集群配置文件在规划路径下是否已存在。如果没有则需要重新上传一份,并解压和修改属主为omm配置权限cd /opt/software/GaussDB_Kernel/scriptchmod -R  700 /opt/software/GaussDB_Kernel/scriptchown -R omm : dbgrp /opt/software/GaussDB_Kernel/script执行安装gs_install -X /opt/software/GaussDB_Kernel/clusterconfig.xml1.4.2 检查集群状态Gs_om –t  status  --detail1.5 安装成功配置gsql工具上传GaussDB-A-8.0.0-REDHAT-x86_64bit-ClientTools.tar.gz到/opt/gsql解压tar -zxvf GaussDB-A-8.0.0-REDHAT-x86_64bit-ClientTools.tar.gz切换用户到gsql,并打开环境变量su – ommvi ~/.bashrc填入以下内容export PATH=/opt/gsql/bin:$PATHexport LD_LIBRARY_PATH=/opt/gsql/lib:$LD_LIBRARY_PATH刷新环境变量source ~/.bashrc连接gsql -d postgres -h 10.185.180.115 -p 25308 -U omm -W Gauss_234 –r1.6 安装常见问题(FAQ)1.6.1 初始检查环境报错Password authentication failed, please try again.缺少zlib依赖,安装zlib-1.2.11即可解决1.6.2 Gs_install安装报错[GAUSS-51400] : Failed to execute the command: openssl genrsa or req or ca set failed .Error:ypenssl: relocation error: openssl: symbol EVP_md2 version OPENSSL_1 1 0 not defined in file libcrypto.so.1.1 with link time referenceOpenssl版本不兼容,重新下载老版本,并进行安装1.6.3 安装报错[GAUSS-51607] : Failed to start cluster. Error:cm_ctl: checking cluster statuscm_ctl: check finished in 155 msicm_ctl: failed to check the cluster running statusThe cluster may continue to start in the backgroundIf you want to see the cluster status, please try command gs_om -t status.If you wgnt to stop the cluster, please try command gs_om "tTstop.此时重新执行安装命令会显示cluster已安装错误执行卸载命令./gs_uninstall报错Traceback (most recent call last):  File "/usr/bin/pssh", line 24, in     from psshlib import psshutilModuleNotFoundError: No module named 'psshlib'使用pssh –help检查pssh是否安装报错下载pssh-2.3.1.tar.gz解压tar -zxvf pssh-2.3.1.tar.gz执行安装cd pssh-2.3.1/python setup.py install
  • [问题求助] 如何找出数据库中使用中文的表名和中文的列名
    如题数据库版本GuaussDB 8.1.1
  • [维护宝典] 执行作业报错Failed to connect dn_xxxx. detail: none,stream线程等待连接,状态为stream get conn
    多表join的场景下,语句报错,Failed to connect dn_xxxx, detail:none1.查询pgxc_thread_wait_status等待试图,stream线程都处于stream get conn的状态查看系统messages日志,有kernel: hns 0000:bd:00.2 enp189sof2: L3/L4 error pkt 的日志报错相关截图 客户端报错
  • [问题求助] GaussDB(DWS)日志保留周期
    请问下DWS会自动清理日志文件吗,例如运行日志、审计日志等文件。是否有参数可控制该行为?
  • [生态空间] execute direct
    execute direct 执行语句时怎么转义单引号
  • LVS负载均衡极限性能场景,cn网络传输流量大的场景下,LVS负载高
    背景DWS为多CN架构,建议在CN之上假设负载均衡组件。作用:将前端负载均匀分布到各个CN上,避免单个CN成为整个集群的瓶颈。配合CN自动剔除,可以支持单个CN故障后,不向故障CN发送任务,将CN故障对业务的影响降到最低。注意事项DWS搭配负载均衡组件时,负载均衡组件使用DR模式,客户端连接服务器时,首先会访问负载均衡服务器,负载均衡服务器将连接按照一定的算法(如轮询算法)分发到各个数据库服务器上(CN),数据返回时,不经过负载均衡服务器,直接返回到客户端。因此,如果客户端的访问请求流量较大,可能会将负载均衡服务器流量打满,而结果返回时,由于是直接返回客户端,不经过负载均衡服务器。DWS客户端访问可能导致流量大的操作场景主要是copy from、copy from任务。copy from、copy from命令用于将本地文件或数据流高效拷贝到数据库表中,因此会存在大量数据从客户端传送到服务端,如果配置了负载均衡服务器,数据会经过负载均衡服务器,当copy from、copy from任务要拷贝的文件较大、并发较高,超出了负载均衡服务器可承载的流量后,会导致负载均衡服务器成为瓶颈。因此,建议大流量的copy、copy任务直接连接固定CN IP执行。在此CN出现异常后,需要业务修改连接字符串中CN IP,将业务切换到其他CN执行。使用copy from、copy from的场景主要有:1.使用gsql客户端,调用copy from、 copy from命令向服务端传送数据。其中copy from命令只能在CN所在节点执行,copy from命令可以远程执行。示例如下:COPY tpcds.ship_mode_t1 FROM '/home/omm/ds_ship_mode.dat' WITH(format 'text', delimiter E' ', ignore_extra_data 'true', noescaping 'true'); 2.使用jdbc copy manager接口,或使用封装了jdbc copy manager接口的工具,向服务端传送数据。copy manager接口如下:CopyManager copyManager = new CopyManager((BaseConnection)connection);          fileInputStream = new FileInputStream(filePath);         copyManager.copyIn("COPY " + tableName + " FROM STDIN", fileInputStream); 3.sql on oracle, sql on other gaussdb, sql on spark这些也都是走CN和负载均衡的。若使用F5做负载均衡,请关注以上场景
  • [环境搭建] 【Gaussdb产品】【raid组选择】24块盘做2组raid5和做4组raid5哪种效率高
    搭建集群时的选择例如单DN节点有24块盘那么是选择做2组raid5(每组12块)还是做4组raid5(每组6块)。求助两种方案的读写效率对比
  • [环境搭建] 【Gaussdb产品】【raid组选择】24块盘做2组raid5和做4组raid5哪种效率高
    搭建集群时的选择例如单DN节点有24块盘那么是选择做2组raid5(每组12块)还是做4组raid5(每组6块)。求助两种方案的读写效率对比
  • [环境搭建] 【Gaussdb产品】【raid组选择】24块盘做2组raid5和做4组raid5哪种效率高
    例如单DN节点有24块盘那么是选择做2组raid5(每组12块)还是做4组raid5(每组6块)。求助两种方案的读写效率对比
  • [维护宝典] 审计日志query_id记录重复
    【问题现象】审计日志pgxc_query_audit视图中query_id列记录重复,无法确定唯一性,影响行内审计统计【原因分析】1、query_id重复的记录,是非问题。原因是语句包含SQL language的UDF(函数:oreplace、td_month_end),审计日志在设置审计userfunc时,会审计此类UDF内的语句。2、现场audit_operation_exec参数设置为all,包含了userfunc【解决方案】可以修改audit_operation_exec不审计userfunc消除此类重复记录。【拓展】修改audit_operation_exec不审计userfunc后,它仍然会审计UDF的。比如select或者dml里涉及udf,只是UDF里的语句审计不到了,用以下例子说明:但是SELECT LAST_DAY($1)::DATE;  这条记录是因为语句里用了td_month_endselect to_char(td_month_end(to_date('20220720', 'yyyymmdd') + 1), 'yyyymmdd') as "end_of_month";修改audit_operation_exec消除了udf的记录的后,SELECT LAST_DAY($1)::DATE;这条记录就会没有,也就达到了审计目的
  • [Sql迁移] 高斯dws,不支持range between n preceding and n following
    高斯版本8.1.1,在oracle可以支持range between n preceding and n following,但在高斯里只能支持unbounded,unbounded不满足要求。请问还有什么方法可以支持呢?
  • [Sql迁移] 高斯dws,不支持range between n preceding and n following
    高斯版本8.1.1,在oracle可以支持range between n preceding and n following,但在高斯里只能支持unbounded,unbounded不满足要求。请问还有什么方法可以支持呢?
  • [其他] DWS生产环境查询HDFS外表报错
    # 一、问题背景 在DWS生产环境创建HDFS外表后,查询产生如下报错: ``` ERROR: The number of partition columns defined of foreign table ~~xxx~~ is larger than it should be. ``` 不指定分布列时,查询外表不报错; # 二、排查步骤 1、HDFS侧表定义分区列是在partition by里指定,列定义时不需声明,DWS侧表定义侧列定义需声明,然后在partition by里指定; DWS侧获取外表定义(8.0以上版本可用) ``` select pg_get_tabledef(模式名.表名); ``` 2、对应HDFS侧表定义和DWS侧外表定义,定义列的顺序保持一致; 3、DWS侧不指定分布列时查询外表无报错,查询分区个数总共80个,在HDFS侧指定的外表路径下查询到分区有82个; ``` HDFS进入目录统计分区个数 DWS侧语句去重查询分区列 ``` 通过和HD侧确认,为源分区删除文件残留场景 # 三、解决方法 HDFS侧清理无效分区后,重新创建指定分布列外表,查询已无报错,查询到的分区数和HDFS侧保持一致; # 四、问题总结 该问题在生产环境较为少见,报错显示为分区列不匹配,遇到后可参考以上步骤排查,如有其它场景后续继续补充。
  • [环境搭建] 【DWS产品】【HCS-DWS810→811》】混合云HCS8.1.1环境DWS从810升级至811后,管控面报错
    【功能模块】HCS-DWS8.1.1管控面“集群管理”,“容灾管理”升级完报错【操作步骤&问题现象】1、通过HCSU工具将HCS-DWS的8.1.0版本升级至8.1.1版本,升级过程中有四个子任务(具体子任务见截图信息1)没有检查通过,误操作点击了“跳过”。2、升级完成后做基本功能验证,发现DWS管控面的“集群管理”容灾管理“等均出现报错(报错截图见截图信息2)【截图信息】1、2、【日志信息】(可选,上传日志内容或者附件)
总条数:2746 到第 页
上滑加载中