forked from scality/cloudserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdserver.js
29 lines (26 loc) · 1.05 KB
/
mdserver.js
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
'use strict'; // eslint-disable-line strict
const { config } = require('./lib/Config.js');
const MetadataFileServer =
require('arsenal').storage.metadata.file.MetadataFileServer;
const logger = require('./lib/utilities/logger');
process.on('uncaughtException', err => {
logger.fatal('caught error', {
error: err.message,
stack: err.stack,
workerId: this.worker ? this.worker.id : undefined,
workerPid: this.worker ? this.worker.process.pid : undefined,
});
process.exit(1);
});
if (config.backends.metadata === 'file') {
const mdServer = new MetadataFileServer(
{ bindAddress: config.metadataDaemon.bindAddress,
port: config.metadataDaemon.port,
path: config.metadataDaemon.metadataPath,
restEnabled: config.metadataDaemon.restEnabled,
restPort: config.metadataDaemon.restPort,
recordLog: config.recordLog,
versioning: { replicationGroupId: config.replicationGroupId },
log: config.log });
mdServer.startServer();
}