Skip to content

Commit 7964f86

Browse files
committed
fix: switch port to 8086
fix(readme): update the port and setup
1 parent 50237d9 commit 7964f86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+165
-180
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
node --version && npm --version
177177
docker --version
178178
google-chrome --version && which google-chrome && chromedriver --version && which chromedriver
179-
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9999)" != "200" ]]; do sleep 5; done' || false
179+
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8086)" != "200" ]]; do sleep 5; done' || false
180180
- run:
181181
name: Selenium tests
182182
command: |

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Ideally, test cases would be in the form of `curl` commands.
1616
For example:
1717
```bash
1818
# write data
19-
curl -XPOST "http://localhost:9999/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \
19+
curl -XPOST "http://localhost:8086/api/v2/write?org=YOUR_ORG&bucket=YOUR_BUCKET&precision=s" \
2020
--header "Authorization: Token YOURAUTHTOKEN" \
2121
--data-raw "mem,host=host1 used_percent=23.43234543 1556896326"
2222

2323
# query data
2424
# Bug: expected it to return no data, but data comes back.
25-
curl http://localhost:9999/api/v2/query?org=my-org -XPOST -sS \
25+
curl http://localhost:8086/api/v2/query?org=my-org -XPOST -sS \
2626
-H 'Authorization: Token YOURAUTHTOKEN' \
2727
-H 'Accept: application/csv' \
2828
-H 'Content-type: application/vnd.flux' \

DEVELOPMENT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cd ui
4141
yarn && yarn start
4242
```
4343

44-
If there are no errors, hit [localhost:8080](http://localhost:8080) and follow the prompts to setup your username and password. *Note the port difference: `8080` vs the production `9999`*
44+
If there are no errors, hit [localhost:8080](http://localhost:8080) and follow the prompts to setup your username and password. *Note the port difference: `8080` vs the production `8086`*
4545

4646
You're set up to develop Influx locally. Any changes you make to front-end code under the `ui/` directory will be updated after the watcher process (that was initiated by running `yarn start`) sees them and rebuilds the bundle. Any changes to go code will need to be re-compiled by re-running the `go run` command above.
4747

@@ -65,7 +65,7 @@ Tab 1:
6565
go run ./cmd/influxd --assets-path=ui/build
6666
```
6767

68-
This starts the influxdb application server. It handles API requests and can be reached via `localhost:9999`. Any changes to go code will need to be re-compiled by re-running the `go run` command above.
68+
This starts the influxdb application server. It handles API requests and can be reached via `localhost:8086`. Any changes to go code will need to be re-compiled by re-running the `go run` command above.
6969

7070
Tab 2:
7171

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ FROM debian:stretch-slim AS influx
4545
COPY --from=dbuild-all /code/bin/linux/influxd /usr/bin/influxd
4646
COPY --from=dbuild-all /code/bin/linux/influx /usr/bin/influx
4747

48-
EXPOSE 9999
48+
EXPOSE 8086
4949

5050
ENTRYPOINT [ "/usr/bin/influxd" ]
5151

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ dshell-image:
227227
@docker image build --build-arg "USERID=$(shell id -u)" -t influxdb:dshell --target dshell .
228228

229229
dshell: dshell-image
230-
@docker container run --rm -p 9999:9999 -p 8080:8080 -u $(shell id -u) -it -v $(shell pwd):/code -w /code influxdb:dshell
230+
@docker container run --rm -p 8086:8086 -p 8080:8080 -u $(shell id -u) -it -v $(shell pwd):/code -w /code influxdb:dshell
231231

232232
# .PHONY targets represent actions that do not create an actual file.
233233
.PHONY: all $(SUBDIRS) run fmt checkfmt tidy checktidy checkgenerate test test-go test-js test-go-race bench clean node_modules vet nightly chronogiraffe dist ping protoc e2e run-e2e influxd libflux flags dshell dclean docker-image-flux docker-image-influx goreleaser

README.md

+32-47
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Planned activities include:
4242

4343
## Installing from Source
4444

45-
We have nightly and weekly versioned Docker images, Debian packages, RPM packages, and tarballs of InfluxDB available at the [InfluxData downloads page](https://portal.influxdata.com/downloads/).
45+
We have nightly and weekly versioned Docker images, Debian packages, RPM packages, and tarballs of InfluxDB available at the [InfluxData downloads page](https://portal.influxdata.com/downloads/). We also provide the `influx` command line interface (CLI) client as a separate binary available at the same location.
4646

4747
## Building From Source
4848

@@ -133,17 +133,12 @@ Everything in InfluxDB is organized under a concept of an organization. The API
133133
Buckets represent where you store time series data.
134134
They're synonymous with what was previously in InfluxDB 1.x a database and retention policy.
135135

136-
The simplest way to get set up is to point your browser to [http://localhost:9999](http://localhost:9999) and go through the prompts.
136+
The simplest way to get set up is to point your browser to [http://localhost:8086](http://localhost:8086) and go through the prompts.
137137

138-
**Note**: Port 9999 will be used during the beta phases of development of InfluxDB v2.0.
139-
This should allow a v2.0-beta instance to be run alongside a v1.x instance without interfering on port 8086.
140-
InfluxDB will thereafter continue to use 8086.
138+
You can also get set up from the CLI using the command `influx setup`:
141139

142-
You can also get set up from the CLI using the subcommands `influx user`, `influx auth`, `influx org` and `influx bucket`,
143-
or do it all in one breath with `influx setup`:
144140

145-
146-
```
141+
```bash
147142
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx setup
148143
Welcome to InfluxDB 2.0!
149144
Please type your primary username: marty
@@ -169,68 +164,58 @@ Confirm? (y/n): y
169164

170165
UserID Username Organization Bucket
171166
033a3f2c5ccaa000 marty InfluxData Telegraf
172-
Your token has been stored in /Users/marty/.influxdbv2/credentials
167+
Your token has been stored in /Users/marty/.influxdbv2/configs
173168
```
174169

175-
You may get into a development loop where `influx setup` becomes tedious.
170+
You can run this command non-interactively using the `-f, --force` flag if you are automating the setup.
176171
Some added flags can help:
177-
```
178-
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx setup --username marty --password F1uxKapacit0r85 --org InfluxData --bucket telegraf --retention 168 --token where-were-going-we-dont-need-roads --force
179-
```
180-
181-
`~/.influxdbv2/credentials` contains your auth token.
182-
Most `influx` commands read the token from this file path by default.
183-
184-
You may need the organization ID and bucket ID later:
185-
186-
```
187-
$ influx org find
188-
ID Name
189-
033a3f2c708aa000 InfluxData
172+
```bash
173+
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx setup \
174+
--username marty \
175+
--password F1uxKapacit0r85 \
176+
--org InfluxData \
177+
--bucket telegraf \
178+
--retention 168 \
179+
--token where-were-going-we-dont-need-roads \
180+
--force
190181
```
191182

192-
```
193-
$ influx bucket find
194-
ID Name Retention Organization OrganizationID
195-
033a3f2c710aa000 telegraf 72h0m0s InfluxData 033a3f2c708aa000
183+
Once setup is complete, a configuration profile is created to allow you to interact with your local InfluxDB without passing in credentials each time. You can list and manage those profiles using the `influx config` command.
184+
```bash
185+
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx config
186+
Active Name URL Org
187+
* default http://localhost:8086 InfluxData
196188
```
197189

190+
## Writing Data
198191
Write to measurement `m`, with tag `v=2`, in bucket `telegraf`, which belongs to organization `InfluxData`:
199192

200-
```
201-
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx write --org InfluxData --bucket telegraf --precision s "m v=2 $(date +%s)"
193+
```bash
194+
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx write --bucket telegraf --precision s "m v=2 $(date +%s)"
202195
```
203196

197+
Since you have a default profile set up, you can omit the Organization and Token from the command.
198+
204199
Write the same point using `curl`:
205200

206-
```
207-
curl --header "Authorization: Token $(cat ~/.influxdbv2/credentials)" --data-raw "m v=2 $(date +%s)" "http://localhost:9999/api/v2/write?org=InfluxData&bucket=telegraf&precision=s"
201+
```bash
202+
curl --header "Authorization: Token $(bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx auth list --json | jq -r '.[0].token')" \
203+
--data-raw "m v=2 $(date +%s)" \
204+
"http://localhost:8086/api/v2/write?org=InfluxData&bucket=telegraf&precision=s"
208205
```
209206

210207
Read that back with a simple Flux query:
211208

212-
```
213-
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx query -o InfluxData 'from(bucket:"telegraf") |> range(start:-1h)'
209+
```bash
210+
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx query 'from(bucket:"telegraf") |> range(start:-1h)'
214211
Result: _result
215212
Table: keys: [_start, _stop, _field, _measurement]
216213
_start:time _stop:time _field:string _measurement:string _time:time _value:float
217214
------------------------------ ------------------------------ ---------------------- ---------------------- ------------------------------ ----------------------------
218215
2019-12-30T22:19:39.043918000Z 2019-12-30T23:19:39.043918000Z v m 2019-12-30T23:17:02.000000000Z 2
219216
```
220217

221-
Use the fancy REPL:
222-
223-
```
224-
$ bin/$(uname -s | tr '[:upper:]' '[:lower:]')/influx repl -o InfluxData
225-
> from(bucket:"telegraf") |> range(start:-1h)
226-
Result: _result
227-
Table: keys: [_start, _stop, _field, _measurement]
228-
_start:time _stop:time _field:string _measurement:string _time:time _value:float
229-
------------------------------ ------------------------------ ---------------------- ---------------------- ------------------------------ ----------------------------
230-
2019-12-30T22:22:44.776351000Z 2019-12-30T23:22:44.776351000Z v m 2019-12-30T23:17:02.000000000Z 2
231-
>
232-
```
233-
218+
Use the `-r, --raw` option to return the raw flux response from the query. This is useful for moving data from one instance to another as the `influx write` command can accept the Flux response using the `--format csv` option.
234219

235220
## Introducing Flux
236221

chronograf/bolt/sources.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var DefaultSource = &chronograf.Source{
2121
ID: math.MaxInt32, // Use large number to avoid possible collisions in older chronograf.
2222
Name: "autogen",
2323
Type: "influx",
24-
URL: "http://localhost:9999",
24+
URL: "http://localhost:8086",
2525
Default: false,
2626
}
2727

cmd/influx/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Config struct {
2626
// DefaultConfig is default config without token
2727
var DefaultConfig = Config{
2828
Name: "default",
29-
Host: "http://localhost:9999",
29+
Host: "http://localhost:8086",
3030
Active: true,
3131
}
3232

cmd/influx/config/config_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ func TestWriteConfigs(t *testing.T) {
3636
"default": Config{
3737
Token: "token1",
3838
Org: "org1",
39-
Host: "http://localhost:9999",
39+
Host: "http://localhost:8086",
4040
Active: true,
4141
},
4242
},
4343
result: `[default]
44-
url = "http://localhost:9999"
44+
url = "http://localhost:8086"
4545
token = "token1"
4646
org = "org1"
4747
active = true` + commentedStr,

cmd/influx/config_test.go

+18-18
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestCmdConfig(t *testing.T) {
3030
flags: []string{
3131
"--config-name", "default",
3232
"--org", "org1",
33-
"--host-url", "http://localhost:9999",
33+
"--host-url", "http://localhost:8086",
3434
"--token", "tok1",
3535
"--active",
3636
},
@@ -40,15 +40,15 @@ func TestCmdConfig(t *testing.T) {
4040
Org: "org1",
4141
Active: true,
4242
Token: "tok1",
43-
Host: "http://localhost:9999",
43+
Host: "http://localhost:8086",
4444
},
4545
},
4646
{
4747
name: "short",
4848
flags: []string{
4949
"-n", "default",
5050
"-o", "org1",
51-
"-u", "http://localhost:9999",
51+
"-u", "http://localhost:8086",
5252
"-t", "tok1",
5353
"-a",
5454
},
@@ -58,15 +58,15 @@ func TestCmdConfig(t *testing.T) {
5858
Org: "org1",
5959
Active: true,
6060
Token: "tok1",
61-
Host: "http://localhost:9999",
61+
Host: "http://localhost:8086",
6262
},
6363
},
6464
{
6565
name: "short new with existing",
6666
flags: []string{
6767
"-n", "default",
6868
"-o", "org1",
69-
"-u", "http://localhost:9999",
69+
"-u", "http://localhost:8086",
7070
"-t", "tok1",
7171
"-a",
7272
},
@@ -83,7 +83,7 @@ func TestCmdConfig(t *testing.T) {
8383
Org: "org1",
8484
Active: true,
8585
Token: "tok1",
86-
Host: "http://localhost:9999",
86+
Host: "http://localhost:8086",
8787
},
8888
},
8989
}
@@ -138,7 +138,7 @@ func TestCmdConfig(t *testing.T) {
138138
"--configs-path=" + file,
139139
"-n", "default",
140140
"-o", "org1",
141-
"-u", "http://localhost:9999",
141+
"-u", "http://localhost:8086",
142142
"-t", "tok1",
143143
"-a",
144144
}
@@ -152,7 +152,7 @@ func TestCmdConfig(t *testing.T) {
152152
require.True(t, ok)
153153
assert.Equal(t, "default", cfg.Name)
154154
assert.Equal(t, "org1", cfg.Org)
155-
assert.Equal(t, "http://localhost:9999", cfg.Host)
155+
assert.Equal(t, "http://localhost:8086", cfg.Host)
156156
assert.Equal(t, "tok1", cfg.Token)
157157
assert.True(t, cfg.Active)
158158
})
@@ -199,15 +199,15 @@ func TestCmdConfig(t *testing.T) {
199199
Org: "org1",
200200
Active: false,
201201
Token: "tok1",
202-
Host: "http://localhost:9999",
202+
Host: "http://localhost:8086",
203203
},
204204
},
205205
expected: config.Config{
206206
Name: "default",
207207
Org: "org1",
208208
Active: true,
209209
Token: "tok1",
210-
Host: "http://localhost:9999",
210+
Host: "http://localhost:8086",
211211
},
212212
},
213213
{
@@ -227,15 +227,15 @@ func TestCmdConfig(t *testing.T) {
227227
Active: false,
228228
PreviousActive: true,
229229
Token: "tok1",
230-
Host: "http://localhost:9999",
230+
Host: "http://localhost:8086",
231231
},
232232
},
233233
expected: config.Config{
234234
Name: "default",
235235
Org: "org1",
236236
Active: true,
237237
Token: "tok1",
238-
Host: "http://localhost:9999",
238+
Host: "http://localhost:8086",
239239
},
240240
},
241241
}
@@ -299,7 +299,7 @@ func TestCmdConfig(t *testing.T) {
299299
flags: []string{
300300
"--config-name", "default",
301301
"--org", "org1",
302-
"--host-url", "http://localhost:9999",
302+
"--host-url", "http://localhost:8086",
303303
"--token", "tok1",
304304
"--active",
305305
},
@@ -308,7 +308,7 @@ func TestCmdConfig(t *testing.T) {
308308
Org: "org1",
309309
Active: true,
310310
Token: "tok1",
311-
Host: "http://localhost:9999",
311+
Host: "http://localhost:8086",
312312
},
313313
},
314314
{
@@ -362,7 +362,7 @@ func TestCmdConfig(t *testing.T) {
362362
flags: []string{
363363
"-n", "default",
364364
"-o", "org1",
365-
"-u", "http://localhost:9999",
365+
"-u", "http://localhost:8086",
366366
"-t", "tok1",
367367
"-a",
368368
},
@@ -371,7 +371,7 @@ func TestCmdConfig(t *testing.T) {
371371
Org: "org1",
372372
Active: true,
373373
Token: "tok1",
374-
Host: "http://localhost:9999",
374+
Host: "http://localhost:8086",
375375
},
376376
},
377377
}
@@ -546,7 +546,7 @@ func TestCmdConfig(t *testing.T) {
546546
Org: "org1",
547547
Active: false,
548548
Token: "tok1",
549-
Host: "http://localhost:9999",
549+
Host: "http://localhost:8086",
550550
},
551551
},
552552
},
@@ -594,7 +594,7 @@ func testConfigInvalidURLs(t *testing.T, cmdName string, cmdFn func(*globalFlags
594594
flags: []string{
595595
"--config-name", "default",
596596
"--org", "org1",
597-
"--host-url", "localhost:9999",
597+
"--host-url", "localhost:8086",
598598
"--token", "tok1",
599599
},
600600
},

cmd/influxd/launcher/launcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func launcherOpts(l *Launcher) []cli.Opt {
196196
{
197197
DestP: &l.httpBindAddress,
198198
Flag: "http-bind-address",
199-
Default: ":9999",
199+
Default: ":8086",
200200
Desc: "bind address for the REST HTTP API",
201201
},
202202
{

0 commit comments

Comments
 (0)