質問編集履歴
2
.confの内容を修正しました。 mongodb.logを追記しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
mongodも起動していない状態です
|
9
9
|
お願いいたします。
|
10
10
|
|
11
|
-
|
11
|
+
```mongodb.conf
|
12
12
|
$ cat /etc/mongodb.conf
|
13
13
|
\# mongodb.conf
|
14
14
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
logappend=true
|
22
22
|
|
23
|
-
bind_ip = 127.0.0.1,192.168.
|
23
|
+
bind_ip = 127.0.0.1,192.168.100.100
|
24
24
|
port = 27017
|
25
25
|
|
26
26
|
\# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
|
@@ -111,8 +111,10 @@
|
|
111
111
|
\#sslPEMKeyFile = /etc/ssl/mongodb.pem
|
112
112
|
\#sslPEMKeyPassword = pass
|
113
113
|
|
114
|
-
|
114
|
+
```
|
115
115
|
|
116
|
+
|
117
|
+
```mongoDB起動時のメッセージ
|
116
118
|
$ mongo
|
117
119
|
MongoDB shell version v3.6.3
|
118
120
|
connecting to: mongodb://127.0.0.1:27017
|
@@ -120,4 +122,22 @@
|
|
120
122
|
2019-07-24T14:59:42.312+0900 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
|
121
123
|
connect@src/mongo/shell/mongo.js:251:13
|
122
124
|
@(connect):1:6
|
123
|
-
exception: connect failed
|
125
|
+
exception: connect failed
|
126
|
+
```
|
127
|
+
|
128
|
+
```/var/log/mongodb/mongodb.log
|
129
|
+
2019-07-25T09:15:44.551+0900 I CONTROL [main] ***** SERVER RESTARTED *****
|
130
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] MongoDB starting : pid=2523 port=27017 dbpath=/data/db 64-bit host=ubuntuDB
|
131
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] db version v3.6.3
|
132
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
|
133
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017
|
134
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] allocator: tcmalloc
|
135
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] modules: none
|
136
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] build environment:
|
137
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] distarch: x86_64
|
138
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] target_arch: x86_64
|
139
|
+
2019-07-25T09:15:44.558+0900 I CONTROL [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindIp: "127.0.0.1,192.168.100.100", port: 27017 }, storage: { dbPath: "/data/db", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongodb.log" } }
|
140
|
+
2019-07-25T09:15:44.587+0900 E STORAGE [initandlisten] Failed to set up listener: SocketException: Cannot assign requested address
|
141
|
+
2019-07-25T09:15:44.587+0900 I CONTROL [initandlisten] now exiting
|
142
|
+
2019-07-25T09:15:44.587+0900 I CONTROL [initandlisten] shutting down with code:48
|
143
|
+
```
|
1
.confを追記しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,11 +9,108 @@
|
|
9
9
|
お願いいたします。
|
10
10
|
|
11
11
|
##/etc/mongodb.confの内容
|
12
|
+
$ cat /etc/mongodb.conf
|
13
|
+
\# mongodb.conf
|
12
14
|
|
15
|
+
\# Where to store the data.
|
16
|
+
dbpath=/data/db
|
13
17
|
|
18
|
+
\#where to log
|
19
|
+
logpath=/var/log/mongodb/mongodb.log
|
14
20
|
|
15
|
-
|
21
|
+
logappend=true
|
16
22
|
|
23
|
+
bind_ip = 127.0.0.1,192.168.188.201
|
24
|
+
port = 27017
|
25
|
+
|
26
|
+
\# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
|
27
|
+
journal=true
|
28
|
+
|
29
|
+
\# Enables periodic logging of CPU utilization and I/O wait
|
30
|
+
\#cpu = true
|
31
|
+
|
32
|
+
\# Turn on/off security. Off is currently the default
|
33
|
+
\#noauth = true
|
34
|
+
\#auth = true
|
35
|
+
|
36
|
+
\# Verbose logging output.
|
37
|
+
\#verbose = true
|
38
|
+
|
39
|
+
\# Inspect all client data for validity on receipt (useful for
|
40
|
+
\# developing drivers)
|
41
|
+
\#objcheck = true
|
42
|
+
|
43
|
+
\# Enable db quota management
|
44
|
+
\#quota = true
|
45
|
+
|
46
|
+
\# Set diagnostic logging level where n is
|
47
|
+
\# 0=off (default)
|
48
|
+
\# 1=W
|
49
|
+
\# 2=R
|
50
|
+
\# 3=both
|
51
|
+
\# 7=W+some reads
|
52
|
+
\#diaglog = 0
|
53
|
+
|
54
|
+
\# Diagnostic/debugging option
|
55
|
+
\#nocursors = true
|
56
|
+
|
57
|
+
\# Ignore query hints
|
58
|
+
\#nohints = true
|
59
|
+
|
60
|
+
\# Disable the HTTP interface (Defaults to localhost:27018).
|
61
|
+
\#nohttpinterface = true
|
62
|
+
|
63
|
+
\# Turns off server-side scripting. This will result in greatly limited
|
64
|
+
\# functionality
|
65
|
+
\#noscripting = true
|
66
|
+
|
67
|
+
\# Turns off table scans. Any query that would do a table scan fails.
|
68
|
+
\#notablescan = true
|
69
|
+
|
70
|
+
\# Disable data file preallocation.
|
71
|
+
\#noprealloc = true
|
72
|
+
|
73
|
+
\# Specify .ns file size for new databases.
|
74
|
+
\# nssize = <size>
|
75
|
+
|
76
|
+
\# Accout token for Mongo monitoring server.
|
77
|
+
\#mms-token = <token>
|
78
|
+
|
79
|
+
\# Server name for Mongo monitoring server.
|
80
|
+
\#mms-name = <server-name>
|
81
|
+
|
82
|
+
\# Ping interval for Mongo monitoring server.
|
83
|
+
\#mms-interval = <seconds>
|
84
|
+
|
85
|
+
\# Replication Options
|
86
|
+
|
87
|
+
\# in replicated mongo databases, specify here whether this is a slave or master
|
88
|
+
\#slave = true
|
89
|
+
\#source = master.example.com
|
90
|
+
\# Slave only: specify a single database to replicate
|
91
|
+
\#only = master.example.com
|
92
|
+
\# or
|
93
|
+
\#master = true
|
94
|
+
\#source = slave.example.com
|
95
|
+
|
96
|
+
\# Address of a server to pair with.
|
97
|
+
\#pairwith = <server:port>
|
98
|
+
\# Address of arbiter server.
|
99
|
+
\#arbiter = <server:port>
|
100
|
+
\# Automatically resync if slave data is stale
|
101
|
+
\#autoresync
|
102
|
+
\# Custom size for replication operation log.
|
103
|
+
\#oplogSize = <MB>
|
104
|
+
\# Size limit for in-memory storage of op ids.
|
105
|
+
\#opIdMem = <bytes>
|
106
|
+
|
107
|
+
\# SSL options
|
108
|
+
\# Enable SSL on normal ports
|
109
|
+
\#sslOnNormalPorts = true
|
110
|
+
\# SSL Key file and password
|
111
|
+
\#sslPEMKeyFile = /etc/ssl/mongodb.pem
|
112
|
+
\#sslPEMKeyPassword = pass
|
113
|
+
|
17
114
|
##mongoDB起動時のメッセージ
|
18
115
|
|
19
116
|
$ mongo
|
@@ -23,7 +120,4 @@
|
|
23
120
|
2019-07-24T14:59:42.312+0900 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
|
24
121
|
connect@src/mongo/shell/mongo.js:251:13
|
25
122
|
@(connect):1:6
|
26
|
-
exception: connect failed
|
123
|
+
exception: connect failed
|
27
|
-
|
28
|
-
|
29
|
-
##/var/log/mongodb/mongodb.log
|