My influxdb and influx-stress are in different hosts.
Command is: ./influx-stress insert cpu,cluster=xxx,dc=xxx,host=xxx,cpu=xxx --batch-size 10000 --host 192.168.12.5 --points 1 --pps 10000 --series 10000 --stats-host 192.168.12.5 --kapacitor true
Test is failure, and error log is: no such host.
I modified writeURLFromConfig as following:
func writeURLFromConfig(cfg ClientConfig) string {
params := url.Values{}
params.Set("db", cfg.Database)
if cfg.User != "" {
params.Set("u", cfg.User)
}
if cfg.Pass != "" {
params.Set("p", cfg.Pass)
}
if cfg.RetentionPolicy != "" {
params.Set("rp", cfg.RetentionPolicy)
}
if cfg.Precision != "n" && cfg.Precision != "" {
params.Set("precision", cfg.Precision)
}
if cfg.Consistency != "one" && cfg.Consistency != "" {
params.Set("consistency", cfg.Consistency)
}
My influxdb and influx-stress are in different hosts. Command is: ./influx-stress insert cpu,cluster=xxx,dc=xxx,host=xxx,cpu=xxx --batch-size 10000 --host 192.168.12.5 --points 1 --pps 10000 --series 10000 --stats-host 192.168.12.5 --kapacitor true Test is failure, and error log is: no such host.
I modified writeURLFromConfig as following: func writeURLFromConfig(cfg ClientConfig) string { params := url.Values{} params.Set("db", cfg.Database) if cfg.User != "" { params.Set("u", cfg.User) } if cfg.Pass != "" { params.Set("p", cfg.Pass) } if cfg.RetentionPolicy != "" { params.Set("rp", cfg.RetentionPolicy) } if cfg.Precision != "n" && cfg.Precision != "" { params.Set("precision", cfg.Precision) } if cfg.Consistency != "one" && cfg.Consistency != "" { params.Set("consistency", cfg.Consistency) }
} With new code, influx-stress runs ok.
https://github.com/influxdata/influx-stress/blob/5557223edf0fb7b4d3138279c348558e4f365c0b/write/client.go#L221