How to determine if the authentication is successful after the MongoDB cluster is added security authentication

Source: Internet
Author: User
Tags mongo shell

Connect MongoDB first by connecting the database with the MONGO shell:

Switch to the MongoDB directory

#cd/mongodb/bin

Input Port Login MongoDB

#./mongo--port=27017

#切换到admin用户下 (You must switch to this user, otherwise you will not be able to do the authentication login):
Use admin
#连接时候通过auth命令进行连接 (ACCOUNT,PWD)
Db.auth ("Test", "1234")
#查询集群状态
Rs.status ()
If you see that each cluster node is healthy, the authentication succeeds and the node status is normal.

This article is from the "Grass Life" blog, please be sure to keep this source http://xiaocao13140.blog.51cto.com/6198256/1930196

How to determine if the authentication is successful after the MongoDB cluster is added security authentication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.