Buscar

miércoles, 4 de febrero de 2015

MongoDB for DBA's 5/7. Replication Part 2. Homeworks

Homework 5.1

Set up a replica set that includes an arbiter.
To demonstrate that you have done this, what is the text in the "state" field for the arbiter when you run rs.status()?
Status : 7

Homework 5.2


You have a replica set with two members, having decided that a total of two copies of your data is sufficient.
You are concerned about robustness, however.
Which of the following are options that will allow you to ensure that failover can occur if the firstserver goes down?
Check all that apply.


Homework 5.3


At the beginning of the section, "W Timeout and Capacity Planning", Dwight mentioned something that hasn't yet been touched upon in this class: Batch Inserts.
He mentions that you can find information on them in the docs, but he hasn't used them in the shell during this course.
Your job is to look this functionality up in the documentation, and use it for the following problem:
Please insert into the m102 collection, the following 3 documents, using only one shell query (please use double quotes around each key in each document in your answer):
  • { "a" : 1 }
  • { "b" : 2 }
  • { "c" : 3 }
Hints: This is not the same as the Bulk() operations, which were discussed earlier in this course. Also, this does not involve semicolons, so don't put any into the text box. You probably want to test this on your machine, and then copy and paste the insert query in the box below. Do not include the > sign from the beginning of the shell.

Result: db.m102.insert([{"a":1},{"b":2},{"c":3}])

Homework 5.4


You would like to create a replica set that is robust to data center failure.
You only have two data centers available. Which arrangement(s) of servers will allow you to be stay up (as in, still able to elect a primary) in the event of a failure of either data center (but not both at once)? Check all that apply.


Homework 5.5


Consider the following scenario: You have a two member replica set, a primary, and a secondary.
The data center with the primary goes down, and is expected to remain down for the foreseeable future. Your secondary is now the only copy of your data, and it is not accepting writes. You want to reconfigure your replica set config to exclude the primary, and allow your secondary to be elected, but you run into trouble. Find out the optional parameter that you'll need, and input it into the box below for your rs.reconfigure(new_cfg, OPTIONAL PARAMETER).
Hint: You may want to use this documentation page to solve this problem.
Your answer should be of the form { key : value } (including brackets).

Result: { force : true }

5 comentarios:

  1. can any one help on this?

    Homework: Homework 5.2

    You have just been hired at a new company with an existing MongoDB deployment. They are running a single replica set with two members. When you ask why, they explain that this ensures that the data will be durable in the face of the failure of either server. They also explain that should they use a readPreference of "primaryPreferred", that the application can read from the one remaining server during server maintenance.

    You are concerned about two things, however. First, a server is brought down for maintenance once a month. When this is done, the replica set primary steps down, and the set cannot accept writes. You would like to ensure availability of writes during server maintenance.

    Second, you also want to ensure that all writes can be replicated during server maintenance.

    Which of the following options will allow you to ensure that a primary is available during server maintenance, and that any writes it receives will replicate during this time?

    Check all that apply.

    Add another data bearing node.
    Add two data bearing members plus one arbiter.
    Add an arbiter.
    Add two arbiters.
    Increase the priority of the first server from one to two.

    ResponderEliminar
  2. 1. Add another data bearing node.
    2. Add two data bearing members plus one arbiter.
    3. Add an arbiter.
    4. Add two arbiters.
    5. Increase the priority of the first server from one to two.

    ResponderEliminar
  3. can anyone please help me for this assignment:

    I confused between below options: probably answer will be out of below options:

    1. 1 and 5 ??
    2. 1 and 3 and 5 ??
    3. only 1 ??
    4. only 5 ??
    5. Only 2 ??

    1. i tried 1, 3 but not working
    2. tried 3,5 but not working

    I have only one attempt left so need expert opinion.

    ResponderEliminar
  4. The answer is 1,2.

    [
    Add another data bearing node.
    Add two data bearing members plus one arbiter.
    ]

    ResponderEliminar
  5. Its incorrect
    Add another data bearing node.
    Add two data bearing members plus one arbiter.

    ResponderEliminar