I can't even get my server to start

i have tried so many times but i’m still getting the same response , i giving up already on this.
i have tried so many solutions on here but nothing is working

Please check mongos.log and share your config file

here is my mongos.log content

2022-10-15T14:18:38.890+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2022-10-15T14:18:38.894+0000 I CONTROL  [main] ** WARNING: You are running this process as the root user, which is not recommended.
2022-10-15T14:18:38.894+0000 I CONTROL  [main] 
2022-10-15T14:18:38.933+0000 I SHARDING [mongosMain] mongos version v4.0.5
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] allocator: system
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] modules: none
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] build environment:
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain]     distarch: x86_64
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain]     target_arch: x86_64
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] db version v4.0.5
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] allocator: system
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] modules: none
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] build environment:
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain]     distarch: x86_64
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain]     target_arch: x86_64
2022-10-15T14:18:38.933+0000 I CONTROL  [mongosMain] options: { config: "mongos.conf", net: { bindIp: "localhost,192.168.103.100", port: 26000 }, processManagement: { fork: true }, security: { keyFile: "/var/mongodb/pki/m103-keyfile" }, sharding: { configDB: "m103-csrs/192.168.103.100:26001,192.168.103.100:26002,192.168.103.100:26003" }, systemLog: { destination: "file", logAppend: true, path: "/var/mongodb/logs/mongos.log" } }
2022-10-15T14:18:38.934+0000 E SHARDING [mongosMain] Failed to set up listener: SocketException: Address not available
2022-10-15T14:18:38.934+0000 I CONTROL  [mongosMain] shutting down with code:48

Your bindIp parameter is not correct.Remove 192.x.x.x ip address.It is not valid for IDE
Just use localhost and try again to start your mongos

1 Like

now it stops just right here

It has not stopped.Your mongod is up and running in foreground
Open another session and try to connect
If you use fork option it will run in background and your prompt comes back

1 Like

can't connect

user@M103# mongo --port 26000 --username m103-admin --password m103-pass --authenticationDatabase admin
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:26000/?authSource=admin&gssapiServiceName=mongodb
2022-10-16T07:29:28.484+0000 E QUERY    [js] Error: couldn't connect to server 127.0.0.1:26000, connection attempt failed: SocketException: Error connecting to 127.0.0.1:26000 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

in case you need the mongos.log

2022-10-16T07:31:49.900+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2022-10-16T07:31:49.903+0000 I CONTROL  [main] ** WARNING: You are running this process as the root user, which is not recommended.
2022-10-16T07:31:49.903+0000 I CONTROL  [main] 
2022-10-16T07:31:49.941+0000 I SHARDING [mongosMain] mongos version v4.0.5
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] allocator: system
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] modules: none
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] build environment:
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain]     distarch: x86_64
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain]     target_arch: x86_64
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] db version v4.0.5
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] git version: 3739429dd92b92d1b0ab120911a23d50bf03c412
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] allocator: system
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] modules: none
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain] build environment:
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain]     distarch: x86_64
2022-10-16T07:31:49.941+0000 I CONTROL  [mongosMain]     target_arch: x86_64
2022-10-16T07:31:49.942+0000 I CONTROL  [mongosMain] options: { config: "mongos.conf", net: { bindIp: "localhost", port: 26000 }, processManagement: { fork: true }, security: { keyFile: "/var/mongodb/pki/m103-keyfile" }, sharding: { configDB: "m103-csrs/192.168.103.100:26001,192.168.103.100:26002,192.168.103.100:26003" }, systemLog: { destination: "file", logAppend: true, path: "/var/mongodb/logs/mongos.log" } }
2022-10-16T07:31:49.943+0000 I NETWORK  [mongosMain] Starting new replica set monitor for m103-csrs/192.168.103.100:26001,192.168.103.100:26002,192.168.103.100:26003
2022-10-16T07:31:49.944+0000 I SHARDING [thread1] creating distributed lock ping thread for process S34hRoL7D5sgDfzsZ4:26000:1665905509:6314384597726068782 (sleeping for 30000ms)
2022-10-16T07:31:54.969+0000 W NETWORK  [mongosMain] Unable to reach primary for set m103-csrs
2022-10-16T07:31:54.969+0000 I NETWORK  [mongosMain] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2022-10-16T07:32:00.472+0000 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set m103-csrs
2022-10-16T07:32:00.472+0000 I NETWORK  [monitoring keys for HMAC] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2022-10-16T07:32:05.976+0000 W NETWORK  [shard registry reload] Unable to reach primary for set m103-csrs
2022-10-16T07:32:05.976+0000 I NETWORK  [shard registry reload] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2022-10-16T07:32:11.481+0000 W NETWORK  [mongosMain] Unable to reach primary for set m103-csrs
2022-10-16T07:32:11.481+0000 I NETWORK  [mongosMain] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2022-10-16T07:32:11.481+0000 W SHARDING [mongosMain] Error initializing sharding state, sleeping for 2 seconds and trying again :: caused by :: FailedToSatisfyReadPreference: Error loading clusterID :: caused by :: Could not find host matching read preference { mode: "nearest" } for set m103-csrs
2022-10-16T07:32:11.481+0000 W SHARDING [replSetDistLockPinger] pinging failed for distributed lock pinger :: caused by :: FailedToSatisfyReadPreference: Could not find host matching read preference { mode: "primary" } for set m103-csrs
2022-10-16T07:32:11.481+0000 I SHARDING [shard registry reload] Periodic reload of shard registry failed  :: caused by :: FailedToSatisfyReadPreference: could not get updated shard list from config server :: caused by :: Could not find host matching read preference { mode: "nearest" } for set m103-csrs; will retry after 30s
2022-10-16T07:32:21.689+0000 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set m103-csrs
2022-10-16T07:32:21.689+0000 I NETWORK  [monitoring keys for HMAC] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 5 checks in a row.
2022-10-16T07:32:30.001+0000 W NETWORK  [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set m103-csrs
2022-10-16T07:32:30.001+0000 I NETWORK  [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set m103-csrs. Please check network connectivity and the status of the set. This has happened for 6 checks in a row.

Share your mongos config file
ConfigDb param may not be correct
Why 192.x.x.x IP appearing in your startup logs

even changing it to localhost doesn't help

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
  port: 26000
systemLog:
  destination: file
  path: /var/mongodb/logs/mongos.log
  logAppend: true
processManagement:
  fork: true

Where did you change it to localhos?Your configDb still shows 192. Address
Please change it to localhost and also check if you are using correct port numbers

it’s all fine now , next time i will be more carefull . thank you very much

i had the wrong configurations (ports mostly)