Commit 622e7028 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Initial commit

parents
all: mongodb-service
rm /etc/passwd
mv -v /data/etc/passwd /etc/passwd
rm /etc/group
mv -v /data/etc/group /etc/group
rm /etc/shadow
mv -v /data/etc/shadow /etc/shadow
rm /etc/gshadow
mv -v /data/etc/gshadow /etc/gshadow
groupadd -g 27 mongodb
useradd -c "MongoDB Database Server" -d /srv/www -g mongodb -s /bin/false -u 27 mongodb
rm /etc/passwd-
rm /etc/group-
rm /etc/shadow-
rm /etc/gshadow-
mv -v /etc/passwd /data/etc/passwd
ln -sv /data/etc/passwd /etc/passwd
mv -v /etc/group /data/etc/group
ln -sv /data/etc/group /etc/group
mv -v /etc/shadow /data/etc/shadow
ln -sv /data/etc/shadow /etc/shadow
mv -v /etc/gshadow /data/etc/gshadow
ln -sv /data/etc/gshadow /etc/gshadow
dd if=/dev/zero of=swap bs=1048576 count=5120
chmod 600 swap
mkswap swap
swapon swap
tar xf mongodb-src-r4.0.6.tar.gz
cd mongodb-src-r4.0.6 && pip install -r buildscripts/requirements.txt
cd mongodb-src-r4.0.6 && scons all --disable-warnings-as-errors MONGO_VERSION=4.0.6 -j 1
cd mongodb-src-r4.0.6 && scons --prefix=/usr install --disable-warnings-as-errors MONGO_VERSION=4.0.6
cd mongodb-src-r4.0.6 && pip uninstall -y -r buildscripts/requirements.txt
@echo "$$MONGODB_SERVICE" > /lib/systemd/system/mongodb.service
systemctl enable mongodb.service
install -v -Dm755 mongod.conf /etc
install -v -m755 -o mongodb -g mongodb -d /var/lib/mongodb
@echo "d /run/mongodb 755 mongodb mongodb -" > /usr/lib/tmpfiles.d/mongodb.conf
rm -rf mongodb-src-r4.0.6
swapoff swap
rm -rf swap
mongodb-service:
define MONGODB_SERVICE
[Unit]
Description=High-performance, schema-free document-oriented database
After=syslog.target network.target
[Service]
Type=forking
User=mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf run
PrivateTmp=true
LimitNOFILE=64000
TimeoutStartSec=180
[Install]
WantedBy=multi-user.target
endef MONGODB_SERVICE
export MONGODB_SERVICE
##
## For list of options visit:
## https://docs.mongodb.org/manual/reference/configuration-options/
##
# systemLog Options - How to do logging
systemLog:
# The default log message verbosity level for components (0-5)
verbosity: 0
# The destination to which MongoDB sends all log output (file|syslog, if not specifed to STDOUT)
destination: syslog
# Log file to send write to instead of stdout - has to be a file, not directory
#path: /var/log/mongodb/mongod.log
# Append to logpath instead of over-writing (false by default)
logAppend: true
# Set the log rotation behavior (rename|reopen, rename by default)
logRotate: reopen
# processManagement Options - How the process runs
processManagement:
# Fork server process (false by default)
fork: true
# Full path to pidfile (if not set, no pidfile is created)
pidFilePath: /run/mongodb/mongod.pid
# net Options - Network interfaces settings
net:
# Specify port number (27017 by default)
port: 27017
# Comma separated list of ip addresses to listen on (all local ips by default)
bindIp: 127.0.0.1,::1
# Enable IPv6 support (disabled by default)
ipv6: true
unixDomainSocket:
# Enable/disable listening on the UNIX domain socket (true by default)
enabled: true
# Alternative directory for UNIX domain sockets (defaults to /tmp)
pathPrefix: /run/mongodb
#ssl:
# Set the SSL operation mode (disabled|allowSSL|preferSSL|requireSSL)
#mode: <string>
# PEM file for ssl
#PEMKeyFile: <string>
# Certificate Authority file for SSL
#CAFile: <string>
# storage Options - How and Where to store data
storage:
# Directory for datafiles (defaults to /data/db/)
dbPath: /var/lib/mongodb
#journal:
# Enable/Disable journaling (journaling is on by default for 64 bit)
#enabled: true
# The storage engine for the mongod database (mmapv1|wiredTiger, wiredTiger by default
# - works for 64 bit only)
# Also possible to use unstable engines: devnull|ephemeralForTest
engine: wiredTiger
#mmapv1:
# Enable or disable the preallocation of data files (true by default)
#preallocDataFiles: <boolean>
# Use a smaller default file size (false by default)
#smallFiles: <boolean>
#wiredTiger:
#engineConfig:
# The maximum size of the cache that WiredTiger will use for all data
# (max(60% of RAM - 1GB, 1GB) by default)
#cacheSizeGB: 5
# The type of compression to use to compress WiredTiger journal data
# (none|snappy|zlib, snappy by default)
#journalCompressor: <string>
#collectionConfig:
# The default type of compression to use to compress collection data
# (none|snappy|zlib, snappy by default)
#blockCompressor: <string>
# secutiry Options - Authorization and other security settings
#security:
# Private key for cluster authentication
#keyFile: <string>
# Run with/without security (enabled|disabled, disabled by default)
#authorization
# setParameter Options - Set MongoDB server parameters
# setParameter:
# opratrionProfiling Options - Profiling settings
#operationProfiling:
# replication Options - ReplSet settings
#replication:
# sharding Options - Shard settings
#sharding:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment