使用cmd和R配置databricks [英] databricks configure using cmd and R

查看:139
本文介绍了使用cmd和R配置databricks的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用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的步骤:

第1步::安装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.

第二步::使用适合您的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.

  • 单击位于右上角的用户个人资料图标用户个人资料" 您的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

Reference: Databricks CLI

希望这会有所帮助.

如果这回答了您的查询,请单击标记为答案"和向上投票".而且,如果您有其他疑问,请告诉我们.

If this answers your query, do click "Mark as Answer" and "Up-Vote" for the same. And, if you have any further query do let us know.

这篇关于使用cmd和R配置databricks的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