docker部署flask_使用Docker,GCP Cloud Run和Flask部署Scikit-Learn NLP模型

docker部署flask

A brief guide to building an app to serve a natural language processing model, containerizing it and deploying it.

構建用于服務自然語言處理模型,將其容器化和部署的應用程序的簡要指南。

By: Edward Krueger and Douglas Franklin.

作者: 愛德華·克魯格 ( Edward Krueger)和道格拉斯·富蘭克林 ( Douglas Franklin) 。

If you need help building an NLP pipeline or evaluating models check out our last article. We covered some NLP basics and how to build an NLP pipeline with Scikit-Learn. Then we evaluated some model metrics and decided on the best model for our problem and data.

如果您需要建立NLP管道或評估模型的幫助,請查看我們的上一篇文章 。 我們介紹了一些NLP基礎知識,以及如何使用Scikit-Learn構建NLP管道。 然后,我們評估了一些模型指標,并為我們的問題和數據確定了最佳模型。

Be sure to check out the README and code in our GitHub repository instructions on setting up this app locally with Docker!

請務必查看自述文件和GitHub存儲庫中的代碼,以了解如何使用Docker在本地設置此應用程序!

Before deploying our model to the cloud, we need to build an app to serve our model.

在將我們的模型部署到云之前,我們需要構建一個應用程序來服務我們的模型。

構建應用 (Building the App)

The application to serve this model is simple. We just need to import our model into the app, receive a POST request and return the model’s response to that POST.

服務于該模型的應用程序很簡單。 我們只需要將模型導入應用程序,接收POST請求,然后將模型的響應返回給該POST。

Here is the app code.

這是應用程序代碼。

https://gist.github.com/DougAF/1f27f7bf79603c996518c6e5eeacbf69.js"></script>https://gist.github.com/DougAF/1f27f7bf79603c996518c6e5eeacbf69.js “> </ script>

Notice that the data_dict is the Python dictionary corresponding to the payload sent via the POST request. From this dictionary we can extract the text to be categorized. This means our POSTs need the same key. So we are going to send JSONs with the {key: value} being {"text": "message") .

請注意, data_dict是與通過POST請求發送的有效負載相對應的Python字典。 從這本字典中,我們可以提取要分類的文本。 這意味著我們的POST需要相同的密鑰。 因此,我們將發送{key: value}{"text": "message") JSON。

Since the Scikit-Learn pipeline expects a list of strings we have to wrap the text as a list. Also, when receiving the result from the model’s .predict method, we receive a list with a single element and unpack it to access the prediction.

由于Scikit-Learn管道需要字符串列表,因此我們必須將文本包裝為列表。 另外,從模型的.predict方法接收結果時,我們會收到一個包含單個元素的列表,并將其解包以訪問預測。

Once we have the app running locally without bugs, we are ready to make some changes to our repository to prepare for deployment.

一旦我們使應用程序在本地運行且沒有錯誤,就可以對存儲庫進行一些更改以準備部署。

Keep in mind we are using the package and environment manager pipenv to handle our app’s dependencies. If you are not familiar with virtual environment and package management, you may need to install this and set up a virtual environment using the Pipfile in the Github repository. Check out this article for help doing that!

請記住,我們正在使用程序包和環境管理器pipenv處理我們應用程序的依賴項。 如果您不熟悉虛擬環境和軟件包管理,則可能需要安裝此文件并使用Gi??thub存儲庫中的Pipfile設置虛擬環境。 請查看本文以獲取幫助!

容器化應用 (Containerizing the App)

We need to make some final changes to our project files in preparation for deployment. In our project, we’ve used pipenv and pipenv-to-requirements to handle dependencies and generate a requirements.txt. All you'll need for your Docker container is the requirements.txt file.

我們需要對我們的項目文件進行一些最終更改,以準備進行部署。 在我們的項目中,我們使用pipenv和pipenv-to-requirements來處理依賴關系并生成requirements.txt 。 您的Docker容器所需的全部是requirements.txt文件。

Be sure to git add the Dockerfile you made earlier to your repository.

確保將之前創建的Dockerfile添加到倉庫中。

Here is the link to our Pipfile for dependencies on this project.

這是指向該項目依賴項的Pipfile的鏈接。

