#!/bin/sh
function command(){
###################################
rst_name=myrst
port=3000$1
log_path=/opt/mongo/logs/rst$1.log
bind_ip=127.0.0.1
key_file=/opt/mongo/mongo_rst.key
db_path=/opt/mongo/db$1/
###################################
nohup mongod --replSet $rst_name --dbpath=$db_path --port $port --keyFile=$key_file --bind_ip=$bind_ip --logpath=$log_path > /dev/null 2>&1 &
}
command 1
command 2
command 3