Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
867 views
in Technique[技术] by (71.8m points)

command line - databricks configure using cmd and R

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

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)

I get the following error

  Error in system(command, as.integer(flag), f, stdout, stderr, timeout) : 
  character string expected as first argument

How can I correct it?

EDIT: 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Steps for installing and configuring Azure Databricks CLI using cmd:

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.

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.

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.

  • Click the user profile icon User Profile in the upper right corner of your Azure Databricks workspace.

  • Click User Settings.

  • Go to the Access Tokens tab.

enter image description here

  • Click the Generate New Token button.
  • Optionally enter a description (comment) and expiration period.

enter image description here

  • Click the Generate button.
  • Make sure to "Copy" the generated token and store in a secure location.

Step4: Copy the URL of databricks host "https://centralus.azuredatabricks.net/" and token which created earlier step.

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

Step6: Successfully configured Databricks CLI using CMD.

To verify try to run "databricks fs ls", check whether you are able to see the DBFS.

enter image description here

Reference: Databricks CLI


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...