Commit Graph

166 Commits (79390d0de643e48af1b1b544001d91391db88b37)

Author SHA1 Message Date
Jason Wilder 272f855d81 Close snapshot listener when closing a node 2015-04-09 20:51:46 -06:00
Jason Wilder 1494f70786 Close admin server when stopping the node 2015-04-09 20:51:40 -06:00
Jason Wilder 73bd5847b0 Close the cluster listener when closing a node
These were never closed which causes some port dancing issues
in the tests
2015-04-09 09:54:42 -06:00
Jason Wilder b7f47e1630 Return the Node from RunCommand 2015-04-09 09:44:44 -06:00
Jason Wilder 0dbf66e2fe Cleanup join logic and logging
Make it more explicit when existing cluster state is being used
versus join URLs.  Also consolidate some duplicated `if index==0`
checks.
2015-04-08 20:49:58 -06:00
Jason Wilder 59a80fb7be Simplify data node join urls
If the node is running a broker and a data node, always have the
data node client connect to the local broker since it will already
be initialized or joined.
2015-04-08 20:49:58 -06:00
Jason Wilder a612b8a0f6 Bring back Initialization.JoinURLs config option
Removing this option causes issues when deploying influxd
via configuration management. We can now define the same
set of join URLs in the config file across nodes.

This also ensures that the `-flag` option overrides the
config file setting if passed.
2015-04-08 20:49:58 -06:00
Cory LaNou ed05cadf35 move where we enable continous queries when starting up 2015-04-08 15:43:09 -06:00
Cory LaNou 65184aabc4 enable continuous query 2015-04-08 12:25:04 -06:00
Jason Wilder 2b502858dc Prevent starting server if both broker and data are disabled
Not a valid configuration so print the error and some suggestions
to fix it.
2015-04-07 12:17:28 -06:00
Jason Wilder 9e109e847b Fix typos in comments 2015-04-06 21:39:18 -06:00
Jason Wilder 01c2de62b0 Rename Server to Node
Server is very overloaded currently so use Node to represent the
container that holds onto a broker and data node (server currently)
2015-04-06 16:38:01 -06:00
Jason Wilder 54821538d1 Ignore join urls if restarting a node
If a node is restarted and it had already joined the cluster,
ignore and log that the join urls are being ignored and existing
cluster state will be used.
2015-04-06 16:38:01 -06:00
Jason Wilder 8b5307f6e8 Remove all join URLs from config
This removes all join URLs from the config.  To join a node to a
cluster, the URL of another member of the cluster should be passed
on the command line w/ the -join flag.  The join URLs can now be
any node regardless of whether the node is a broker only or data
only node.  At join time, the receiving node will redirect the
request to a valid broker or data node if it cannot handle the request
itself.
2015-04-06 16:38:01 -06:00
Jason Wilder 9af362bff5 Rename DataAddrUDP to APIAddrUDP 2015-04-06 16:38:00 -06:00
Jason Wilder d06c4ead5c Replace broker url w/ cluster url 2015-04-06 16:38:00 -06:00
Jason Wilder 5e3c26a636 Replace data port w/ cluster port 2015-04-06 16:38:00 -06:00
Jason Wilder 4a7cae4391 Replace broker port w/ cluster port 2015-04-06 16:38:00 -06:00
Jason Wilder 60c66c8515 Add data node join URLs
To add a new data node, it currently needs a broker
and another data node to join.  Temporarily adding
a JoinURLs option to the Data node section so a
standalone data node can be created but the intent is
that this will be removed.

Ideally, the the joinURL could point to either a data node
or a broker and it would get the required URLs from that
host but that is not possible currently.
2015-04-06 16:38:00 -06:00
Jason Wilder 5d6536f693 First pass at separate data and broker nodes
Adds a simple test to start a separate broker and
data node.  Data nodes still need a separate set
join URLs which is not in place yet.
2015-04-06 16:38:00 -06:00
Jason Wilder 388b1c2c05 Refactor openServer/openBroker
Simplified signature and state now depends on indexes vs directory
existence
2015-04-06 16:38:00 -06:00
Jason Wilder 6fa0ea01dd Move openBroker to RunCommand.openBroker 2015-04-06 16:38:00 -06:00
Jason Wilder 18db6fa7ba Separate baseline config from test config 2015-04-06 16:38:00 -06:00
Jason Wilder eb9956b844 Rename ContinuouseQuery Disable to Disabled
Match Broker and Data config var names
2015-04-06 16:37:59 -06:00
Jason Wilder 358bb9b3d9 Convert flag.String to flag.StringVar 2015-04-06 16:37:59 -06:00
Jason Wilder 5918d48f73 Allow passing config to RunCommand.Open 2015-04-06 16:37:59 -06:00
Jason Wilder 070bb3ccc6 Add logger to RunCommand 2015-04-06 16:37:59 -06:00
Jason Wilder 82b3108f6d Refactor execRun to RunCommand 2015-04-06 16:37:59 -06:00
Philip O'Toole dbb7d2a319 Tweak openTSDB changes and update CHANGELOG 2015-04-06 11:10:50 -07:00
Tristan Colgate-McFarlane 32d6433c04 OpenTSDB server interface
Add an input collector for the OpenTSDB telnet protcol
2015-04-05 10:29:49 +01:00
Jason Wilder 9ee0f6445e Fix broker connect race at startup
When a data node starts up, the broker URLs were not set before
they were actually being used.  The call to client.Open() in
turn triggers the raft streamer and heartbeat which try to connect
to the broker.   If those started before the subsequent client.SetURLs()
call, you would see the following error in the logs at startup:

