Skip to content
Snippets Groups Projects
Commit ba5341de authored by Iain Bryson's avatar Iain Bryson
Browse files

Move config to mongod.conf

parent 1e63c1fa
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ FROM centos:7
ARG TZ=Europe/Copenhagen
COPY mongodb-org-3.4.repo .
COPY mongodb-org-3.4.repo /etc/yum.repos.d/mongodb-org-3.4.repo
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime
RUN bash -l -c 'echo "${TZ}" > /etc/timezone'
......@@ -19,10 +19,14 @@ RUN yum -y install findutils
# for killall
RUN yum -y install psutils
# for id
RUN yum -y install coreutils
EXPOSE 27017
COPY *.js /
COPY *.sh /
COPY mongod.conf /etc/mongod.conf
RUN yum -y install sudo
......
#!/bin/bash
set -m
export STORAGE_ENGINE=wiredTiger
mongodb_cmd="mongod --storageEngine $STORAGE_ENGINE"
cmd="$mongodb_cmd --master "
#--config mongod.conf"
if [ "$AUTH" == "yes" ]; then
cmd="$cmd --auth"
fi
if [ "$JOURNALING" == "no" ]; then
cmd="$cmd --nojournal"
fi
if [ "$OPLOG_SIZE" != "" ]; then
cmd="$cmd --oplogSize $OPLOG_SIZE"
fi
echo $cmd
if [ ! -r "/data/mongo-db.yaml" ]; then
echo "config file /data/config/quiz-db.yaml not readable"
exit 1
......@@ -43,9 +23,10 @@ whoami
# Temp hack. We shouldn't need sudo or to do this, except the first time
# we run after the fix for running as a normal user: https://github.com/dtu-compute/dtu-enote-askbot/issues/6
#
sudo chown -R `whoami`:`whoami` /data/
sudo chown -R `whoami`:`id -gn` /data/
sudo chown -R `whoami`:`id -gn` /var/run/mongodb/
$cmd &
/usr/bin/mongod -f /etc/mongod.conf &
if [ "$AUTH" == "yes" ]; then
if [ ! -f /data/db/.mongodb_password_set ]; then
......@@ -62,3 +43,4 @@ fi
fg
tail -f /dev/null
\ No newline at end of file
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /data/db
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0 # Listen to local interface only, comment to listen on all interfaces.
security:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment