Database is not reflecting in sh.status()
I have a 2 shard (s1 and s0 )servers with repl set. s1 has 2 dbs (db-A and db-B) and one of the db is sharded (db-B).
When i do sh.status() from mongos only (db-B) is displayed. I am wondering what i need to do for identifying of db-A by mongos.
mongodb mongodb-3.2
bumped to the homepage by Community♦ 2 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a 2 shard (s1 and s0 )servers with repl set. s1 has 2 dbs (db-A and db-B) and one of the db is sharded (db-B).
When i do sh.status() from mongos only (db-B) is displayed. I am wondering what i need to do for identifying of db-A by mongos.
mongodb mongodb-3.2
bumped to the homepage by Community♦ 2 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.show dbs
should show all database. Switch to the db by usinguse <db>
command. Nowshow collections
will show all collections with in that db. As mentioned by @JJussi you can usedb.getSiblingDB()
alternatively. Details here.
– SqlWorldWide
Jul 7 '17 at 20:59
add a comment |
I have a 2 shard (s1 and s0 )servers with repl set. s1 has 2 dbs (db-A and db-B) and one of the db is sharded (db-B).
When i do sh.status() from mongos only (db-B) is displayed. I am wondering what i need to do for identifying of db-A by mongos.
mongodb mongodb-3.2
I have a 2 shard (s1 and s0 )servers with repl set. s1 has 2 dbs (db-A and db-B) and one of the db is sharded (db-B).
When i do sh.status() from mongos only (db-B) is displayed. I am wondering what i need to do for identifying of db-A by mongos.
mongodb mongodb-3.2
mongodb mongodb-3.2
asked Jul 7 '17 at 11:47
GeekGeek
11
11
bumped to the homepage by Community♦ 2 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.show dbs
should show all database. Switch to the db by usinguse <db>
command. Nowshow collections
will show all collections with in that db. As mentioned by @JJussi you can usedb.getSiblingDB()
alternatively. Details here.
– SqlWorldWide
Jul 7 '17 at 20:59
add a comment |
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.show dbs
should show all database. Switch to the db by usinguse <db>
command. Nowshow collections
will show all collections with in that db. As mentioned by @JJussi you can usedb.getSiblingDB()
alternatively. Details here.
– SqlWorldWide
Jul 7 '17 at 20:59
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.
show dbs
should show all database. Switch to the db by using use <db>
command. Now show collections
will show all collections with in that db. As mentioned by @JJussi you can use db.getSiblingDB()
alternatively. Details here.– SqlWorldWide
Jul 7 '17 at 20:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.
show dbs
should show all database. Switch to the db by using use <db>
command. Now show collections
will show all collections with in that db. As mentioned by @JJussi you can use db.getSiblingDB()
alternatively. Details here.– SqlWorldWide
Jul 7 '17 at 20:59
add a comment |
1 Answer
1
active
oldest
votes
db.getSiblingDB.databases.find()
Those databases what have "partitioned":false are not sharded and you can see from "primary":xxx key which shard those are located.
How to access a DB for which sharding is not enabled and none of its collections are sharded. Throughmongos
?
– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just useuse yourDBName
and thenshow collections
ordb.collection.find()
– JJussi
Jul 7 '17 at 20:26
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f178250%2fdatabase-is-not-reflecting-in-sh-status%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
db.getSiblingDB.databases.find()
Those databases what have "partitioned":false are not sharded and you can see from "primary":xxx key which shard those are located.
How to access a DB for which sharding is not enabled and none of its collections are sharded. Throughmongos
?
– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just useuse yourDBName
and thenshow collections
ordb.collection.find()
– JJussi
Jul 7 '17 at 20:26
add a comment |
db.getSiblingDB.databases.find()
Those databases what have "partitioned":false are not sharded and you can see from "primary":xxx key which shard those are located.
How to access a DB for which sharding is not enabled and none of its collections are sharded. Throughmongos
?
– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just useuse yourDBName
and thenshow collections
ordb.collection.find()
– JJussi
Jul 7 '17 at 20:26
add a comment |
db.getSiblingDB.databases.find()
Those databases what have "partitioned":false are not sharded and you can see from "primary":xxx key which shard those are located.
db.getSiblingDB.databases.find()
Those databases what have "partitioned":false are not sharded and you can see from "primary":xxx key which shard those are located.
answered Jul 7 '17 at 12:08
JJussiJJussi
3,0241314
3,0241314
How to access a DB for which sharding is not enabled and none of its collections are sharded. Throughmongos
?
– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just useuse yourDBName
and thenshow collections
ordb.collection.find()
– JJussi
Jul 7 '17 at 20:26
add a comment |
How to access a DB for which sharding is not enabled and none of its collections are sharded. Throughmongos
?
– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just useuse yourDBName
and thenshow collections
ordb.collection.find()
– JJussi
Jul 7 '17 at 20:26
How to access a DB for which sharding is not enabled and none of its collections are sharded. Through
mongos
?– Geek
Jul 7 '17 at 17:39
How to access a DB for which sharding is not enabled and none of its collections are sharded. Through
mongos
?– Geek
Jul 7 '17 at 17:39
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just use
use yourDBName
and then show collections
or db.collection.find()
– JJussi
Jul 7 '17 at 20:26
As you normally access them, but of course thru mongos.. Like you access all other collections in the different DB's. There is nothing special access method when collection is sharded or not, just remember always use mongoS and not read/write collection directly on one shard. Just use
use yourDBName
and then show collections
or db.collection.find()
– JJussi
Jul 7 '17 at 20:26
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f178250%2fdatabase-is-not-reflecting-in-sh-status%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You do not shard a db. You shard a collection with in a db. You have not shard anything in db-A why are you expecting that db in the output?
– SqlWorldWide
Jul 7 '17 at 11:54
How to access the collections from db-A in that case? i dont want to shard any collections from db-A.
– Geek
Jul 7 '17 at 17:40
Use Mongos. Even for shared collection you always want to use Mongos.
– SqlWorldWide
Jul 7 '17 at 17:54
But when i connect to mongos non sharded clusters are not seen from db-A
– Geek
Jul 7 '17 at 17:59
Sorry you need to get your terms and concept clear. collection reside inside a database. Sharding is at collection level and not database.
show dbs
should show all database. Switch to the db by usinguse <db>
command. Nowshow collections
will show all collections with in that db. As mentioned by @JJussi you can usedb.getSiblingDB()
alternatively. Details here.– SqlWorldWide
Jul 7 '17 at 20:59