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

Print more info to stdout when starting a node #627

Closed
jseldess opened this issue Sep 7, 2016 · 2 comments
Closed

Print more info to stdout when starting a node #627

jseldess opened this issue Sep 7, 2016 · 2 comments

Comments

@jseldess
Copy link
Contributor

jseldess commented Sep 7, 2016

Related PR: cockroachdb/cockroach#9066

On node startup, you now get status, clusterID, and nodeID.

$ cockroach start --store=test --background
build:      beta-20160829-543-gbe463fc @ 2016/09/07 17:16:23 (go1.7)
admin:      http://localhost:8080
sql:        postgresql://root@localhost:26257?sslmode=disable
logs:       test/logs
store[0]:   path=test
status:     restarted pre-existing node
clusterID:  {4ef69723-92cc-44fa-a847-5a855b3532a7}
nodeID:     1

On develop only.

@jseldess
Copy link
Contributor Author

jseldess commented Sep 7, 2016

For now, we should update https://www.cockroachlabs.com/docs/start-a-node.html#standard-output, with disclaimer that this only applies when building from source on develop.

@jseldess
Copy link
Contributor Author

Various statuses:

    initialBoot := s.InitialBoot()
    nodeID := s.NodeID()
    if initialBoot {
        if nodeID == server.FirstNodeID {
            fmt.Fprintf(tw, "status:\tinitialized new cluster\n")
        } else {
            fmt.Fprintf(tw, "status:\tinitialized new node, joined pre-existing cluster\n")
        }
    } else {
        fmt.Fprintf(tw, "status:\trestarted pre-existing node\n")
    }
    fmt.Fprintf(tw, "clusterID:\t%s\n", s.ClusterID())
    fmt.Fprintf(tw, "nodeID:\t%d\n", nodeID)
    if err := tw.Flush(); err != nil {
        return err
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant