title: Issues With MongoDB storage (9001 already in use)
body: <p>I am getting this error when trying to run the command
  <code>mongod --dbpath=/var/lib/mongodb</code></p>
  <pre><code>{&quot;t&quot;:{&quot;$date&quot;:&quot;2021-01-23T11:23:41.733-07:00&quot;},&quot;s&quot;:&quot;I&quot;,  &quot;c&quot;:&quot;CONTROL&quot;,  &quot;id&quot;:51765,   &quot;ctx&quot;:&quot;initandlisten&quot;,&quot;msg&quot;:&quot;Operating System&quot;,&quot;attr&quot;:{&quot;os&quot;:{&quot;name&quot;:&quot;Ubuntu&quot;,&quot;version&quot;:&quot;20.04&quot;}}}
  {&quot;t&quot;:{&quot;$date&quot;:&quot;2021-01-23T11:23:41.733-07:00&quot;},&quot;s&quot;:&quot;I&quot;,  &quot;c&quot;:&quot;CONTROL&quot;,  &quot;id&quot;:21951,   &quot;ctx&quot;:&quot;initandlisten&quot;,&quot;msg&quot;:&quot;Options set by command line&quot;,&quot;attr&quot;:{&quot;options&quot;:{&quot;storage&quot;:{&quot;dbPath&quot;:&quot;/var/lib/mongodb&quot;}}}}
  {&quot;t&quot;:{&quot;$date&quot;:&quot;2021-01-23T11:23:41.734-07:00&quot;},&quot;s&quot;:&quot;E&quot;,  &quot;c&quot;:&quot;STORAGE&quot;,  &quot;id&quot;:20568,   &quot;ctx&quot;:&quot;initandlisten&quot;,&quot;msg&quot;:&quot;Error setting up listener&quot;,&quot;attr&quot;:{&quot;error&quot;:{&quot;code&quot;:9001,&quot;codeName&quot;:&quot;SocketException&quot;,&quot;errmsg&quot;:&quot;Address already in use&quot;}}}
  </code></pre>
  <p>I do see the issue is
  <code>&quot;attr&quot;:{&quot;error&quot;:{&quot;code&quot;:9001,&quot;codeName&quot;:&quot;SocketException&quot;,&quot;errmsg&quot;:&quot;Address already in use&quot;}}}</code></p>
  <p>But I don't know how to resolve this?</p>
  <p>I tried other suggestions from another SO post that says to kill the process and restart. I did that and it did not work for me.</p>
  <p>I also tried running mongod on a different port</p>
  <pre><code>mongod --dbpath=/var/lib/mongodb --port 27019
  </code></pre>
  <p>which gives me this error</p>
  <pre><code>{&quot;t&quot;:{&quot;$date&quot;:&quot;2021-01-23T11:27:29.535-07:00&quot;},&quot;s&quot;:&quot;E&quot;,  &quot;c&quot;:&quot;STORAGE&quot;,  &quot;id&quot;:20557,   &quot;ctx&quot;:&quot;initandlisten&quot;,&quot;msg&quot;:&quot;DBException in initAndListen, terminating&quot;,&quot;attr&quot;:{&quot;error&quot;:&quot;IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/mongodb&quot;}}
  </code></pre>
  <p>So it's a read only directory so I ran</p>
  <pre><code>sudo chmod -R 777 /var/lib/mongodb
  </code></pre>
  <p>Then I get this error in the log</p>
  <pre><code>&quot;ctx&quot;:&quot;initandlisten&quot;,&quot;msg&quot;:&quot;DBException in initAndListen, terminating&quot;,&quot;attr&quot;:{&quot;error&quot;:&quot;DBPathInUse: Unable to lock the lock file: /var/lib/mongodb/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /var/lib/mongodb directory&quot;}}
  </code></pre>
  <p>So I try to find out which other process is running</p>
  <pre><code>ps -eaf | grep mongod
  
  mongodb   722732       1  0 11:09 ?        00:00:10 /usr/bin/mongod --config /etc/mongod.conf
  srt       725772  720106  0 11:34 pts/2    00:00:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox mongod
  </code></pre>
  <p>But idk what to do from here.</p>