Hi
I’m trying to setup a replication between 2 mongodb servers, one of the steps is to generate and share keys between mongo servers.
I did below steps
mkdir -p /etc/mongodb/keyFiles/
openssl rand -base64 756 > /etc/mongodb/keyFiles/mongo-key
chmod 400 /etc/mongodb/keyFiles/mongo-key
chown -R mongodb:mongodb /etc/mongodb
then I add below lines in /etc/mongod.conf
On node 1 => mongoDb-01
network interfaces
net:
port: 27017
bindIp: 10.0.0.11
#security:
security:
authorization: enabled
keyFile: /etc/mongodb/keyFile/mongo-key
#replication:
replication:
replSetName: " replicaset01 "
When I try to start the mongodb server, I get below error
+++++++++++++++++++++++++++++++++++
{“t”:{"$date":“2022-06-28T13:41:59.650+04:00”},“s”:“I”, “c”:“CONTROL”, “id”:20698, “ctx”:"-",“msg”:"***** SERVER RESTARTED *****"}
{“t”:{"$date":“2022-06-28T13:41:59.651+04:00”},“s”:“I”, “c”:“NETWORK”, “id”:4915701, “ctx”:"-",“msg”:“Initialized wire specification”,“attr”:{“spec”:{“incomingExternalClient”:{“minWireVersion”:0,“maxWireVersion”:13},“incomingInternalClient”:{“minWireVersion”:0,“maxWireVersion”:13},“outgoing”:{“minWireVersion”:0,“maxWireVersion”:13},“isInternalClient”:true}}}
{“t”:{"$date":“2022-06-28T13:41:59.653+04:00”},“s”:“I”, “c”:“CONTROL”, “id”:23285, “ctx”:"-",“msg”:“Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols ‘none’”}
{“t”:{"$date":“2022-06-28T13:41:59.655+04:00”},“s”:“W”, “c”:“ASIO”, “id”:22601, “ctx”:“main”,“msg”:“No TransportLayer configured during NetworkInterface startup”}
{“t”:{"$date":“2022-06-28T13:41:59.655+04:00”},“s”:“I”, “c”:“NETWORK”, “id”:4648601, “ctx”:“main”,“msg”:“Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize.”}
{“t”:{"$date":“2022-06-28T13:41:59.656+04:00”},“s”:“I”, “c”:“ACCESS”, “id”:20254, “ctx”:“main”,“msg”:“Read security file failed”,“attr”:{“error”:{“code”:30,“codeName”:“InvalidPath”,“errmsg”:“Error reading file /etc/mongodb/keys/mongo-key: Permission denied”}}}
{“t”:{"$date":“2022-06-28T13:41:59.656+04:00”},“s”:“I”, “c”:“ASIO”, “id”:22582, “ctx”:“main”,“msg”:“Killing all outstanding egress activity.”}
{“t”:{"$date":“2022-06-28T13:41:59.656+04:00”},“s”:“F”, “c”:“CONTROL”, “id”:20575, “ctx”:“main”,“msg”:“Error creating service context”,“attr”:{“error”:“Location5579201: Unable to acquire security key[s]”}}
+++++++++++++++++++++++++++++++++++
Any Ideas??