- 속도는 dump 와 비슷하다.
- 제약사항은 Slave 에는 카피할 수 없다.
file='fffff'
createUser="use game_${file};db.createUser({user:\"아이디\",pwd:\"패스워드",roles: [{role:\"readAnyDatabase\",db:\"${file}\"}]})"
- copyDatabase 명령어는 복사해오려는 서버에서 실행한다. (to 서버에서 from 서버로 접근해서 끌어오기 방식이다)
- copyDatabase 작업 시 mongostate 로 crud 가 확인되지 않는다. (dstat 또는 iostat 로 확인)
- copyDatabase 작업 시 index 설정도 그대로 복사되기 때문에 시간이 장시간 소요된다.

Parameter |
Type | Description |
---|---|---|
fromdb | string | Name of the source database. |
todb | string | Name of the target database. |
fromhost | string | Optional. The hostname of the source mongod instance. Omit to copy databases within the same mongod instance. |
username | string |
Optional. The name of the user on the fromhost MongoDB instance. The user authenticates to the fromdb. For more information, see Authentication to Source mongod Instance. |
password | string |
Optional. The password on the fromhost for authentication. The method does not transmit the password in plaintext. For more information, see Authentication to Source mongod Instance. |
mechanism | string |
Optional. The mechanism to authenticate the username and password on the fromhost. Specify either MONGODB-CR or SCRAM-SHA-1. db.copyDatabase defaults to SCRAM-SHA-1 if the wire protocol version (maxWireVersion) is greater than or equal to 3 (i.e. MongoDB versions 3.0 or greater). Otherwise, it defaults to MONGODB-CR. Specify MONGODB-CR to authenticate to the version 2.6.x fromhost from a version 3.0 instance or greater. For an example, see Copy Database from a mongod Instances that Enforce Authentication. New in version 3.0. |
'NOSQL' 카테고리의 다른 글
MongoDB 에서 SSD DISK 사용 시 주의사항 (0) | 2019.08.12 |
---|---|
[ArangoDB] Replication Overview (비동기 복제) (0) | 2017.03.03 |
[ArangoDB] Basic Guide Overview (1) | 2017.03.02 |
[MongoDB] 3.4.2 버전 릴리즈 정보 (0) | 2017.02.09 |
[MongoDB] Overflow sort stage buffered data usage exceeds internal limit (0) | 2017.02.01 |
Comments