2017. 12. 8. 17:57ㆍ서버 프로그래밍
Deploy a Sharded Cluster
https://docs.mongodb.com/v3.4/tutorial/deploy-shard-cluster/
Mongo Sharding 1 - shard 구성
https://fkkmemi.github.io/mongodb/mongo-sharding-1/
★[MongoDB] 3.2.9 샤딩
[MongoDB] Sharding (3) - shard key
또한 한번 sharding한 collection에 shard key는 변경할 수 없다.
만약 변경하고 싶다면 새 collection을 만들어 shard key를 설정하고 collection 전체를 복사해서 새로운 collection을 만들어야 한다.
http://blog.seulgi.kim/2014/08/mongodb-sharding-3-shard-key.html
* shard의 IP 주소 변경되었을때
https://stackoverflow.com/questions/8910708/mongodb-sharding-ip-changes
from inside mongos.
simply use the following command to update the IPs of the shard servers:
db.shards.update({_id: <<"shard name">>} , {$set: {"host" : "newIP:27018"}})
Example:
db.shards.update({_id: "shard000"} , {$set: {"host" : "172.31.1.1:27018"}})
172.31.1.1 is the private ip address of your shard server in the private network. avoid using a dynamic ip address.
* 다른 하드웨어로 샤딩 시스템 마이그레이션하기
https://docs.mongodb.com/manual/tutorial/migrate-sharded-cluster-to-new-hardware/#migrate-the-shards
* 샤딩된 컬랙션을 복사하기
$out is use to create the new collection with data , so use $out
db.oldCollection.aggregate([{$out : "newCollection"}])
then use drop
db.oldCollection.drop()
-----------------------------------------------------
MongoDB 샤딩된 컬렉션 풀기?
http://bspfp.pe.kr/archives/826
Scaling MongoDB and setting up sharding for MongoDB on Ubuntu
Mongo db sharding
https://www.slideshare.net/sejoonlim/mongo-db-sharding-16741367
https://likefree.tistory.com/1
https://docs.ncloud.com/ko/database/database-10-3.html