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

fix(cmd): switch default port from 9999 to 8086 #3514

Merged
merged 1 commit into from
May 20, 2021
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
2 changes: 1 addition & 1 deletion cmd/flux/cmd/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func init() {
rootCmd.AddCommand(executeCmd)
}

const DefaultInfluxDBHost = "http://localhost:9999"
const DefaultInfluxDBHost = "http://localhost:8086"

func injectDependencies(ctx context.Context) (context.Context, flux.Dependencies) {
deps := flux.NewDefaultDependencies()
Expand Down
2 changes: 1 addition & 1 deletion colm/influxql/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cat $FLUX
curl -s \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/vnd.flux" \
"http://localhost:9999/api/v2/query?org=$ORG" \
"http://localhost:8086/api/v2/query?org=$ORG" \
--data-binary "@$FLUX"
echo

Expand Down
2 changes: 1 addition & 1 deletion colm/tableflux/run
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ case "$1" in
curl -s \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/vnd.flux" \
"http://localhost:9999/api/v2/query?org=$ORG" \
"http://localhost:8086/api/v2/query?org=$ORG" \
--data-binary "@$QUERY" > $RESPONSE
if head -1 $RESPONSE | grep -q '^{'; then
cat $RESPONSE
Expand Down
2 changes: 1 addition & 1 deletion docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Regular expression literals support only the following escape sequences:
Examples:

/.*/
/http:\/\/localhost:9999/
/http:\/\/localhost:8086/
/^\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e(ZZ)?$/
/^日本語(ZZ)?$/ // the above two lines are equivalent
/\\xZZ/ // this becomes the literal pattern "\xZZ"
Expand Down
2 changes: 1 addition & 1 deletion lang/compiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func init() {
plan.RegisterLogicalRules(
influxdb.DefaultFromAttributes{
Org: &influxdb.NameOrID{Name: "influxdata"},
Host: func(v string) *string { return &v }("http://localhost:9999"),
Host: func(v string) *string { return &v }("http://localhost:8086"),
},
)
}
Expand Down
2 changes: 1 addition & 1 deletion plan/logical_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestPlan_LogicalPlanFromSpec(t *testing.T) {
fromSpec = &influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "influxdata"},
Bucket: influxdb.NameOrID{Name: "my-bucket"},
Host: func(v string) *string { return &v }("http://localhost:9999"),
Host: func(v string) *string { return &v }("http://localhost:8086"),
}
rangeSpec = &universe.RangeProcedureSpec{
Bounds: flux.Bounds{
Expand Down
12 changes: 6 additions & 6 deletions plan/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func init() {
plan.RegisterLogicalRules(
influxdb.DefaultFromAttributes{
Org: &influxdb.NameOrID{Name: "influxdata"},
Host: func(v string) *string { return &v }("http://localhost:9999"),
Host: func(v string) *string { return &v }("http://localhost:8086"),
},
)
}
Expand All @@ -38,7 +38,7 @@ func TestRuleRegistration(t *testing.T) {

now := time.Now().UTC()
fluxSpec, err := spec.FromScript(dependenciestest.Default().Inject(context.Background()), runtime.Default, now,
`from(host: "http://localhost:9999", bucket: "telegraf") |> range(start: -5m)`)
`from(host: "http://localhost:8086", bucket: "telegraf") |> range(start: -5m)`)
if err != nil {
t.Fatalf("could not compile very simple Flux query: %v", err)
}
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestRewriteWithContext(t *testing.T) {

now := time.Now().UTC()
fluxSpec, err := spec.FromScript(dependenciestest.Default().Inject(ctx), runtime.Default, now,
`from(host: "http://localhost:9999", bucket: "telegraf") |> range(start: -5m)`)
`from(host: "http://localhost:8086", bucket: "telegraf") |> range(start: -5m)`)
if err != nil {
t.Fatalf("could not compile very simple Flux query: %v", err)
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestRewriteWithContext_TableObjectCompiler(t *testing.T) {
prelude := runtime.Prelude()
buckets, _ := prelude.Lookup("buckets")
args := values.NewObjectWithValues(map[string]values.Value{
"host": values.NewString("http://localhost:9999"),
"host": values.NewString("http://localhost:8086"),
})
res, err := buckets.Function().Call(ctx, args)
if err != nil {
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestMultiRootMatch(t *testing.T) {

now := time.Now().UTC()
fluxSpec, err := spec.FromScript(dependenciestest.Default().Inject(context.Background()), runtime.Default, now,
`from(host: "http://localhost:9999", bucket: "telegraf") |> range(start: -5m) |> min() |> max() |> mean()`)
`from(host: "http://localhost:8086", bucket: "telegraf") |> range(start: -5m) |> min() |> max() |> mean()`)
if err != nil {
t.Fatalf("could not compile very simple Flux query: %v", err)
}
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestExpectPlannerRule(t *testing.T) {

now := time.Now().UTC()
fluxSpec, err := spec.FromScript(dependenciestest.Default().Inject(context.Background()), runtime.Default, now,
`from(host: "http://localhost:9999", bucket: "telegraf") |> range(start: -5m) |> min() |> max() |> mean()`)
`from(host: "http://localhost:8086", bucket: "telegraf") |> range(start: -5m) |> min() |> max() |> mean()`)
if err != nil {
t.Fatalf("could not compile very simple Flux query: %v", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Steps:
Prerequesites: InfluxDB 2.0 (local or Cloud instance), this repo (includes zoo-data.csv, script.py and naiveBayesClassifier.flux)
InfluxDB: https://github.com/influxdata/influxdb

1) Ensure you have InfluxDB 2.0 set up by either going to localhost:9999 (if you `make` InfluxDB from source) or going to your Cloud instance on AWS, Azure, etc. Keep the instance running throughout this demo.
1) Ensure you have InfluxDB 2.0 set up by either going to localhost:8086 (if you `make` InfluxDB from source) or going to your Cloud instance on AWS, Azure, etc. Keep the instance running throughout this demo.
2) Choose a binary dataset (fields can only take on 2 unique values) or visit https://archive.ics.uci.edu/ml/datasets.php for some wonderful datasets you can get started with.

[Animal dataset](zoo_data.csv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
from influxdb_client import InfluxDBClient, Point, WriteOptions
from influxdb_client.client.write_api import SYNCHRONOUS

client = InfluxDBClient(url="http://localhost:9999", token=token, org=org, debug=False)
client = InfluxDBClient(url="http://localhost:8086", token=token, org=org, debug=False)
write_client = client.write_api(write_options=SYNCHRONOUS)

write_client.write(bucket, record=mydata, data_frame_measurement_name='zoo-data',
Expand Down
4 changes: 2 additions & 2 deletions stdlib/influxdata/influxdb/buckets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ func TestBuckets_NewQuery(t *testing.T) {
},
{
Name: "buckets with host and token",
Raw: `buckets(host: "http://localhost:9999", token: "mytoken")`,
Raw: `buckets(host: "http://localhost:8086", token: "mytoken")`,
Want: &flux.Spec{
Operations: []*flux.Operation{
{
ID: "buckets0",
Spec: &influxdb.BucketsOpSpec{
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
},
},
Expand Down
4 changes: 2 additions & 2 deletions stdlib/influxdata/influxdb/cardinality_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ func TestCardinality_NewQuery(t *testing.T) {
},
{
Name: "cardinality with host and token",
Raw: `influxdb.cardinality(bucket:"mybucket", host: "http://localhost:9999", token: "mytoken", start: -2h)`,
Raw: `influxdb.cardinality(bucket:"mybucket", host: "http://localhost:8086", token: "mytoken", start: -2h)`,
Want: &flux.Spec{
Operations: []*flux.Operation{
{
ID: "influxdata/influxdb.cardinality0",
Spec: &influxdb.CardinalityOpSpec{
Config: influxdb.Config{
Bucket: influxdb.NameOrID{Name: "mybucket"},
Host: "http://localhost:9999",
Host: "http://localhost:8086",
Token: "mytoken",
},
Start: flux.Time{
Expand Down
4 changes: 2 additions & 2 deletions stdlib/influxdata/influxdb/from_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ func TestFrom_NewQuery(t *testing.T) {
},
{
Name: "from with host and token",
Raw: `from(bucket:"mybucket", host: "http://localhost:9999", token: "mytoken")`,
Raw: `from(bucket:"mybucket", host: "http://localhost:8086", token: "mytoken")`,
Want: &flux.Spec{
Operations: []*flux.Operation{
{
ID: "from0",
Spec: &influxdb.FromOpSpec{
Bucket: influxdb.NameOrID{Name: "mybucket"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
},
},
Expand Down
22 changes: 11 additions & 11 deletions stdlib/influxdata/influxdb/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func TestFromRemoteRule_WithHost(t *testing.T) {
fromSpec := influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "influxdata"},
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
}
rangeSpec := universe.RangeProcedureSpec{
Bounds: flux.Bounds{
Expand Down Expand Up @@ -212,7 +212,7 @@ func TestFromRemoteRule_WithoutRangeValidation(t *testing.T) {
fromSpec := influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "influxdata"},
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
}

tc := plantest.RuleTestCase{
Expand All @@ -239,7 +239,7 @@ func TestMergeRemoteRangeRule(t *testing.T) {

fromSpec := influxdb.FromProcedureSpec{
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
}
rangeSpec := universe.RangeProcedureSpec{
Bounds: flux.Bounds{
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestMergeRemoteFilterRule(t *testing.T) {

fromSpec := influxdb.FromProcedureSpec{
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
}
rangeSpec := universe.RangeProcedureSpec{
Bounds: flux.Bounds{
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestDefaultFromAttributes(t *testing.T) {
Rules: []plan.Rule{
influxdb.DefaultFromAttributes{
Org: &influxdb.NameOrID{Name: "influxdata"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
},
},
Expand All @@ -372,7 +372,7 @@ func TestDefaultFromAttributes(t *testing.T) {
plan.CreateLogicalNode("from", &influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "influxdata"},
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
}),
},
Expand All @@ -383,7 +383,7 @@ func TestDefaultFromAttributes(t *testing.T) {
Rules: []plan.Rule{
influxdb.DefaultFromAttributes{
Org: &influxdb.NameOrID{Name: "influxdata"},
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
},
},
Expand All @@ -392,7 +392,7 @@ func TestDefaultFromAttributes(t *testing.T) {
plan.CreateLogicalNode("from", &influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "alternate_org"},
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://mysupersecretserver:9999"),
Host: stringPtr("http://mysupersecretserver:8086"),
Token: stringPtr("differenttoken"),
}),
},
Expand All @@ -402,7 +402,7 @@ func TestDefaultFromAttributes(t *testing.T) {
plan.CreateLogicalNode("from", &influxdb.FromProcedureSpec{
Org: &influxdb.NameOrID{Name: "alternate_org"},
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: stringPtr("http://mysupersecretserver:9999"),
Host: stringPtr("http://mysupersecretserver:8086"),
Token: stringPtr("differenttoken"),
}),
},
Expand All @@ -413,7 +413,7 @@ func TestDefaultFromAttributes(t *testing.T) {
Rules: []plan.Rule{
influxdb.FromRemoteRule{},
influxdb.DefaultFromAttributes{
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
},
},
Before: &plantest.PlanSpec{
Expand All @@ -428,7 +428,7 @@ func TestDefaultFromAttributes(t *testing.T) {
plan.CreatePhysicalNode("fromRemote", &influxdb.FromRemoteProcedureSpec{
Config: influxdb.Config{
Bucket: influxdb.NameOrID{Name: "telegraf"},
Host: "http://localhost:9999",
Host: "http://localhost:8086",
},
}),
},
Expand Down
4 changes: 2 additions & 2 deletions stdlib/influxdata/influxdb/v1/databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ v1.databases(chicken:"what is this?")`,
{
Name: "databases with host and token",
Raw: `import "influxdata/influxdb/v1"
v1.databases(host: "http://localhost:9999", token: "mytoken")`,
v1.databases(host: "http://localhost:8086", token: "mytoken")`,
Want: &flux.Spec{
Operations: []*flux.Operation{
{
ID: "databases0",
Spec: &v1.DatabasesOpSpec{
Host: stringPtr("http://localhost:9999"),
Host: stringPtr("http://localhost:8086"),
Token: stringPtr("mytoken"),
},
},
Expand Down