Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote-mongodb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enote
dtu-enote-mongodb
Commits
ba5341de
Commit
ba5341de
authored
7 years ago
by
Iain Bryson
Browse files
Options
Downloads
Patches
Plain Diff
Move config to mongod.conf
parent
1e63c1fa
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+5
-1
5 additions, 1 deletion
Dockerfile
cmd.sh
+4
-22
4 additions, 22 deletions
cmd.sh
mongod.conf
+43
-0
43 additions, 0 deletions
mongod.conf
with
52 additions
and
23 deletions
Dockerfile
+
5
−
1
View file @
ba5341de
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
cmd.sh
+
4
−
22
View file @
ba5341de
#!/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
This diff is collapsed.
Click to expand it.
mongod.conf
0 → 100644
+
43
−
0
View file @
ba5341de
# 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment