使用 cmd 和 R 配置数据块 [英] databricks configure using cmd and R
问题描述
我正在尝试使用 databricks cli 并调用 databricks 配置这就是我从 cmd 中做到的
I am trying to use databricks cli and invoke the databricks configure That's how I do it from cmd
somepath>databricks configure --token
Databricks Host (should begin with https://): my_https_address
Token: my_token
我想使用 R 调用相同的命令.所以我做到了:
I want to invoke the same command using R. So I did:
tool.control <- c('databricks configure --token'
,'my_https_address'
,'my_token')
shell(tool.control)
我收到以下错误
Error in system(command, as.integer(flag), f, stdout, stderr, timeout) :
character string expected as first argument
我该如何纠正?
尝试评论中的建议后,我收到此错误:
After trying the suggestion in the comment, I get this error:
Databricks Host (should begin with https://): Aborted!
'https:' is not recognized as an internal or external command,
operable program or batch file.
'my_token' is not recognized as an internal or external command,
operable program or batch file.
[[1]]
[1] 1
[[2]]
[1] 1
[[3]]
[1] 1
Warning messages:
1: In FUN(X[[i]], ...) :
'databricks configure --token' execution failed with error code 1
2: In FUN(X[[i]], ...) :
'my_https_address' execution failed with error code 1
3: In FUN(X[[i]], ...) :
'my_token' execution failed with error code 1
推荐答案
使用 cmd 安装和配置 Azure Databricks CLI 的步骤:
第一步:安装 Python,如果您使用的是 Python 2,则需要 Python 2.7.9 及更高版本;如果您使用的是 Python 3,则需要 Python 3.6 及更高版本.
Step1: Install Python, you’ll need Python version 2.7.9 and above if you’re using Python 2 or Python 3.6 and above if you’re using Python 3.
步骤 2: 使用适用于 Python 安装的 pip 版本运行 pip install databricks-cli
.如果您使用的是 Python 3,请运行 pip3 install databricks-cli
.
Step2: Run pip install databricks-cli
using the appropriate version of pip for your Python installation. If you are using Python 3, run pip3 install databricks-cli
.
步骤 3: 设置身份验证 =>要对 Databricks REST API 进行身份验证和访问,请使用个人访问令牌.令牌类似于密码;你应该小心对待他们.令牌过期并且可以撤销.
Step3: Setup authentication => To authenticate and access Databricks REST APIs, you use personal access tokens. Tokens are similar to passwords; you should treat them with care. Tokens expire and can be revoked.
点击右上角的用户个人资料图标 User Profile您的 Azure Databricks 工作区.
Click the user profile icon User Profile in the upper right corner of your Azure Databricks workspace.
点击用户设置.
转到访问令牌选项卡.
- 点击生成新令牌按钮.
- 可选择输入说明(评论)和有效期.
- 点击生成"按钮.
- 确保复制"生成的令牌并存储在安全位置.
- Click the Generate button.
- Make sure to "Copy" the generated token and store in a secure location.
步骤 4: 复制数据块主机 "https://centralus.azuredatabricks.net/"
的 URL 和创建先前步骤的令牌.
Step4: Copy the URL of databricks host "https://centralus.azuredatabricks.net/"
and token which created earlier step.
步骤 5: 在 cmd 中运行dbfs configure --token";如下图:
Step5: In cmd run "dbfs configure --token" as shown below:
dbfs configure --token
Databricks Host (should begin with https://): https://centralus.azuredatabricks.net
Token: dapi72026dsfsdfsh987hjfiu431
步骤 6: 使用 CMD 成功配置 Databricks CLI.
Step6: Successfully configured Databricks CLI using CMD.
要验证尝试运行databricks fs ls",请检查您是否能够看到 DBFS.
To verify try to run "databricks fs ls", check whether you are able to see the DBFS.
参考: Databricks CLI
这篇关于使用 cmd 和 R 配置数据块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!