Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
Downloading a Bson Collection with mongodmp in mongocompass and kubernetes Databank

I am trying to backup a database from a kubernetes cluster to my computer as a bson file. I have connected my mongodb compass to the kubernetes cluster using port-forwarding. Can anyone help me with the command I need to download a particular Collection (450gb) from a databank to my desktop?

I've been trying for a while now but I cant seem to find the way around it.

In mongocompass there is unfortunately no way to download a collection as a bson file. The port I have forwarded the kubernetes pod to is 27017.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

From the mongodb official docs:

Run mongodump from the system command line, not the mongo shell.

So, assuming you configured Kubernetes Port Forwarding on your local machine like this:

$ kubectl port-forward service/mongo 28015:27017

And you've got output similar to this:

Forwarding from 127.0.0.1:28015 -> 27017
Forwarding from [::1]:28015 -> 27017

You can now export data from mongodb using the following command:

$ mongodump --username root --port=28015 -p secretpassword

This will create a dump directory in the current working directory and export data there.

Also, to export only specific collection use the following option:

--collection=<collection>, -c=<collection>

Specifies a collection to backup. If you do not specify a collection, this option copies all collections in the specified database or instance to the dump files.

You can check other available option here.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda