Hi,
ich habe die mongosdb wie folgt installiert:
1 2 3 4 5 | echo "Installing MongoDB" apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee /etc/apt/sources.list.d/10gen.list apt-get update apt-get -y install mongodb-10gen |
Problem: Als root kann ich die Datenbank problemlos starten, als normaler Nutzer nicht.
Init-Script (/etc/init/mongodb.conf):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Ubuntu upstart file at /etc/init/mongodb.conf limit nofile 20000 20000 kill timeout 300 # wait 300s between SIGTERM and SIGKILL. start on runlevel [2345] stop on runlevel [06] script ENABLE_MONGODB="yes" if [ -f /etc/default/mongodb ]; then . /etc/default/mongodb; fi if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --quiet --start --chuid mongos --exec /usr/bin/mongod -- --config /etc/mongodb.conf; fi end script |
Der Nutzter "mongos" wurde wie folgt angelegt von mir:
1 | sudo adduser --disabled-login --shell /bin/false mongos |
Die Konfigurationsdatei (/etc/mongodb.conf)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | # mongodb.conf # Where to store the data. # Note: if you run mongodb as a non-root user (recommended) you may # need to create and set permissions for this directory manually, # e.g., if the parent directory isn't mutable by the mongodb user. dbpath=/home/mongos/ #where to log logpath=/home/mongos/log/mongodb.log logappend=true # port = 27017 # Disables write-ahead journaling # nojournal = true # Enables periodic logging of CPU utilization and I/O wait #cpu = true # Turn on/off security. Off is currently the default #noauth = true #auth = true # Verbose logging output. # verbose = true # Inspect all client data for validity on receipt (useful for # developing drivers) #objcheck = true # Enable db quota management #quota = true # Set oplogging level where n is # 0=off (default) # 1=W # 2=R # 3=both # 7=W+some reads #diaglog = 0 # Ignore query hints #nohints = true # Disable the HTTP interface (Defaults to localhost:28017). #nohttpinterface = true # Turns off server-side scripting. This will result in greatly limited # functionality #noscripting = true # Turns off table scans. Any query that would do a table scan fails. #notablescan = true # Disable data file preallocation. #noprealloc = true # Specify .ns file size for new databases. # nssize = <size> # Accout token for Mongo monitoring server. #mms-token = <token> # Server name for Mongo monitoring server. #mms-name = <server-name> # Ping interval for Mongo monitoring server. #mms-interval = <seconds> # Replication Options # in master/slave replicated mongo databases, specify here whether # this is a slave or master #slave = true #source = master.example.com # Slave only: specify a single database to replicate #only = master.example.com # or #master = true #source = slave.example.com # in replica set configuration, specify the name of the replica set # replSet = setname |
(Dateirechte:)
1 2 | /etc/mongodb.conf -rw-r--r-- 1 mongos mongos 1890 Okt 1 16:15 /etc/mongodb.conf |
Die Verzeichnisrechte:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ls -l /home insgesamt 8 drwxrwxr-x 4 mongos mongos 4096 Okt 1 16:19 mongos ls -l /home/mongos** insgesamt 294920 -rw-rw-r-- 1 mongos mongos 67108864 Okt 1 16:11 graylog2_setup.0 -rw-rw-r-- 1 mongos mongos 134217728 Okt 1 16:11 graylog2_setup.1 -rw-rw-r-- 1 mongos mongos 16777216 Okt 1 16:11 graylog2_setup.ns drwxrwxr-x 2 mongos mongos 4096 Okt 1 16:19 journal -rw-rw-r-- 1 mongos mongos 67108864 Okt 1 16:19 local.0 -rw-rw-r-- 1 mongos mongos 16777216 Okt 1 16:19 local.ns drwxrwxr-x 2 mongos mongos 4096 Okt 1 16:19 log silveruser@LogBridge:/$ ls -l /home/mongos/** -rw-rw-r-- 1 mongos mongos 67108864 Okt 1 16:11 /home/mongos/graylog2_setup.0 -rw-rw-r-- 1 mongos mongos 134217728 Okt 1 16:11 /home/mongos/graylog2_setup.1 -rw-rw-r-- 1 mongos mongos 16777216 Okt 1 16:11 /home/mongos/graylog2_setup.ns -rw-rw-r-- 1 mongos mongos 67108864 Okt 1 16:19 /home/mongos/local.0 -rw-rw-r-- 1 mongos mongos 16777216 Okt 1 16:19 /home/mongos/local.ns /home/mongos/journal: insgesamt 3145740 -rw-rw-r-- 1 mongos mongos 1073741824 Okt 1 16:19 prealloc.0 -rw-rw-r-- 1 mongos mongos 1073741824 Okt 1 16:12 prealloc.1 -rw-rw-r-- 1 mongos mongos 1073741824 Okt 1 16:11 prealloc.2 /home/mongos/log: insgesamt 4 -rw-rw-r-- 1 mongos mongos 2469 Okt 1 16:19 mongodb.log |
Starte ich den Server alternativ manuell, kommt folgender Fehler:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | sudo -u mongos mongod --config /etc/mongodb.conf Wed Oct 1 16:31:24.396 terminate() called, printing stack (if implemented for platform): 0xde9a71 0x6cfbbe 0x329c5094836 0x329c5094863 0x329c5094aa2 0xe01041 0xddfee1 0xde0799 0xddee39 0xddef99 0x70256c 0x702a0c 0x702db2 0x702df1 0x703243 0x6defc5 0x6e0ed9 0x329c4775ec5 0x6cf9a9 mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde9a71] mongod(_ZN5mongo11myterminateEv+0x3e) [0x6cfbbe] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e836) [0x329c5094836] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e863) [0x329c5094863] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5eaa2) [0x329c5094aa2] mongod(_ZN5boost11filesystem36detail6statusERKNS0_4pathEPNS_6system10error_codeE+0x231) [0xe01041] mongod(_ZN5mongo11ProcessInfo16checkNumaEnabledEv+0x41) [0xddfee1] mongod(_ZN5mongo11ProcessInfo10SystemInfo17collectSystemInfoEv+0x3a9) [0xde0799] mongod(_ZN5mongo11ProcessInfo20initializeSystemInfoEv+0xa9) [0xddee39] mongod(_ZN5mongo36_mongoInitializerFunction_SystemInfoEPNS_18InitializerContextE+0x9) [0xddef99] mongod(_ZN5boost6detail8function17function_invoker1IPFN5mongo6StatusEPNS3_18InitializerContextEES4_S6_E6invokeERNS1_15function_bufferES6_+0xc) [0x70256c] mongod(_ZNK5mongo11Initializer7executeERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x13c) [0x702a0c] mongod(_ZN5mongo21runGlobalInitializersERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x32) [0x702db2] mongod(_ZN5mongo26runGlobalInitializersOrDieERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x21) [0x702df1] mongod(_ZN5mongo26runGlobalInitializersOrDieEiPKPKcS3_+0x3b3) [0x703243] mongod() [0x6defc5] mongod(main+0x9) [0x6e0ed9] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x329c4775ec5] mongod() [0x6cf9a9] Wed Oct 1 16:31:24.400 Got signal: 6 (Aborted). Wed Oct 1 16:31:24.403 Backtrace: 0xde9a71 0x6d0d39 0x329c478ac30 0x329c478abb9 0x329c478dfc8 0x6cfbc3 0x329c5094836 0x329c5094863 0x329c5094aa2 0xe01041 0xddfee1 0xde0799 0xddee39 0xddef99 0x70256c 0x702a0c 0x702db2 0x702df1 0x703243 0x6defc5 mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde9a71] mongod(_ZN5mongo10abruptQuitEi+0x399) [0x6d0d39] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x329c478ac30] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x329c478abb9] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x329c478dfc8] mongod(_ZN5mongo11myterminateEv+0x43) [0x6cfbc3] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e836) [0x329c5094836] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5e863) [0x329c5094863] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5eaa2) [0x329c5094aa2] mongod(_ZN5boost11filesystem36detail6statusERKNS0_4pathEPNS_6system10error_codeE+0x231) [0xe01041] mongod(_ZN5mongo11ProcessInfo16checkNumaEnabledEv+0x41) [0xddfee1] mongod(_ZN5mongo11ProcessInfo10SystemInfo17collectSystemInfoEv+0x3a9) [0xde0799] mongod(_ZN5mongo11ProcessInfo20initializeSystemInfoEv+0xa9) [0xddee39] mongod(_ZN5mongo36_mongoInitializerFunction_SystemInfoEPNS_18InitializerContextE+0x9) [0xddef99] mongod(_ZN5boost6detail8function17function_invoker1IPFN5mongo6StatusEPNS3_18InitializerContextEES4_S6_E6invokeERNS1_15function_bufferES6_+0xc) [0x70256c] mongod(_ZNK5mongo11Initializer7executeERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x13c) [0x702a0c] mongod(_ZN5mongo21runGlobalInitializersERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x32) [0x702db2] mongod(_ZN5mongo26runGlobalInitializersOrDieERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x21) [0x702df1] mongod(_ZN5mongo26runGlobalInitializersOrDieEiPKPKcS3_+0x3b3) [0x703243] mongod() [0x6defc5] |
Was habe ich übersehen 😕 ?
Danke, Viele Grüße!