Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some comments to the index to help with debugging potential issue… #21

Merged
merged 1 commit into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,34 @@ https://docs.docker.com/engine/installation/linux/ubuntulinux/
In addition IPAM is using make to provide an abstraction for complex Docker commands. On Mac/Linux any version of GNU make is likely suitable. On Windows something like http://gnuwin32.sourceforge.net/packages/make.htm may be suitable. Otherwise the Docker commands can be
run directly using the Makefile as a guide for their format.

*Note that debug is enabled (by default) in the MongoDB Go driver. If you would like to disable, set "mgoDebug" to false in "main.go", but do so only after you are sure things are working properly. (refer to "Hint" below).*

1. git clone git@github.com:RackHD/ipam.git
2. cd ipam
3. make
4. make run
5. http://localhost:8000/pools

##

**Hint**

In certain environments, IPAM is unable to connect to MongoDB and will indicate this by logging the following messages in the debug output.

**ipam | 2016/09/16 19:50:54 no reachable servers**

**ipam exited with code 1**

Often times, this is caused by hostname resolution (DNS) problems. Locate the following message in the debug output and check to see if the IP address to which "mongodb" is resolving is correct for your environment.

**SYNC Address mongodb:27017 resolved as 10.31.61.127:27017**

If the address is not on one of the Docker "bridge" networks, but rather on some external network, then there is likely an external DNS resolving the "mongodb" hostname.

To resolve the issue, you must either configure down the NIC that has the external DNS, or reconfigure your environment such that it is not living on a network that has a DNS that will resolve for this hostname.

##

# Details

## Planned API End Points
Expand Down
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ func init() {
}

func main() {

// Default to enable mgo debug. Set to false to disable.
var mgoDebug = true

if mgoDebug {
mgo.SetDebug(true)
var aLogger *log.Logger
aLogger = log.New(os.Stderr, "", log.LstdFlags)
mgo.SetLogger(aLogger)
}

// Start off with a new mux router.
router := mux.NewRouter().StrictSlash(true)

Expand Down