Docker和Dockerfiles (Docker and Dockerfiles)

Before we get the app running in the cloud, we must first Dockerize it. Check out our README in the GitHub repository for instructions on setting up this app locally with Docker.

在使應用程序在云中運行之前,我們必須首先對其進行Dockerize。 請查看GitHub存儲庫中的自述文件,以獲取有關使用Docker在本地設置此應用程序的說明。

Image for post
Photo by Steve Halama on Unsplash
Steve Halama在Unsplash上??拍攝的照片

Docker is the best way to put apps into production. Docker uses a Dockerfile to build a container. The built container is stored in Google Container Registry were it can be deployed. Docker containers can be built locally and will run on any system running Docker.

Docker是將應用程序投入生產的最佳方式。 Docker使用Dockerfile來構建容器。 構建的容器可以存儲在Google Container Registry中。 Docker容器可以在本地構建,并且可以在運行Docker的任何系統上運行

Here is the Dockerfile we used for this project:

這是我們用于該項目的Dockerfile:

The first line of every Dockerfile begins with FROM. This is where we import our OS or programming language. The next line, starting with ENV, sets our environment variable ENV to APP_HOME / app . This mimics the structure of our project directories, letting Docker know where our app is.

每個Dockerfile的第一行都以FROM.開頭FROM. 這是我們導入操作系統或編程語言的地方。 從ENV開始的下一行將環境變量ENV設置為APP_HOME / app 。 這模仿了項目目錄的結構,讓Docker知道我們的應用程序在哪里。

These lines are part of the Python cloud platform structure and you can read more about them in Google’s cloud documentation.

這些行是Python云平臺結構的一部分,您可以在Google的云文檔中了解有關它們的更多信息。

The WORKDIR line sets our working directory to $APP_HOME. Then, the Copy line makes local files available in the docker container.

WORKDIR行將我們的工作目錄設置為$APP_HOME 。 然后,復制行使本地文件在Docker容器中可用。

The next two lines involve setting up the environment and executing it on the server. The RUN command can be followed with any bash code you would like executed. We use RUN to pip install our requirements. Then CMD to run our HTTP server gunicorn. The arguments in this last line bind our container to$PORT, assign the port a worker, specify the number of threads to use at that port and state the path to the app asapp.main:app.

接下來的兩行涉及設置環境并在服務器上執行環境。 您可以在RUN命令后跟隨您要執行的任何bash代碼。 我們使用RUN點子安裝我們的要求。 然后CMD運行我們的HTTP服務器gunicorn。 最后一行中的參數將我們的容器綁定到$PORT$PORT分配一個工作線程,指定在該端口上使用的線程數,并將應用程序的路徑聲明為app.main:app

You can add a .dockerignore file to exclude files from your container image. The .dockerignore is used to keep files out of your container. For example, you likely do not want to include your test suite in your container.

您可以添加.dockerignore文件以從容器映像中排除文件。 .dockerignore用于將文件保留在容器之外。 例如,您可能不想在容器中包含測試套件。

To exclude files from being uploaded to Cloud Build, add a.gcloudignore file. Since Cloud Build copies your files to the cloud, you may want to omit images or data to cut down on storage costs.

要排除文件無法上傳到Cloud Build,請添加.gcloudignore文件。 由于Cloud Build將文件復制到云中,因此您可能希望省略圖像或數據以降低存儲成本。

If you would like to use these, be sure to check out the documentation for .dockerignore and .gcloudignorefiles, however, know that the pattern is the same as a.gitignore !

如果您想使用這些文件,請務必查看.dockerignore.gcloudignore文件的文檔,但是,請知道該模式與.gitignore相同!

在本地構建和啟動Docker容器 (Building and Starting the Docker Container Locally)

Name and build the container with this line. We are calling our container spam-detector.

用此行命名并構建容器。 我們稱我們的容器為spam-detector

docker build . -t spam-detector

To start our container we must use this line to specify what ports the container will use. We set the internal port to 8000 and the external port to 5000. We also set the environment variable PORT to 8000 and enter the container name.

要啟動我們的容器,我們必須使用此行來指定容器將使用的端口。 我們將內部端口設置為8000,將外部端口設置為5000。我們還將環境變量PORT設置為8000,然后輸入容器名稱。

