2017-04-01 1 views
0

Ich habe mongodb in einer unserer Umgebungen installiert & Dies wurde mit MongoDb Operations Manager durchgeführt. Obwohl ich meine PATH-Variable korrekt eingestellt habe, kann ich die mongo-Shell nicht mit meinem Benutzerkonto verbinden, aber als sudo verbinden. Könnte mir jemand helfen, wenn ich hier etwas vermisse?RHEL Umgebungsvariabler Pfad zu Mongo Shell

Details:

[[email protected]@rhel01 /]$ echo $PATH 
> /var/lib/mongodb-mms-automation/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/nfs/home/user01/.local/bin:/nfs/home/user01/bin 
[[email protected]@rhel01 /]$ mongo 
> -bash: mongo: command not found 

[[email protected]@rhel01 /]$ sudo -i 
[sudo] password for [email protected]: 
[[email protected] ~]# echo $PATH 
> /var/lib/mongodb-mms-automation/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin 
[[email protected] ~]# mongo 
> MongoDB shell 
> version: 3.2.10 connecting to: test 
> MongoDB Enterprise MYMONGOREPLSET01:PRIMARY> 

Welche Ausgabe Mongo:

[[email protected]@rhel01 /]$ which mongo 
/usr/bin/which: no mongo in (/var/lib/mongodb-mms-automation/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/nfs/home/user01/.local/bin:/nfs/home/user01/bin) 

[[email protected] ~]# which mongo 
/var/lib/mongodb-mms-automation/bin/mongo 

Beobachtung:

Ich habe gerade bemerkt der Lagerplatz ist wie folgt festgelegt ...

[[email protected] mongodb-mms-automation]# pwd 
/var/lib/mongodb-mms-automation 
[[email protected] mongodb-mms-automation]# ls -la 
total 32 
drwxr-xr-x 3 mongod mongod 4096 Mar 30 13:58 . 
drwxr-xr-x. 57 root root 4096 Apr 1 03:23 .. 
lrwxrwxrwx 1 mongod mongod 67 Nov 4 13:45 bin -> /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-3.2.10-ent/bin 
-rw------- 1 mongod mongod 1024 Mar 27 15:07 keyfile 
-rw------- 1 mongod mongod 10686 Mar 30 13:58 mms-cluster-config-backup.json 
drwxr-x--- 4 mongod mongod 4096 Nov 4 13:45 mongodb-linux-x86_64-3.2.10-ent 
+0

anzeigen Ausgabe von ', die von Benutzer root mongodb'. – Cyrus

+0

@Cyrus: Ich denke, es sollte 'which mongo' oder' whereis mongo' sein und nicht 'which mongodb'? –

+0

Sorry, fügen Sie die Ausgabe von 'which mongo' aus dem Benutzer root hinzu. – Cyrus

Antwort

1

Versuchen Sie, diese

sudo chmod -R 777 /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-3.2.10-ent/bin/ 
+0

es hat nicht funktioniert ... – sqlcheckpoint

+0

Als Ihr aktueller Benutzer (nicht als root), gehen Sie zu diesem Ort und führen Sie aus: "./mongo" dann kommentieren Sie Ihre Ausgabe – shahin

+0

sicher, ich werde überprüfen und das Ergebnis posten. – sqlcheckpoint

0

füge dies dem Pfad/var/lib/mongodb-mms-Automatisierung/mongodb-linux-x86_64-3.2.10-ent/bin

+0

Ich habe es hinzugefügt, aber es hat immer noch nicht funktioniert ... hier ist mein Pfad nach dem Anfügen. /var/lib/mongodb-mms-automation/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/nfs/home/user01/.local/bin: /nfs/home/user01/bin:/var/lib/mongodb-mms-automation/mongodb-linux-x86_64-3.2.10-ent/bin – sqlcheckpoint