zoukankan      html  css  js  c++  java
  • 【转】使用kettle工具遇到的问题汇总及解决方案

     

    使用kettle工具遇到的问题汇总及解决方案

    问题1是     执行./spoon.sh报错

    问题2是     测试数据库连接性报错

    问题3是    在使用kettle导入数据过程中报错

    问题1-1

    执行./spoon.sh报如下错误

    xlib:connection to "0.0"refused by server

    xlib:No protocol specified

    org.eclipse.swt.SWTError:Nomore handles [gtk_init_check() failed]

    解决方案

    [telepow@bodaodao data-integration]$exit

    logout

    [root@bodaodao kettle]#xhost+

    access controldisabled,clients can connect from any host

    [root@]su - telepow

    [telepow@bodaodao]cd/opt/kettle/data-integration/

    [telepow@bodaodao]./spoon.sh

    问题1-2

    执行./spoon.sh报如下错误

    “A fatal error has beendetected by the Java Runtime Environment”

    原因分析:

    这应该时GNOME或者X的库和Spoon集成的浏览器不能一起工作导致的。所以需要编辑(或创建)~/.kettle/.spoonrc,并在里面输入以下内容:

    ShowWelcomePageOnStartup=N

    具体操作:

    [telepow@mic1 ~]$ cd .kettle/

    [telepow@mic1 .kettle]$ pwd

    /home/telepow/.kettle

    [telepow@mic1 .kettle]$ touch.spoonrc

    [telepow@mic1 .kettle]$ vi.spoonrc

    ShowWelcomePageOnStartup=N

    参考文档http://www.linuxidc.com/Linux/2012-10/72455.htm

    问题2-1

    创建PostgreSQL数据库连接,测试数据库连接报如下错误

    Connect refused,Check thatthe hostname and port are correct and that the postmaster is accepint TCP/IP

    [root@pgsql data]# pwd

    /usr/local/postgresql/data

    [root@pgsql data]# vipostgresql.conf

    listen_addresses = '*'

    port = 5432

    [root@pgsql data]# servicepostgresql stop

    Stopping PostgreSQL: ok

    [root@pgsql data]# servicepostgresql start

    Starting PostgreSQL: ok

    问题2-2

    创建PostgreSQL数据库连接,测试数据库连接报如下错误

    Errot connecting to database(using class org.postgresql.Driver)

    FATAL:no pg_hba.conf entryfor host "192.168.56.102" ,user "root" ,database "test_db"

    [root@pgsql data]# cppg_hba.conf pg_hba.conf.bak

    [root@pgsql data]# vipg_hba.conf

    # IPv4 local connections:

    host    all             all             127.0.0.1/32            trust

    host    all             all            192.168.56.102/32       trust

    /*192.168.56.102为kettle所在服务器,允许该服务器连接

    [root@pgsql data]# servicepostgresql stop

    Stopping PostgreSQL: ok

    [root@pgsql data]# servicepostgresql start

    Starting PostgreSQL: ok

    问题2-3

    创建Oracle数据库连接,测试数据库连接报如下错误

     exceptionwhile loading class

     oracle.rdb.jdbc.rdbThin.Driver

    检查驱动,首先发现 Kettle 默认不带 Oracle 驱动。于是我把 Oracle 的 JDBC 驱动 ojdbc5.jar/ojdbc6.jar 放到了 Kettle 的目录data-integrationlibextJDBC 下

    具体操作

    # mv ojdbc6.jar/opt/kettle/data-integration/libext/JDBC/

    重启机器 OK

    连接oracle,可以先创建数据库连接,在选择数据库连接,数据库名数据库名是“SID_NAME,而不是 PL/SQL 的 “SERVICE_NAME

    问题2-4

    创建MySQL数据库连接,测试数据库连接,报如下错误

    Exception while loading class

    org.gjt.mm.mysql.Driver

    org.pentaho.di.core.exception.KettleDatabaseException

    解决

    把mysql.jar(网上下的)放在/data-xxx/libext/JDBC/在目录下并重启机器

    问题2-5

    创建Mysql数据库连接,测试数据库连接,报如下错误

    Error connecting to database

    message from server host192.168.56.102 is not allowed to this mysql server

    解决

    如果你想允许用户myuser从ip为192.168.56.102的主机连接到mysql服务器,并使用mypassword作为密码

    GRANT ALL PRIVILEGES ON *.*TO 'root'@'192.168.56.102' IDENTIFIED BY '123456' WITH GRANT OPTION;

    参考http://www.blogjava.net/acooly/archive/2008/09/17/229368.html

    问题2-6

    创建Mysql数据库连接,测试数据库连接,报如下错误

    Access denied for userdfa@192.168.56.102(using password:YES)

    用户名错误,修正用户dfa为正确用户root(本例用户为root)即可。

    问题3-1

    在使用kettle导入数据过程中报错
    “ERROR INSERTING /UPDATING ROW”INCORRECT STRING VALUE “xF1xBCxBDxA8' for culumn keywords at row1,
    1,将keywords字段的字符集改为utf8mb4
    2,在Kettle的数据库连接高级设置中,设置当前会话字符集为utf8mb4 
    具体操作
    1,ALTER TABLE dt_se CHANGE keywords keywords  VARCHAR(550) CHARACTER SET utf8mb4;
    2,Edit数据库连接--->Advanced----->set names utf8mb4; 设置当前会话字符集为utf8mb4

    参考文档:http://vase.iteye.com/blog/2006972

    问题3-2

    在使用kettle导入数据过程中报错(连的好好的,突然在插入数据不能使用了)

    Error looking up row in database

    communications link failure

    causedby:com.mysql.jdbc.exceptions,jdbc4.communicationsException:communications linkfailure

    Last packet sent to the server was 0 msago.

    原因分析:mysql 连接时间问题,应用程序和MySQL数据库建立连接,如果超过8小时应用程序不去访问数据库,数据库就断掉连接,缺省mysql的timeout时间是28800秒,也就是8小时。

    解决方法:我们改成8000小时

    cd /usr/local/mysql

    vi my.cnf

    [mysqld]

    interactive_timeout=28800000

    wait_timeout=28800000

    不需要重启mysql服务

    参考文档:http://hi.baidu.com/onezero520/item/fa82b6dd03409715e1f46f08

  • 相关阅读:
    CodeFirst从零搭建ASP.NETCore2.0
    ASP.NetCore2.0概览
    C#图片处理(转zhjzwl/archive)
    数据库内部视图,存储过程的使用
    《用户体验要素》学习笔记 —— 初识五层要素
    《用户体验要素》学习笔记 —— 用户体验重要性
    To B产品,业务方全程蒙蔽怎么搞?
    产品经理需要的技能,我有吗?
    拼多多为何没有购物车功能
    章节十四、3-执行JavaScript命令
  • 原文地址:https://www.cnblogs.com/liangqihui/p/7289199.html
Copyright © 2011-2022 走看看