MongoDB数据存储

时间:2015-04-28 14:32:24

标签: mongodb

也许是一个愚蠢的问题,但我真的想知道将在哪里存储整个数据?如果我正在寻找这个/ data / db,那么在MacOS的根文件夹中没有这样的文件夹。任何人都可以向我解释这是如何工作的?

2 个答案:

答案 0 :(得分:0)

您必须自己创建该目录,或使用

指定其他位置
mongod --dbpath=/path/to/dir/db

我通常在项目目录中创建一个名为db的目录并使用

mongod --dbpath=/home/tim/project/db

答案 1 :(得分:0)

打开数据库配置文件。

查看 import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; public class WSImportSSLByPass { public static void main(String[] args) throws Throwable{ configureBypassSSL(); com.sun.tools.internal.ws.WsImport.main(args); } private static void configureBypassSSL() throws NoSuchAlgorithmException, KeyManagementException { SSLContext ssl_ctx = SSLContext.getInstance("SSL"); TrustManager[] trust_mgr = get_trust_mgr(); ssl_ctx.init(null, // key manager trust_mgr, // trust manager new SecureRandom()); // random number generator SSLSocketFactory sf = ssl_ctx.getSocketFactory(); HttpsURLConnection.setDefaultSSLSocketFactory(sf); HttpsURLConnection.setDefaultHostnameVerifier(new DummyHostVerifier()); } private static TrustManager[] get_trust_mgr() { TrustManager[] certs = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; return certs; } } class DummyHostVerifier implements HostnameVerifier { public boolean verify(String name, SSLSession sess) { return true; } } 变量。

例如

dbpath