Can't launch mongod csrs process

I’m trying to launch mongod for csrs_1.conf but i get this issue Schermata 2020-03-17 alle 14.17.47

the config file is

sharding:
clusterRole: configsvr
replication:
replSetName: m103-csrs
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26001
systemLog:
destination: file
path: /var/mongodb/db/csrs1.log
logAppend: true
processManagement:
fork: false
storage:
dbPath: /var/mongodb/db/csrs1

why that issue?

:information_source: When you get an error, the first place to look would be where all errors are logged.

sorry, but i can’t really understand where’s the problem.

i guess this is the issue “Periodic reload of shard registry failed :: caused by :: NotYetInitialized: could not get updated shard list from config server due to Cannot use non-local read concern until replica set is finished initializing.; will retry after 30s” but can’t get how to solve it

but csrs_2 and csrs_3 work fine.

ok it works now.

What did you do?

there probably was an old process running, because i closed every process and restarted everything.

why is that?


i changed the config file for node1, node2 and node3

sharding:
clusterRole: shardsvr
storage:
dbPath: /var/mongodb/db/node1
wiredTiger:
engineConfig:
cacheSizeGB: .1
net:
bindIp: 192.168.103.100,localhost
port: 27011
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/db/node1/mongod.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl

and mongos config file is

sharding:
configDB: m103-csrs/192.168.103.100:26001,192.168.103.100:26002,192.168.103.100:26003
security:
keyFile: /var/mongodb/pki/m103-keyfile
net:
bindIp: localhost,192.168.103.100
port: 26000
systemLog:
destination: file
path: /var/mongodb/db/mongos.log
logAppend: true
processManagement:
fork: true

and more if i launch node 1, 2 or 3, it’s neither primary or secondary, it says it’s “other”

If you recall from a previous lab/lecture, you can check what processes are running:
ps -ef | grep [m]ongo

You can also check the status of your nodes to ensure all are 1:
rs.status()

the processes are mongos, the 3 config servers and the 3 nodes

i think it’s okey like that. what do you think?
And this is the status of my nodes, that’s weird.

You reconfigured this replica set incorrectly at some point… removing the wrong nodes.

The quickest fix is to kill all 3 nodes, delete all the data files, then rebuild this m103-repl replica set.

got it, i changed the replicaSetName from m103-example to m103-repl . I thought it would work anyway if i changed it to every node. But seems it doesn’t. I brought it back to m103-example and it’s working now.

It needs to be m103-repl for the lab, unless you’re working through the lecture?

does it matter? can’t i change the config on the way and set them so it will work with m103-example? Just like I did now. I should have used m103-repl, but i’m using m103-example and it’s working

Requirements are requirements. Just follow as per requirements and everything will be fine during validation.

okey it was a bit confusing because on “Lecture:Setting up a shared cluster” it talks about “m103-repl” with nodes called node1, node2, and node3 on port 27011, 27012, 27013, but in some previous chapter we set those nodes in a replica set called “m103-example”. Indeed the lab is about the “m103-repl” created on chapoter 2 which use 27001-27002 and 27003. :exploding_head:

27011/2/3 is from a lcture video
27001/2/3 is for a lab

Ideally you watch the lectures, take notes and do the labs.

yes, got it

now, how can I remove a shard? i need to remove that m103-example or i can’t validate the lab.

That’s what I explained to you a few posts ago about killing all the nodes etc…