Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1404

Clarification on --bind_ip interaction with unix socket

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • mongodb-2.4
    • manual
    • None

    Description

      If you use --bind_ip without including the loopback IP address (127.0.0.1) this also has the side effect of not creating a unix socket. This isn't stated in the current documentation: http://docs.mongodb.org/manual/reference/configuration-options/#bind_ip.

      There is currently (as at 2.2.4/2.4.1) an explicit assumption in the code so the socket is only created if listening to the loopback or "any" IP: https://github.com/mongodb/mongo/blob/r2.2.4/src/mongo/util/net/listen.cpp#L91

      A workaround is to include the loopback IP in the bind_ip list (which supports multiple values with a comma), eg:

      mongod --bind_ip 192.168.1.2,127.0.0.1

      The docs also (incorrectly) suggest that a unix socket is always created unless --nounixsocket is true:
      http://docs.mongodb.org/manual/reference/configuration-options/#nounixsocket

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 44 weeks, 1 day ago