[messaging] 2015/04/01 11:59:22 reconnecting to broker: url={  <nil>  /messaging/messages index=2&streaming=true&topicID=0 }, err=Get /messaging/messages?index=2&streaming=true&topicID=0: unsupported protocol scheme ""

Fixing this race uncovered another bug where the join urls would be
cleared the first time the broker was started.  In this case, the
join urls should be left alone since they were set properly w/ SetURLs.

Fixes #2152
2015-04-03 21:04:42 -06:00
Jason Wilder 6d4c7e9cd5 Handle broker and data node endpoints regardless of role
This is a pre-requisite for #1934.  When running separate
broker and data nodes, you currently need to know what role
a host is performing.  This complicates cluster setup in
that you must configure separate broker URLs and data node
URLs.

This change allows a broker only node to redirect data nodes endpoints
to a valid data node and a data only node to redirect broker
endpoints to a valid broker.
2015-04-03 21:00:43 -06:00
Philip O'Toole 84d590ce44 Monitoring database should not be configurable 2015-04-03 14:40:36 -07:00
Philip O'Toole 5df05d1256 It's for stats and diags, not just diags 2015-04-03 14:26:17 -07:00
Jason Wilder 91fb7e3756 Track data node urls on brokers
This sends data node urls via the broker heartbeat from each data
node.  The urls are tracked on the broker to support simpler
cluster setup as well as distributed queries.
2015-04-02 11:27:53 -06:00
Philip O'Toole f829355e3e Allow snapshot endpoint to be disabled
Fix isse #2086
2015-03-26 16:13:23 -07:00
Philip O'Toole c461c7e7b4 Remove logging to specific file 2015-03-25 17:41:39 -07:00
Ben Johnson 21782c0a67 Merge branch 'master' of https://github.com/influxdb/influxdb into backup-restore 2015-03-24 16:05:49 -06:00
Philip O'Toole fba41df82b Push version and commit hash onto Server 2015-03-23 23:45:57 -07:00
Ben Johnson 3befa12fa3 Merge branch 'master' of https://github.com/influxdb/influxdb into backup-restore
Conflicts:
	cmd/influxd/main.go
	cmd/influxd/run.go
2015-03-22 15:38:41 -06:00
Ben Johnson 11c808f55f Add restore and bootstrap.
This commit adds the "influxd restore" command to the CLI. This allows
a snapshot that has been produced by "influxd backup" to be restored
to a config location and the broker and raft directories will be
bootstrapped based on the state of the snapshot.
2015-03-22 15:31:49 -06:00
Ben Johnson 963d277a75 Add "influxd backup" command.
This commit adds the backup command to the influxd binary as well as
implements a SnapshotWriter in the influxdb package.

By default the snapshot handler binds to 127.0.0.1 so it cannot be
accessed outside of the local machine.
2015-03-22 10:54:14 -06:00
Philip O'Toole ee29214898 Make it clear where influxd storage is 2015-03-20 15:19:30 -07:00
Philip O'Toole 45ac8ff2d9 Explicitly check for errors getting current user 2015-03-20 15:18:29 -07:00
Philip O'Toole f6f74a11bd Don't check 'configExists' at Run() level
*config was always non-null, since code at a higher level ensures that a
default config is passed down if no config is specified. So this logic
was pointless.
2015-03-20 14:10:50 -07:00
Grégory Starck 0c7e062a18 Also print the broker path.
So to know/see where it's actually located.
2015-03-18 11:58:56 -04:00
Cory LaNou 961e2ee944 Print config 2015-03-16 16:24:44 -06:00
Philip O'Toole 50d2470041 Write totals, not diff, of internal stats 2015-03-15 14:32:46 -07:00
Philip O'Toole d627634991 Ensure internal retention policy exists 2015-03-15 14:32:46 -07:00
Philip O'Toole f4b3e3da9f Fix final 'go vet' errors 2015-03-15 14:32:46 -07:00