In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to copy files from pod to the host in Kubernates. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Want to copy files from the pod of K8s to the host, kubectl's cp command, but search the Internet, feel a little confused, record it yourself.
Under the namespace of hadoop, there is a pod of hadoop-hadoop-yarn-rm-0, its work_dir is / usr/local/hadoop, and there is an application_1564318400358_0562_1 file in this directory. The purpose now is to copy this file to the host, as shown in List-1 below. Since our work_dir is / usr/local/hadoop, we do not need to write the full path / usr/local/hadoop/application_1564318400358_0562_1. Instead, we will report an error.
List-1
Kubectl cp-n hadoop hadoop-hadoop-yarn-rm-0:application_1564318400358_0562_1. /
An error is reported in the following List-2
List-2
[~] $kubectl cp-n hadoop hadoop-hadoop-yarn-rm-0:/usr/local/hadoop/application_1564318400358_0562_1. / tar: Removing leading `/ 'from member names [~] $kubectl cp-n hadoop hadoop-hadoop-yarn-rm-0:usr/local/hadoop/application_1564318400358_0562_1. / error: usr/local/hadoop/application_1564318400358_0562_1 no such file or directory
Copy the files on the host to pod. After the test, the files are placed under the work_dir of pod:
List-3
Kubectl cp edits_0000000000000004159-00000000000767859-n hadoop hadoop-hadoop-hdfs-qjm-2:edits_0000000000000004159-00000000000767859 the above is how to copy files from pod to the host in Kubernates. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.