質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
MongoDB

MongoDBはオープンソースのドキュメント指向データベースの1つです。高性能で、多くのリトルエンディアンシステムを利用することができます。

Q&A

1回答

2159閲覧

MongoDBに外部からアクセスしたい

aiai8976

総合スコア112

MongoDB

MongoDBはオープンソースのドキュメント指向データベースの1つです。高性能で、多くのリトルエンディアンシステムを利用することができます。

0グッド

0クリップ

投稿2019/08/15 05:29

編集2022/01/12 10:55

前提・実現したいこと

http://txclr.hatenablog.com/entry/2015/04/24/095433
このサイトを見ながらMongoDBに外部からアクセスしようとしています。
######mongod.confの変更
の箇所で

$ sudo mongod -f /etc/mongod.conf --shutdown

を行ったのですが、以下のようなエラーが出ました。

発生している問題・エラーメッセージ

hasegawa@hasegawa-W76OC:/$ sudo mongod -f /etc/mongod.conf --shutdown 2019-08-15T14:06:37.508+0900 I STORAGE [main] Max cache overflow file size custom option: 0 There doesn't seem to be a server running with dbpath: /var/lib/mongodb

一方で、現在以下のコマンドを実行していないとmongoがうごかない状態になっています。

sudo mongod -dbpath /usr/local/var/mongodb 2019-08-15T14:12:39.026+0900 I STORAGE [main] Max cache overflow file size custom option: 0 2019-08-15T14:12:39.030+0900 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] MongoDB starting : pid=15474 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=hasegawa-W76OC 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] db version v4.0.12 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] git version: 5776e3cbf9e7afe86e6b29e22520ffb6766e95d4 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] allocator: tcmalloc 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] modules: none 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] build environment: 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] distmod: ubuntu1804 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] distarch: x86_64 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] target_arch: x86_64 2019-08-15T14:12:39.035+0900 I CONTROL [initandlisten] options: { storage: { dbPath: "/usr/local/var/mongodb" } } 2019-08-15T14:12:39.035+0900 I STORAGE [initandlisten] Detected data files in /usr/local/var/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. 2019-08-15T14:12:39.036+0900 I STORAGE [initandlisten] 2019-08-15T14:12:39.036+0900 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2019-08-15T14:12:39.036+0900 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem 2019-08-15T14:12:39.036+0900 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1359M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress), 2019-08-15T14:12:40.342+0900 I STORAGE [initandlisten] WiredTiger message [1565845960:342769][15474:0x7f9b000d2a40], txn-recover: Main recovery loop: starting at 4/6272 to 5/256 2019-08-15T14:12:40.539+0900 I STORAGE [initandlisten] WiredTiger message [1565845960:539171][15474:0x7f9b000d2a40], txn-recover: Recovering log 4 through 5 2019-08-15T14:12:40.718+0900 I STORAGE [initandlisten] WiredTiger message [1565845960:718584][15474:0x7f9b000d2a40], txn-recover: Recovering log 5 through 5 2019-08-15T14:12:40.824+0900 I STORAGE [initandlisten] WiredTiger message [1565845960:824962][15474:0x7f9b000d2a40], txn-recover: Set global recovery timestamp: 0 2019-08-15T14:12:41.196+0900 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0) 2019-08-15T14:12:41.307+0900 I CONTROL [initandlisten] 2019-08-15T14:12:41.307+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2019-08-15T14:12:41.307+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2019-08-15T14:12:41.307+0900 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 2019-08-15T14:12:41.307+0900 I CONTROL [initandlisten] 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost. 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server. 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning. 2019-08-15T14:12:41.308+0900 I CONTROL [initandlisten] 2019-08-15T14:12:41.338+0900 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/usr/local/var/mongodb/diagnostic.data' 2019-08-15T14:12:41.339+0900 I NETWORK [initandlisten] waiting for connections on port 27017 2019-08-15T14:13:03.715+0900 I NETWORK [listener] connection accepted from 127.0.0.1:51724 #1 (1 connection now open) 2019-08-15T14:13:03.735+0900 I NETWORK [conn1] received client metadata from 127.0.0.1:51724 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.12" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "18.04" } } 2019-08-15T14:13:05.801+0900 I NETWORK [conn1] end connection 127.0.0.1:51724 (0 connections now open)

mongo.confのdbpathを上と同じパスにするとそもそもmongoが動かなくなってしまいます。

hasegawa@hasegawa-W76OC:/etc$ sudo mongod -f /etc/mongod.conf --shutdown 2019-08-15T14:09:43.827+0900 I STORAGE [main] Max cache overflow file size custom option: 0 There doesn't seem to be a server running with dbpath: /usr/local/var/mongodb

何か解決策がありましたらコメントお願いします。

補足情報(FW/ツールのバージョンなど)

mongodb: 4.0.10
OS: ubuntu

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

stmkza

2019/08/15 05:29

エラーメッセージを書いてください
aiai8976

2019/08/15 05:31

すいません。追加しました!
aiai8976

2019/08/16 04:10

すみません。修正しました。
guest

回答1

0

mongod -f /etc/mongod.conf --shutdown

これはMongoDBを終了(shutdown)させるコマンドです。

エラーメッセージで

There doesn't seem to be a server running with dbpath: /var/lib/mongodb

と言っているのは、終了させるコマンドを実行した時点で、当該dbpath(/var/lib/mongodb)を指定して起動しているMongoDBプロセスが存在せず、終了対象が無いためですね。

投稿2019/08/27 05:03

kabao

総合スコア648

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問