influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.66k stars 3.54k forks source link

Creating custom retention policy on 0.9 #3133

Closed prashleo closed 9 years ago

prashleo commented 9 years ago

I am working on proposing the right configuration of influxdb 0.9 to go with our product and the performance statistics of using influxDB 0.9

I was able to successfully setup the 3 node cluster and they are synched(creating a database on one node is reflected on all the nodes)

But when I insert measurements into the database on one node, it is not replicated on the other two This is because it is using the default retention policy ( which has the replication set to 1)

I am trying to create a custom retention policy like this and I get this error.

It is a 3 node cluster and I am using a replication of 3: appreciate your kind help

curl -G 'http://10.91.39.35:8086/query'; --data-urlencode "q=CREATE retention policy test on testdb duration 1h replication 3"

{"results":[{"error":"exec failed: apply: replication factor must match cluster size; this limitation will be lifted in v0.9.1"}]}

Steps used to create the 3 node cluster: 1-> download and install the latest 0.9 influxdb on all the 3 nodes 2-> generate the influxdb config file and update the paths (from /root/.influxdb/... to var/opt/influxdb/...) due to permission issue

  1. change the hostname to actual ip address and add the peers[ip1:8088, ip2:8088, ip3:8088] under [meta]
  2. start the influxdb server on all three nodes
otoolep commented 9 years ago

This error implies that your cluster is not actually coming together, since the node believes it's only 1 node. Do the logs on each node indicate that a cluster has formed?

prashleo commented 9 years ago

2015/06/24 19:46:46 [DEBUG] raft: Node 10.91.38.223:8088 updated peer set (2): [127.0.0.1:8088] 2015/06/24 19:46:46 [DEBUG] raft: Node 10.91.38.223:8088 updated peer set (2): [127.0.0.1:8088] 2015/06/24 19:46:46 [DEBUG] raft: Node 10.91.38.223:8088 updated peer set (2): [10.91.38.210:8088 10.91.39.35:8088 10.91.38.223:8088]

similar message is there on all the 3 nodes, and also when I create a Database one one node, it shows up on all other nodes as wel

prashleo commented 9 years ago

also there is no "cluster" tab on the web UI as it used to be in 0.88??

prashleo commented 9 years ago

Carefully redoing the 3 node setup solved this for me, again having the cluster tab in the GUI was so helpful, atleast to verify that all the nodes are coming together. thanks otoolep

otoolep commented 9 years ago

OK, glad you sorted it out.

prashleo commented 9 years ago

Thanks for your help otoolep.

I have an issue inserting multiple measurements, its failing with "bad time stamp" but the same time stamp works perfect when inserting just one measurement/points

is it the write syntax( I got this syntax from Influxdb document)

lab@influxdb0:~$ curl -i -XPOST ' http://10.91.38.210:8086/write?db=testdb&rp=test&precision=s' -d 'cpu_load_short,host=server01,region=us-west value=0.64 cpu_load_short,host=server02,region=us-west value=0.55 1435281408 cpu_load_short1,direction=in,host=server01,region=us-west value=23422.0 1435281408'

HTTP/1.1 400 Bad Request

Request-Id: 6d76f70b-1ba1-11e5-8013-000000000000

X-Influxdb-Version: FIXME

Date: Fri, 26 Jun 2015 01:19:44 GMT

Content-Length: 13

Content-Type: text/plain; charset=utf-8

bad timestamplab@influxdb0:~$ -Prashanth On Thu, Jun 25, 2015 at 5:05 PM, otoolep notifications@github.com wrote:

OK, glad you sorted it out.

— Reply to this email directly or view it on GitHub https://github.com/influxdb/influxdb/issues/3133#issuecomment-115434484.

otoolep commented 9 years ago

We can take a look, but can you open a new issue first?

prashleo commented 9 years ago

done https://github.com/influxdb/influxdb/issues/3147

On Thu, Jun 25, 2015 at 6:41 PM, otoolep notifications@github.com wrote:

We can take a look, but can you open a new issue first?

— Reply to this email directly or view it on GitHub https://github.com/influxdb/influxdb/issues/3133#issuecomment-115454106.