2013-05-22 78 views

回答

1

我從來沒有使用亞馬遜RDS,但PDI連接到大多數都使用JDBC。我假設你已經下載了證書文件。然後,關鍵是獲得一個連接URL,它將成功使用來自Java的證書。我建議編寫一個簡短的Java程序,除了連接到數據庫之外什麼也不做。這個問題可能會有所幫助:

MySQL JDBC over SSL problem

一旦你使用你的證書的URL,將其粘貼到自定義連接URL文本框中輸入PDI連接定義。請注意,要獲取自定義連接URL字段,您必須使用通用連接類型,而不是MySQL連接類型。

+0

我可不是一個Java開發人員,你有一些教程做呢? 什麼是PDI? Tkx, –

+0

PDI = Pentaho數據集成...或水壺。你檢查了答案嗎?你可以使用他們的啓動類作爲示例。你必須調查你的驅動程序需要使用哪些選項並修改它們的代碼。除非你使用MySQL驅動程序。 –

+0

是的,我使用MySql,但是當我構建這個類時,我將如何將它連接到水壺? –

0

終於搞定了。就是這樣。我不需要我的證書要做到這一點

  1. 設置ODBC DSN使用MySQL驅動程序(您可能需要從Oracle下載) 測試,以確保它的工作原理(記住,你與連接端點在RDS)

  2. 在水壺

    得到一個通用數據庫連接器(這並沒有用ODBC或JDBC的MySQL連接工作) 輸入您的新creadted DSN 輸入使用名稱和密碼

那就是它。有效!

我能夠使用我的新連接器訪問數據庫表輸入步驟的查詢。

2

建立安全連接(SSL)來AWS(RDS)極光/ MySQL的從Pentaho的(PDI水壺)

1. You need to create a new user id and Grant SSL rights to it. So this user id can connect to Aurora/MySQL only using Secured connection. 
GRANT USAGE ON *.* TO 'admin'@'%' REQUIRE SSL 
2. Download public RDS key (.pem fie) from AWS (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html#Aurora.Overview.Security.SSL) 
3. Downloaded file contains certificates/keys for each region. 
4. Split certificates from .PEM file into different .PEM files 
5. Use JDK keytool command utility to import all these PEM files into a single truststore (xyz.jks) file 
    a. keytool -import -alias xyz.jks -file abc1.pem -keystore truststore 
6. Configure JNDI entry for your Aurora/MySQL instance in Pentaho Properties File "data-integration\simple-jndi\jdbc.properties" 
    a. Sample JNDI configuration 
    ------------------------------------------------------------------------- 
    RDSSecured/type=javax.sql.DataSource 
    RDSSecured/driver=com.mysql.jdbc.Driver 
    RDSSecured/user=admin 
    RDSSecured/password=password 
    RDSSecured/url=jdbc:mysql://REPLACE_WITH_RDS_ENDPOINT_HERE:3306/DATABASE_NAME?verifyServerCertificate=true&useSSL=true&requireSSL=true 
    ------------------------------------------------------------------------- 
7. Make sure you copied MySQL connector jar in "lib" directory of your pentaho installation. Use connector version 5.1.21 or higher. 
8. 
9. Create a copy of Spoon.bat/Spoon.sh based on your operating system E.g. Spoon_With_Secured_SSL_TO_RDS.bat or Spoon_With_Secured_SSL_TO_RDS.sh 
10. Now we need to pass the truststore details to Pentaho at startup, so edit the copied script and append below mentioned arguments to OPT variable 
    a. -Djavax.net.ssl.trustStore="FULL_PATH\xyz.jks" 
    b. -Djavax.net.ssl.trustStorePassword="YOUR_TRUSTSTORE_PASSWORD" 
11. Use new script to start Spoon here after to establish the secure connection 
12. Open/create your Job/Transformation 
13. Go To View Tab - Database Connections and create new connection 
    a. Connection Type: MySQL 
    b. Access: JNDI 
    c. JNDI Name: RDSSecured 
     i. Same as name used in JDBC.properties file 
14. Test Connection and you are ready…. :)