docker mongo 데이터 백업 및 복원

 #내보내다

docker exec -i fe81a51232d0 mongodump -u 'admin' -p '1QAZ2wsx' --authenticationDatabase 관리자 -d t_collections --archive > /tmp/dump.archive

fe81a51232d0: 몽고 이미지 인스턴스 ID

관리자: 데이터베이스 사용자 이름

-p : 데이터베이스 비밀번호

-d t_collections : 데이터베이스 이름

dump-collections.archive: 내보내기 이름

#절감

docker exec -i <IMAGE_NAME> mongorestore --archive < ./dump.archive

추천

출처blog.csdn.net/qq_30381077/article/details/129490908