라이브러리 CLI(레거시)
Important
이 설명서는 사용 중지되었으며 업데이트되지 않을 수 있습니다.
이 정보는 레거시 Databricks CLI 버전 0.18 이하에 적용됩니다. Databricks는 최신 Databricks CLI 버전 0.205 이상을 대신 사용하는 것이 좋습니다. Databricks CLI란?을 참조하세요. Databricks CLI 버전을 찾으려면 다음을 실행 databricks -v
합니다.
Databricks CLI 버전 0.18 이하에서 Databricks CLI 버전 0.205 이상으로 마이그레이션하려면 Databricks CLI 마이그레이션을 참조하세요.
Databricks 라이브러리 CLI 하위 명령은 databricks libraries
에 추가하여 실행합니다. 이러한 하위 명령은 라이브러리 API를 호출합니다.
databricks libraries -h
Usage: databricks libraries [OPTIONS] COMMAND [ARGS]...
Utility to interact with libraries.
Options:
-v, --version [VERSION]
-h, --help Show this message and exit.
Commands:
all-cluster-statuses Get the status of all libraries.
cluster-status Get the status of all libraries for a cluster.
Options:
--cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
install Install a library on a cluster.
Options:
--cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
--jar TEXT JAR on DBFS or WASB.
--egg TEXT Egg on DBFS or WASB.
--whl TEXT Wheel or zipped wheelhouse on DBFS or WASB. Supported in CLI 0.8.2 and above.
--maven-coordinates TEXT Maven coordinates in the form of GroupId:ArtifactId:Version (i.e.org.jsoup:jsoup:1.7.2).
--maven-repo TEXT Maven repository to install the Maven package from. If omitted, both Maven Repository and Spark Packages are searched.
--maven-exclusion TEXT List of dependences to exclude. For example: --maven-exclusion "slf4j:slf4j" --maven-exclusion "*:hadoop-client".
--pypi-package TEXT The name of the PyPI package to install. An optional exact version specification is also supported. Examples "simplejson" and "simplejson==3.8.0".
--pypi-repo TEXT The repository where the package can be found. If not specified, the default pip index is used.
--cran-package TEXT The name of the CRAN package to install.
--cran-repo TEXT The repository where the package can be found. If not specified, the default CRAN repo is used.
list Shortcut to `all-cluster-statuses` or `cluster-status`.
Options:
--cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.
uninstall Uninstall a library on a cluster.
Options:
--cluster-id CLUSTER_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration. [required]
--all Uninstall all libraries.
--jar TEXT JAR on DBFS or WASB.
--egg TEXT Egg on DBFS or WASB.
--whl TEXT Wheel or zipped wheelhouse on DBFS or WASB. Supported in CLI 0.8.2 and above.
--maven-coordinates TEXT Maven coordinates in the form of GroupId:ArtifactId:Version (i.e.org.jsoup:jsoup:1.7.2).
--maven-repo TEXT Maven repository to install the Maven package from. If omitted, both Maven Repository and Spark Packages are searched.
--maven-exclusion TEXT List of dependences to exclude. For example: --maven-exclusion "slf4j:slf4j" --maven-exclusion "*:hadoop-client".
--pypi-package TEXT The name of the PyPI package to install. An optional exact version specification is also supported. Examples "simplejson" and "simplejson==3.8.0".
--pypi-repo TEXT The repository where the package can be found. If not specified, the default pip index is used.
--cran-package TEXT The name of the CRAN package to install.
--cran-repo TEXT The repository where the package can be found. If not specified, the default CRAN repo is used.
모든 클러스터에 있는 모든 라이브러리의 상태 나열
사용 설명서를 표시하려면 databricks libraries all-cluster-statuses --help
를 실행합니다.
databricks libraries all-cluster-statuses
{
"statuses": [
{
"cluster_id": "1234-567890-lest123",
"library_statuses": [
{
"library": {
"jar": "dbfs:/FileStore/jars/bbf81650_a62b_4b7a_b47e_7bdd9505792a-SparkJDBC42.jar"
},
"status": "INSTALLED",
"is_library_for_all_clusters": true
},
...
]
},
...
]
}
클러스터에 있는 모든 라이브러리의 상태 나열
사용 설명서를 표시하려면 databricks libraries cluster-status --help
또는 databricks libraries list --help
를 실행합니다.
databricks libraries cluster-status --cluster-id 1234-567890-lest123
또는
databricks libraries list --cluster-id 1234-567890-lest123
{
"cluster_id": "1234-567890-lest123",
"library_statuses": [
{
"library": {
"jar": "dbfs:/FileStore/jars/bbf81650_a62b_4b7a_b47e_7bdd9505792a-SparkJDBC42.jar"
},
"status": "INSTALLED",
"is_library_for_all_clusters": false
},
...
]
}
클러스터에 라이브러리 설치
사용 설명서를 표시하려면 databricks libraries install --help
를 실행합니다.
databricks libraries install --cluster-id 1234-567890-lest123 --jar dbfs:/test-dir/test.jar
성공하면 출력이 표시되지 않습니다.
클러스터에서 라이브러리 제거
사용 설명서를 표시하려면 databricks libraries uninstall --help
를 실행합니다.
databricks libraries uninstall --cluster-id 1234-567890-lest123 --jar dbfs:/test-dir/test.jar
WARNING: Uninstalling libraries requires a cluster restart.
databricks clusters restart --cluster-id 1234-567890-lest123