שיוך בסיס נתונים של ה-mongo לנתיב dbpath שונה.

שיווקי

New member
שיוך בסיס נתונים של ה-mongo לנתיב dbpath שונה.

היי,

אני מנסה לשנות את ה-dbpath של ה-mongo לאחד אחר.

הפעולות שביצעתי:
קוד:
systemctl stop mongod
// in my folder:
mkdir data
pwd
// use the full path
mongod --dbpath <fullpath of data>
// stop the running.
nano /etc/mongod.conf
//in mongod.conf change dbpath to the new path.
systetmctl start mongod
* הרצתי mongod --dbpath וכו' כדי שיהיו בספריה data מספר קבצים וספריות.

אך, לאחר שאני מנסה להריץ את ה-mongo ע"י
mongo
אני מקבל את ההודעה:
קוד:
MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017
2017-10-27T12:47:03.810-0400 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2017-10-27T12:47:03.810-0400 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed

כשאני מחזיר ב-mongod.config לנתיב הרגיל - הכל פועל כשורה, וללא הודעות שגיאה (אני מצליח להריץ mongo).

ב-2 הספריות יש נתונים.

אשמח לעזרה - איך לשנות בכו"ז לנתיב אחר ושיעבוד תקין.

תודה.
 
למעלה