Let's say you want to host domains first.com and second.com.
Create folders for their files:
| import { Logger } from './logger'; | |
| import { environment } from '@environments/environment'; | |
| describe('Logger Spec', () => { | |
| let debug; | |
| let info; | |
| let warn; | |
| let err; | |
| let log; |
| import { Injectable } from '@angular/core'; | |
| import { environment } from '@environments/environment'; | |
| /** | |
| * Class of static methods to allow for consistent console logging. | |
| * @export | |
| */ | |
| @Injectable({ | |
| providedIn: 'root' |
| /** | |
| * Poblado de datos | |
| */ | |
| SET FOREIGN_KEY_CHECKS = 0; | |
| SET AUTOCOMMIT = 0; | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
| SET time_zone = "+00:00"; | |
| START TRANSACTION; | |
| INSERT INTO geo_departamentos VALUES (null, 'Alta Verapaz'); |
| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
| [template] | |
| src = "mongo.tmpl" | |
| dest = "/home/ubuntu/mongo_rep.sh" | |
| keys = [ | |
| "/mongo", | |
| ] | |
| reload_cmd = "echo update mongodb && sh /home/ubuntu/mongo_rep.sh" |
| #! /bin/sh | |
| mongo <<EOF | |
| rs.initiate() | |
| {{range $service := ls "/mongo"}} | |
| rs.add('{{.}}:27017') | |
| {{end}} | |
| quit() | |
| exit |
| #! /bin/sh | |
| mongo -u mongo-admin -p admin --authenticationDatabase admin <<EOF | |
| rs.initiate() | |
| rs.add('mong_a:27017') | |
| rs.add('mong_b:27017') | |
| quit() | |
| exit |
| # mongod.conf | |
| # for documentation of all options, see: | |
| # http://docs.mongodb.org/manual/reference/configuration-options/ | |
| # Where and how to store data. | |
| storage: | |
| dbPath: /var/lib/mongodb | |
| journal: | |
| enabled: true |