PORT=8000 && docker run -p 5000:${PORT} -e PORT=${PORT} spam-detector

Now our app should be up and running in our local Docker container.

現在,我們的應用程序應該已經在本地Docker容器中啟動并運行了。

Let’s send some JSONs to the app at the localhost address provided in the terminal where you’ve run the build.

讓我們通過運行構建的終端中提供的localhost地址向應用發送一些JSON。

使用Postman測試應用 (Testing the app with Postman)

Postman is a software development tool that enables people to test calls to APIs. Postman users enter data. The data is sent to a web server address. Information is returned as a response or an error, which Postman presents to the user.

Postman是一種軟件開發工具,使人們可以測試對API的調用。 郵遞員用戶輸入數據。 數據被發送到Web服務器地址。 信息作為響應或錯誤返回,郵遞員將其呈現給用戶。

Postman makes it easy to test our route. Open up the GUI and

郵遞員可以輕松測試我們的路線。 打開GUI,然后

  • Select POST and paste the URL, adding the route as needed

    選擇POST并粘貼URL,根據需要添加路由
  • Click Body and then raw

    單擊主體,然后單擊原始
  • Select JSON from the dropdown to the right

    從右側的下拉列表中選擇JSON

Be sure to use “text” as the key in your JSON, or the app will throw an error. Place any text you would like the model to process as the value. Now hit send!

確保在JSON中使用“文本”作為鍵,否則應用程序將引發錯誤。 將您希望模型處理的任何文本作為值。 現在點擊發送!

Image for post
Sending a JSON post request with Postman
使用Postman發送JSON發布請求

Then view the result in Postman! It looks like our email was categorized as ham. If you receive an error be sure you’ve used the correct key and have the route extension /predict in the POST URL.

然后在郵遞員中查看結果! 看來我們的電子郵件被歸類為火腿。 如果收到錯誤,請確保您使用了正確的密鑰,并且在POST URL中具有路由擴展名/predict

Image for post
The email is safe ˉ\_(ツ)_/ˉ
電子郵件是安全的\\ _(ツ)_ /ˉ

Let’s try an email from my Gmail spam folder.

讓我們嘗試從我的Gmail垃圾郵件文件夾發送一封電子郵件。

Image for post

Hmm, it looks like we are running a different model than Google.

嗯,看來我們運行的模型與Google不同。

Now let’s test the app without Postman using just the command line.

現在,讓我們僅使用命令行在沒有Postman的情況下測試應用程序。

使用curl測試應用 (Testing the app with curl)

Curl can be a simple tool for testing that allows us to remain in a CLI. I had to do some tweaking to get the command to work with the app, but adding the flags below resolved the errors.

Curl可以是一個簡單的測試工具,可以讓我們保留在CLI中。 我必須進行一些調整才能使命令與應用程序一起使用,但是在下面添加標志可以解決錯誤。

Open the terminal and insert the following. Change the text value to see what the model classifies as spam and ham.

打開終端并插入以下內容。 更改文本值以查看模型歸類為垃圾郵件和火腿的內容。

curl -H "Content-Type: application/json" --request POST -d '{"text": "Spam is my name now give all your money to me"}' http://127.0.0.1:5000/predict

The result, or an error, will populate in the terminal!

結果或錯誤將在終端中填充!

{"result":"ham"}

Now let’s get the app deployed to Google Cloud Platform so anyone can use it.

現在,讓我們將應用程序部署到Google Cloud Platform,以便任何人都可以使用它。

Docker Images和Google Cloud Registry (Docker Images and Google Cloud Registry)

GCP Cloud Build allows you to build containers remotely using the instructions contained in Dockerfiles. Remote builds are easy to integrate into CI/CD pipelines. They also save local computational time and energy as Docker uses lots of RAM.

GCP Cloud Build允許您使用Dockerfiles中包含的說明遠程構建容器。 遠程構建易于集成到CI / CD管道中。 由于Docker使用大量RAM,它們還節省了本地計算時間和精力。

Once we have our Dockerfile ready, we can build our container image using Cloud Build.

一旦我們準備好Dockerfile,就可以使用Cloud Build構建我們的容器映像。

Run the following command from the directory containing the Dockerfile:

從包含Dockerfile的目錄中運行以下命令:

gcloud builds submit --tag gcr.io/PROJECT-ID/container-name

Note: Replace PROJECT-ID with your GCP project ID and container-name with your container name. You can view your project ID by running the command gcloud config get-value project.

注意:將PROJECT-ID替換為GCP項目ID,并將container-name替換為容器名稱。 您可以通過運行命令gcloud config get-value project來查看您的項目ID。

This Docker image now accessible at the GCP container registry or GCR and can be accessed via URL with Cloud Run.

現在,可以在GCP容器注冊表或GCR上訪問此Docker映像,并且可以通過Cloud Run通過URL訪問。

使用CLI部署容器映像 (Deploy the container image using the CLI)

  1. Deploy using the following command:

    使用以下命令進行部署:
gcloud run deploy --image gcr.io/PROJECT-ID/container-name --platform managed

Note: Replace PROJECT-ID with your GCP project ID and container-name with your containers’ name. You can view your project ID by running the command gcloud config get-value project.

注意:將PROJECT-ID替換為GCP項目ID,并將container-name替換為容器的名稱。 您可以通過運行命令gcloud config get-value project來查看您的項目ID。

2. You will be prompted for service name and region: select the service name and region of your choice.

2.系統將提示您輸入服務名稱和區域:選擇所需的服務名稱和區域。

3. You will be prompted to allow unauthenticated invocations: respond y if you want public access, and n to limit IP access to resources in the same google project.

3.系統將提示您允許未經授權的調用 :響應y如果你想公共訪問, n限制IP訪問的資源在同谷歌項目。

4. Wait a few moments until the deployment is complete. On success, the command line displays the service URL.

4.等待片刻,直到完成部署。 成功后,命令行將顯示服務URL。

5. Visit your deployed container by opening the service URL in a web browser.

5.通過在Web瀏覽器中打開服務URL,訪問已部署的容器。

使用GUI部署容器映像 (Deploy the container image using the GUI)

Now that we have a container image stored in GCR, we are ready to deploy our application. Visit GCP cloud run and click create service, be sure to set up billing as required.

現在我們已經在GCR中存儲了一個容器映像,現在可以部署我們的應用程序了。 訪問GCP云運行并點擊創建服務,請確保根據需要設置結算信息。

Image for post

Select the region you would like to serve and specify a unique service name. Then choose between public or private access to your application by choosing unauthenticated or authenticated, respectively.

選擇您要提供服務的區域并指定唯一的服務名稱。 然后,分別通過選擇未認證或已認證來選擇對應用程序的公共或私人訪問。

Now we use our GCR container image URL from above. Paste in the URL or click select and find it using a dropdown list. Check out the advanced settings to specify server hardware, container port and additional commands, maximum requests and scaling behaviors.

現在,我們從上方使用GCR容器圖片網址。 粘貼在URL中,或單擊“選擇”并使用下拉列表找到它。 檢查高級設置以指定服務器硬件,容器端口和其他命令,最大請求數和擴展行為。

Click create when you’re ready to build and deploy!

準備好構建和部署時,請單擊創建!

Image for post
Selecting a Container image from GCR
從GCR選擇容器圖像

You’ll be brought to the GCP Cloud Run service details page where you can manage the service and view metrics and build logs.

您將被帶到GCP Cloud Run服務詳細信息頁面,您可以在其中管理服務并查看指標和構建日志。

Image for post
Services details
服務詳情

Click the URL to view your deployed application!

單擊URL查看已部署的應用程序!

Image for post
Woohoo!
hoo!

Congratulations! You have just deployed an application packaged in a container to Cloud Run.

恭喜你! 您剛剛將打包在容器中的應用程序部署到了Cloud Run。

You only pay for the CPU, memory, and networking consumed during request handling. That being said, be sure to shut down your services when you do not want to pay for them!

您只需為請求處理期間消耗的CPU,內存和網絡付費。 話雖如此,當您不想為服務付費時,請務必將其關閉!

結論 (Conclusion)

We’ve covered setting up an app to serve a model and building docker containers locally. Then we dockerized our app and tested it locally. Next, we stored our docker image in the cloud and used it to build an app on Google Cloud Run.

我們已經介紹了設置應用程序以提供模型并在本地構建Docker容器的內容。 然后,我們對應用程序進行了docker化并在本地進行了測試。 接下來,我們將docker映像存儲在云中,并使用它在Google Cloud Run上構建應用程序。

Getting any decently good model out quickly can have significant business and tech value. Value from having something people can immediately use and from having software deployed that a data scientist can tune later.

快速推出任何體面的好的模型可以具有巨大的業務和技術價值。 擁有人們可以立即使用的東西以及部署數據科學家可以稍后進行調整的軟件的價值。

We hope this content is informative and helpful, let us know what you are looking to learn more about in the software, development and machine learning space!

我們希望該內容能為您提供有用的信息,讓我們知道您想在軟件,開發和機器學習領域中進一步學習的內容!

翻譯自: https://towardsdatascience.com/deploy-a-scikit-learn-nlp-model-with-docker-gcp-cloud-run-and-flask-ba958733997a

docker部署flask

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/387907.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/387907.shtml
英文地址,請注明出處:http://en.pswp.cn/news/387907.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

異常處理的原則

1&#xff1a;函數內部如果拋出需要檢測的異常&#xff0c;那么函數上必須要聲明&#xff0c;否則必須在函數內用try catch捕捉&#xff0c;否則編譯失敗。2&#xff1a;如果調用到了聲明異常的函數&#xff0c;要么try catch 要么throws&#xff0c;否則編譯失敗。3&#xff…

模塊化整理

#region常量#endregion#region 事件#endregion#region 字段#endregion#region 屬性#endregion#region 方法#endregion#region Unity回調#endregion#region 事件回調#endregion#region 幫助方法#endregion來自為知筆記(Wiz)轉載于:https://www.cnblogs.com/soviby/p/10013294.ht…

在oracle中處理日期大全

在oracle中處理日期大全 TO_DATE格式 Day: dd number 12 dy abbreviated fri day spelled out friday ddspth spelled out, ordinal twelfth Month: mm number 03 mon abbreviated mar month spelled out march Year: yy two digits 98 yyyy four …

BZOJ4868 Shoi2017期末考試(三分+貪心)

容易想到枚舉最晚發布成績的課哪天發布&#xff0c;這樣與ti和C有關的貢獻固定。每門課要么貢獻一些調節次數&#xff0c;要么需要一些調節次數&#xff0c;剩下的算貢獻也非常顯然。這樣就能做到平方級別了。 然后大膽猜想這是一個凸函數三分就能A掉了。具體的&#xff0c;延遲…

SQL的執行計劃

SQL的執行計劃實際代表了目標SQL在Oracle數據庫內部的具體執行步驟&#xff0c;作為調優&#xff0c;只有知道了優化器選擇的執行計劃是否為當前情形下最優的執行計劃&#xff0c;才能夠知道下一步往什么方向。 執行計劃的定義&#xff1a;執行目標SQL的所有步驟的組合。 我們首…

問卷 假設檢驗 t檢驗_真實問題的假設檢驗

問卷 假設檢驗 t檢驗A statistical Hypothesis is a belief made about a population parameter. This belief may or might not be right. In other words, hypothesis testing is a proper technique utilized by scientist to support or reject statistical hypotheses. Th…

webpack打包ES6降級ES5

Babel是一個廣泛使用的轉碼器&#xff0c;babel可以將ES6代碼完美地轉換為ES5代碼&#xff0c;所以我們不用等到瀏覽器的支持就可以在項目中使用ES6的特性。 安裝babel實現ES6到ES5 npm install -D babel-core babel-preset-es2015 復制代碼安裝babel-loader npm install -D ba…

[轉帖]USB-C和Thunderbolt 3連接線你搞懂了嗎?---沒搞明白.

USB-C和Thunderbolt 3連接線你搞懂了嗎&#xff1f; 2018年11月25日 07:30 6318 次閱讀 稿源&#xff1a;威鋒網 3 條評論按照計算行業的風潮&#xff0c;USB Type-C 將會是下一代主流的接口。不過&#xff0c;在過去兩年時間里&#xff0c;關于 USB-C、Thunderbolt 3、USB 3.1…

sqldeveloper的查看執行計劃快捷鍵F10

簡介&#xff1a;本文全面詳細介紹oracle執行計劃的相關的概念&#xff0c;訪問數據的存取方法&#xff0c;表之間的連接等內容。并有總結和概述&#xff0c;便于理解與記憶!目錄---一&#xff0e;相關的概念Rowid的概念Recursive Sql概念Predicate(謂詞)DRiving Table(驅動表)…

大數據技術 學習之旅_為什么聚焦是您數據科學之旅的關鍵

大數據技術 學習之旅David Robinson, a data scientist, has said the following quotes:數據科學家David Robinson曾說過以下話&#xff1a; “When you’ve written the same code 3 times, write a function.”“當您編寫了3次相同的代碼時&#xff0c;請編寫一個函數。” …

SQL 語句

去重字段里的值 SELECT DISTINCT cat_id,goods_sn,repay FROM ecs_goods where cat_id ! 20014 刪除除去 去重字段 DELETE FROM ecs_goods where goods_id NOT IN ( select bid from (select min(goods_id) as bid from ecs_goods group by cat_id,goods_sn,repay) as b );轉…

無監督學習 k-means_無監督學習-第4部分

無監督學習 k-means有關深層學習的FAU講義 (FAU LECTURE NOTES ON DEEP LEARNING) These are the lecture notes for FAU’s YouTube Lecture “Deep Learning”. This is a full transcript of the lecture video & matching slides. We hope, you enjoy this as much as …

vCenter 升級錯誤 VCSServiceManager 1603

近日&#xff0c;看到了VMware發布的vCenter 6.7 Update 1b的更新消息。其中有一條比較震撼。有誤刪所有VM的概率&#xff0c;這種BUG誰也承受不起。Removing a virtual machine folder from the inventory by using the vSphere Client might delete all virtual machinesIn t…

day28 socketserver

1. socketserver 多線程用的 例 import socket import timeclientsocket.socket() client.connect(("127.0.0.1",9000))while 1:cmdinput("請輸入指令")client.send(cmd.encode("utf-8"))from_server_msgclient.recv(1024).decode("utf…

車牌識別思路

本文源自我之前花了2天時間做的一個簡單的車牌識別系統。那個項目&#xff0c;時間太緊&#xff0c;樣本也有限&#xff0c;達不到對方要求的95%識別率&#xff08;主要對于車牌來說&#xff0c;D,0&#xff0c;O&#xff0c;I&#xff0c;1等等太相似了。然后&#xff0c;漢字…

深度學習算法原理_用于對象檢測的深度學習算法的基本原理

深度學習算法原理You just got a new drone and you want it to be super smart! Maybe it should detect whether workers are properly wearing their helmets or how big the cracks on a factory rooftop are.您剛剛擁有一架新無人機&#xff0c;并希望它變得超級聰明&…

【python】numpy庫linspace相同間隔采樣 詳解

linspace可以用來實現相同間隔的采樣&#xff1b; numpy.linspace(start,stop,num50,endpointTrue,retstepFalse, dtypeNone) 返回num均勻分布的樣本&#xff0c;在[start, stop]。 Parameters(參數): start : scalar(標量) The starting value of the sequence(序列的起始點)…

Spring整合JMS——基于ActiveMQ實現(一)

Spring整合JMS——基于ActiveMQ實現&#xff08;一&#xff09; 1.1 JMS簡介 JMS的全稱是Java Message Service&#xff0c;即Java消息服務。它主要用于在生產者和消費者之間進行消息傳遞&#xff0c;生產者負責產生消息&#xff0c;而消費者負責接收消息。把它應用到實際的…

軟件本地化 pdf_軟件本地化與標準翻譯

軟件本地化 pdfSoftware has become such an essential part of our world that it’s impossible to imagine a life without it. There’s hardly a service or product around us that wasn’t created with software or that runs on software.軟件已成為我們世界的重要組成…

CentOS7+CDH5.14.0安裝全流程記錄,圖文詳解全程實測-8CDH5安裝和集群配置

Cloudera Manager Server和Agent都啟動以后&#xff0c;就可以進行CDH5的安裝配置了。 準備文件 從 http://archive.cloudera.com/cdh5/parcels/中下載CDH5.14.0的相關文件 把CDH5需要的安裝文件放到主節點上&#xff0c;新建目錄為/opt/cloudera/parcel-repo把我們之前下載的…