Talend Studio 允许您使用连接创建脚本一次性创建个多个连接。
下面的例子演示了如何使用脚本一次性创建一个本地连接和一个 Talend Administration Center 连接。
过程
-
创建一个脚本文件,用 JSON 格式定义连接详细信息。
在此例中,将该脚本命名为 myConnections.json,将其放在 Talend Studio 安装目录中。
[ { "name": "localConnection", "description": "My local connection", "local": true, "user": "user@talend.com", "workSpace": "D:\\Talend\\workspace" }, { "name": "remoteConnection", "description": "My TAC connection", "local": false, "user": "studiouser@company.com", "password": "mypassword", "workSpace": "D:\\Talend\\remoteworkspace", "url": "http://192.128.8.88:8081/org.talend.administrator" } ]
警告: 确保工作区目录路径不包含空格或特殊字符,否则可能导致 Talend Studio 由于 JVM 兼容性问题而无法工作。 -
在 Talend Studio 安装目录中,运行以下命令:
注: 此例子假设您在 Microsoft Windows 上使用 Talend Studio。如果您在其他操作系统上工作,请使用对应于您的操作系统的 Talend Studio 可执行文件。
Talend-Studio-win-x86_64.exe -nosplash -application org.talend.commandline.GenerateConnection -consoleLog -data commandline-workspace -f myConnections.json
- 启动 Talend Studio.
- 在 Talend Studio 登录窗口中,单击 Manage Connections (管理连接) 按钮以打开 Connections (连接) 窗口并检查您的连接。
结果
脚本文件中定义的连接已创建并显示在 Connections (连接) 窗口中。