title: how to configure mongodb with x509
body: <p>I was following the guide </p>
  
  <blockquote>
    <p>(<a href="https://docs.mongodb.org/manual/tutorial/configure-ssl/" rel="nofollow">https://docs.mongodb.org/manual/tutorial/configure-ssl/</a>)</p>
  </blockquote>
  
  <p>Centos root directory</p>
  
  <p>cd /etc/ssl/</p>
  
  <pre><code>openssl req -newkey rsa:2048 -new -x509 -days 365 -nodes -out mongodb-cert.crt -keyout mongodb-cert.key
  </code></pre>
  
  <p>2.    </p>
  
  <pre><code>cat mongodb-cert.key mongodb-cert.crt &gt; mongodb.pem
  </code></pre>
  
  <p>vi /etc/mongod.conf</p>
  
  <pre><code>net:
     port: 27017
     bindIp: 0.0.0.0
     ssl:
       mode: requireSSL
       PEMKeyFile: /etc/ssl/mongodb.pem
  security:
     authorization: enabled
     clusterAuthMode: x509
  </code></pre>
  
  <p>and I did that but It's not start</p>
  
  <p>this result</p>
  
  <blockquote>
    <p>Restarting mongod (via systemctl):  Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.</p>
  </blockquote>