我目前在我的Mac(Sierra)上設置副本集(按照關於創建副本集的mongoDB教程的說明)存在問題。我已經下載了相關的sh文件,當我運行此代碼:試圖創建副本集的問題
bash < create_replica_set__m101p_52b35df6e2d423678d3b9d48.19830756d7a7.sh
這是腳本:
#!/usr/bin/env bash
mkdir -p /data/rs1 /data/rs2 /data/rs3
mongod --replSet m101 --logpath "1.log" --dbpath /data/rs1 --port 27017 --oplogSize 64 --fork --smallfiles
mongod --replSet m101 --logpath "2.log" --dbpath /data/rs2 --port 27018 --oplogSize 64 --smallfiles --fork
mongod --replSet m101 --logpath "3.log" --dbpath /data/rs3 --port 27019 --oplogSize 64 --smallfiles --fork
我得到這個錯誤在我的終端:
mkdir: /data/rs1: Permission denied mkdir: /data/rs2: Permission denied mkdir: /data/rs3: Permission denied about to fork child process, waiting until server is ready for connections. forked process: 27998 ERROR: child process failed, exited with error number 100 about to fork child process, waiting until server is ready for connections. forked process: 28001 ERROR: child process failed, exited with error number 100 about to fork child process, waiting until server is ready for connections. forked process: 28004 ERROR: child process failed, exited with error number 100
我試圖用sudo做到這一點,我得到了同樣的結果。
我試圖在我的下載文件夾和桌面上運行這個。我已經將它移到了我的主目錄,並且我沒有註銷到控制檯,它只是返回一個新行。
我需要在這裏做什麼?
謝謝
你是一個優秀的人。謝謝。 – bloppit