Not the answer you need?
Register and ask your own question!

Issue with monitoring service on MongoDB

Hello,

I am new to MongoDB and am setting up the PMM client on a 3-node cluster for the first time. On the first node I am working on, I got the linux metrics monitoring to work with no issues. But I am having trouble getting the mongodb:metrics service into a Running state.

When I run pmm-admin list, it shows the service at not running. I have tried numerous commands to get the service to start. Each time I run one of the below commands, I see a return message stating "OK, started mongodb:metrics service for <servername>"

These are the commands I have run so far:

pmm-admin add mongodb:metrics

pmm-admin add mongodb:metrics --uri mongodb://dbuser:<password>@0.0.0.0:27017/admin --cluster rs0

pmm-admin add mongodb:metrics --uri mongodb://dbuser:<password>@localhost:27017/admin --cluster rs0

I verified I can log into the Mongo instance using the dbusert account, which has admin privileges.

I have also run the start command numerous times, but am seeing the same results.

Any help with this would be appreciated- Thanks

Comments

  • MykolaMykola Percona Percona Staff Role
    can you try start service by the following line?
    pmm-admin start mongodb:metrics
    
  • rfinnertywurfinnertywu Entrant Current User Role Beginner
    Thanks Mykola- I have tried that several times, but did not work. I just tried again and get this message: OK, started mongodb:metrics service

    but the service still showing as not running.

    I am seeing this in the mongodb metrics log:

    E0413 16:23:36.979584 381 server_status.go:126] Failed to get server status.
    panic: collector has no descriptors


    Thanks,

    Ron
  • MykolaMykola Percona Percona Staff Role
    Hi Ron,

    I am trying to reproduce issue, what mongodb version do you use?

    maybe I'll prepare some custom patch with better error debug output on the next week...
  • rfinnertywurfinnertywu Entrant Current User Role Beginner
    Hi Mykola,

    We are using version 3.2.11. Please let me know if you need any additional information

    Ron
  • MykolaMykola Percona Percona Staff Role
    Hi Ron,

    I started MongoDB from this rpm https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/RPMS/mongodb-org-3.2.11-1.el7.x86_64.rpm
    after that I created user
    echo 'db.createUser({user: "someuser", pwd: "somepass", roles: [ { role: "userAdmin", db: "admin" } ] })' \
        | mongo localhost:27017/admin
    
    and checked credentials by this command
    echo 'db.runCommand( { serverStatus: 1, recordStats: 0 } )' \
        | mongo --username someuser --password somepass --host localhost --port 27017 --authenticationDatabase admin
    
    and succesfully configured pmm by this command
    pmm-admin add mongodb --cluster somecluster --uri someuser:somepass&#64;localhost:27017 some-instance
    

    can you try these commands on your system?
  • rfinnertywurfinnertywu Entrant Current User Role Beginner
    Hi Mykola,

    After running the above commands, I think the issue is with the privileges granted to the userAdmin role on the servers here. It looks like there are no privileges assigned to this role- I am not sure if this is by default or was done by the initial installer.

    I have not been able to find a listing of the privileges needed for the pmm db user - do you have this info handy?

    Thanks,

    Ron
  • MykolaMykola Percona Percona Staff Role
    can you try command from mongodb_exporter documentation?
    db.getSiblingDB("admin").createUser({
        user: "mongodb_exporter",
        pwd: "s3cr3tpassw0rd",
        roles: [
            { role: "clusterMonitor", db: "admin" },
            { role: "read", db: "local" }
        ]
    })
    
    source https://github.com/percona/mongodb_exporter#usage
  • rfinnertywurfinnertywu Entrant Current User Role Beginner
    Hi Mykola- I actually went ahead and granted the privileges in your above command to my pmm user and it works now. Thank you very much for the assistance!

    Ron
  • MykolaMykola Percona Percona Staff Role
    Ron, thank you

    Tim created ticket about improving documentation - PMM-785
    so it will improved in future :)
  • rfinnertywurfinnertywu Entrant Current User Role Beginner
    Great- thanks again for the help!

    Ron
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.