Seting Up a Replica Set

Please, I need help.
When powering up vagrant there are several abort messages, but vagrant finally powers on.
Then, when connecting through ssh, new messages about upgrades.
Here the entire history.
(I am in other courses at the same time and Installed Anaconda. Don’t know if it’s related).


    C:\Users\MyUser\m103\m103-vagrant-env>vagrant up
==> vagrant: A new version of Vagrant is available: 2.2.7 (installed version: 2.2.6)!
==> vagrant: To upgrade visit: https://www.vagrantup.com/downloads.html

Bringing machine 'mongod-m103' up with 'virtualbox' provider...
==> mongod-m103: Clearing any previously set forwarded ports...
==> mongod-m103: Clearing any previously set network interfaces...
==> mongod-m103: Preparing network interfaces based on configuration...
    mongod-m103: Adapter 1: nat
    mongod-m103: Adapter 2: hostonly
==> mongod-m103: Forwarding ports...
    mongod-m103: 22 (guest) => 2222 (host) (adapter 1)
==> mongod-m103: Running 'pre-boot' VM customizations...
==> mongod-m103: Booting VM...
==> mongod-m103: Waiting for machine to boot. This may take a few minutes...
    mongod-m103: SSH address: 127.0.0.1:2222
    mongod-m103: SSH username: vagrant
    mongod-m103: SSH auth method: private key
    mongod-m103: Warning: Connection aborted. Retrying...
    mongod-m103: Warning: Remote connection disconnect. Retrying...
    mongod-m103: Warning: Connection reset. Retrying...
==> mongod-m103: Machine booted and ready!
==> mongod-m103: Checking for guest additions in VM...
    mongod-m103: The guest additions on this VM do not match the installed version of
    mongod-m103: VirtualBox! In most cases this is fine, but in rare cases it can
    mongod-m103: prevent things such as shared folders from working properly. If you see
    mongod-m103: shared folder errors, please make sure the guest additions within the
    mongod-m103: virtual machine match the version of VirtualBox you have installed on
    mongod-m103: your host and reload your VM.
    mongod-m103:
    mongod-m103: Guest Additions Version: 4.3.40
    mongod-m103: VirtualBox Version: 6.0
==> mongod-m103: Setting hostname...
==> mongod-m103: Configuring and enabling network interfaces...
==> mongod-m103: Mounting shared folders...
    mongod-m103: /shared => C:/Users/MyUser/m103/m103-vagrant-env/shared
    mongod-m103: /vagrant => C:/Users/MyUser/m103/m103-vagrant-env
    mongod-m103: /dataset => C:/Users/MyUser/m103/m103-vagrant-env/dataset
==> mongod-m103: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> mongod-m103: flag to force provisioning. Provisioners marked to run always will still run.

C:\Users\MyUser\m103\m103-vagrant-env>vagrant ssh
Welcome to Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-170-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Fri Feb 28 06:03:10 UTC 2020

  System load:  1.04               Processes:           105
  Usage of /:   10.3% of 39.34GB   Users logged in:     0
  Memory usage: 3%                 IP address for eth0: 10.0.2.15
  Swap usage:   0%                 IP address for eth1: 192.168.103.100

  Graph this data and manage this system at:
    https://landscape.canonical.com/

UA Infrastructure Extended Security Maintenance (ESM) is not enabled.

6 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

Enable UA Infrastructure ESM to receive 86 additional security updates.
See https://ubuntu.com/advantage or run: sudo ua status

New release '16.04.6 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Wed Feb 26 07:03:07 2020 from 10.0.2.2
vagrant@m103:~$ apt list --upgradable
Listing... Done
mongodb-enterprise/trusty 3.6.17 amd64 [upgradable from: 3.6.16]
mongodb-enterprise-mongos/trusty 3.6.17 amd64 [upgradable from: 3.6.16]
mongodb-enterprise-server/trusty 3.6.17 amd64 [upgradable from: 3.6.16]
mongodb-enterprise-shell/trusty 3.6.17 amd64 [upgradable from: 3.6.16]
mongodb-enterprise-tools/trusty 3.6.17 amd64 [upgradable from: 3.6.16]
ubuntu-advantage-tools/trusty-updates 19.6~ubuntu14.04.4 amd64 [upgradable from: 19.6~ubuntu14.04.3]

Hi @Juan_45112,

As I can see, you are making good progress in the course. Please let me know if you are still facing any issue.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Yes thank you!
Now I’m running into brand new problems!

Hi @Juan_45112,

If in case you need any help then please provide some more details on the problem that you are facing.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

Thank you!
In Chapter 3 - Setting Up a Sharded Cluster
I cannot start conf file
when I execute mongod -f csrs_1.conf
The error message is:
ERROR: child process failed, exited with error number 51
To see additional information in this output, start without the “–fork” option.

If I take out the ‘fork’ option, then, the error message is this:
‘Aborted (core dumped)’

I read some posts and ran this commands:

vagrant@m103:~$ rm -r /var/mongodb/db
vagrant@m103:~$ sudo chown -R vagrant:vagrant /var/mongodb
vagrant@m103:~$ mkdir -p /var/mongodb/db

Tried again and got the same error.

Here the content of csrs_1.conf

sharding:

  clusterRole: configsvr

replication:

  replSetName: "m103-csrs"

security:

  keyFile: "/var/mongodb/pki/m103-keyfile"

net:

  bindIp: "192.168.103.100,localhost"

  port: "26001"

systemLog:

  destination: "file"

  path: "/var/mongodb/db/csrs1.log"

  logAppend: true

processManagement:

  fork: true

storage:

  dbPath: "/var/mongodb/db/csrs1"

Hi @Juan_45112,

Your datapath directories do not exist.

The dbpath that you have specified in your configuration file is this :

However, if you look at the command that you are running for creating the directories then you will realise that you have not created all the directories. There are some other mistakes in the command that you are running.

Please run this command for creating the directories :

sudo mkdir -p /var/mongodb/db/{csrs1,csrs2,csrs3}

sudo chown vagrant:vagrant /var/mongodb/db/{csrs1,csrs2,csrs3}

This should resolve your issue.

If the issue still persists then please share the output of this command :

cat -n 150 /var/mongodb/db/csrs1.log

Thanks,
Shubham Ranjan
Curriculum Services Engineer

of course! It was right in front of me the whole time!
Thank you!

Closing this thread as the issue has been resolved.