Skip to content

Commit 2340bd2

Browse files
committed
chore: default port changed to 8086
1 parent a057b1c commit 2340bd2

27 files changed

+50
-47
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
PIPENV_VENV_IN_PROJECT: true
6060
ENABLED_CISO_8601: << parameters.enabled-ciso-8601 >>
6161
- image: quay.io/influxdb/<< parameters.influxdb-image >>
62+
environment:
63+
INFLUXD_HTTP_BIND_ADDRESS: :8086
6264
steps:
6365
- prepare
6466
- client-test:

README.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Please follow the `Installation`_ and then run the following:
128128
129129
bucket = "my-bucket"
130130
131-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
131+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
132132
133133
write_api = client.write_api(write_options=SYNCHRONOUS)
134134
query_api = client.query_api()
@@ -178,7 +178,7 @@ The following options are supported:
178178
.. code-block::
179179
180180
[influx2]
181-
url=http://localhost:9999
181+
url=http://localhost:8086
182182
org=my-org
183183
token=my-token
184184
timeout=6000
@@ -270,7 +270,7 @@ The batching is configurable by ``write_options``\ :
270270
from influxdb_client import InfluxDBClient, Point, WriteOptions
271271
from influxdb_client.client.write_api import SYNCHRONOUS
272272
273-
_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
273+
_client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
274274
_write_client = _client.write_api(write_options=WriteOptions(batch_size=500,
275275
flush_interval=10_000,
276276
jitter_interval=2_000,
@@ -380,7 +380,7 @@ In a ini configuration file you are able to specify default tags by ``tags`` seg
380380
.. code-block::
381381
382382
[influx2]
383-
url=http://localhost:9999
383+
url=http://localhost:8086
384384
org=my-org
385385
token=my-token
386386
timeout=6000
@@ -415,7 +415,7 @@ Data are writes in an asynchronous HTTP request.
415415
from influxdb_client import InfluxDBClient, Point
416416
from influxdb_client.client.write_api import ASYNCHRONOUS
417417
418-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
418+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
419419
write_api = client.write_api(write_options=ASYNCHRONOUS)
420420
421421
_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
@@ -436,7 +436,7 @@ Data are writes in a synchronous HTTP request.
436436
from influxdb_client import InfluxDBClient, Point
437437
from influxdb_client .client.write_api import SYNCHRONOUS
438438
439-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
439+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
440440
write_api = client.write_api(write_options=SYNCHRONOUS)
441441
442442
_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
@@ -463,7 +463,7 @@ The API also support streaming ``FluxRecord`` via `query_stream <https://github.
463463
from influxdb_client import InfluxDBClient, Point, Dialect
464464
from influxdb_client.client.write_api import SYNCHRONOUS
465465
466-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
466+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
467467
468468
write_api = client.write_api(write_options=SYNCHRONOUS)
469469
query_api = client.query_api()
@@ -542,7 +542,7 @@ The ``client`` is able to retrieve data in `Pandas DataFrame <https://pandas.pyd
542542
from influxdb_client import InfluxDBClient, Point, Dialect
543543
from influxdb_client.client.write_api import SYNCHRONOUS
544544
545-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
545+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
546546
547547
write_api = client.write_api(write_options=SYNCHRONOUS)
548548
query_api = client.query_api()
@@ -654,7 +654,7 @@ If you would like to import gigabytes of data then use our multiprocessing examp
654654
.from_iterable(DictReader(open('vix-daily.csv', 'r'))) \
655655
.pipe(ops.map(lambda row: parse_row(row)))
656656
657-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)
657+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=True)
658658
659659
"""
660660
Create client that writes data in batches with 50_000 items.
@@ -763,7 +763,7 @@ Efficiency write data from IOT sensor
763763
ops.distinct_until_changed(),
764764
ops.map(lambda temperature: line_protocol(temperature)))
765765
766-
_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)
766+
_db_client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=True)
767767
768768
"""
769769
Create client that writes data into InfluxDB
@@ -890,7 +890,7 @@ Gzip support
890890
891891
from influxdb_client import InfluxDBClient
892892
893-
_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", enable_gzip=True)
893+
_db_client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", enable_gzip=True)
894894
895895
.. marker-gzip-end
896896
@@ -926,7 +926,7 @@ For more info about how configure HTTP retry see details in `urllib3 documentati
926926
from influxdb_client import InfluxDBClient
927927
928928
retries = Retry(connect=5, read=2, redirect=5)
929-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", retries=retries)
929+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", retries=retries)
930930
931931
Nanosecond precision
932932
^^^^^^^^^^^^^^^^^^^^
@@ -956,7 +956,7 @@ that is replacement for python ``datetime.datetime`` object and also you should
956956
"""
957957
Prepare client.
958958
"""
959-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
959+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
960960
961961
write_api = client.write_api(write_options=SYNCHRONOUS)
962962
query_api = client.query_api()

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Both request header and body will be logged to standard output.
3636

3737
.. code-block:: python
3838
39-
_client = InfluxDBClient(url="http://localhost:9999", token="my-token", debug=True, org="my-org")
39+
_client = InfluxDBClient(url="http://localhost:8086", token="my-token", debug=True, org="my-org")

examples/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
bucket = "my-bucket"
88

9-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
9+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
1010

1111
write_api = client.write_api(write_options=SYNCHRONOUS)
1212
query_api = client.query_api()

examples/import_data_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def parse_row(row: OrderedDict):
6060
.from_iterable(DictReader(open('vix-daily.csv', 'r'))) \
6161
.pipe(ops.map(lambda row: parse_row(row)))
6262

63-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)
63+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=True)
6464

6565
"""
6666
Create client that writes data in batches with 50_000 items.

examples/import_data_set_multiprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class InfluxDBWriter(multiprocessing.Process):
4141
def __init__(self, queue):
4242
multiprocessing.Process.__init__(self)
4343
self.queue = queue
44-
self.client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
44+
self.client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=False)
4545
self.write_api = self.client.write_api(
4646
write_options=WriteOptions(write_type=WriteType.batching, batch_size=50_000, flush_interval=10_000))
4747

@@ -199,7 +199,7 @@ def init_counter(counter, progress, queue):
199199
'|> rename(columns: {_time: "pickup_datetime"})' \
200200
'|> drop(columns: ["_start", "_stop"])|> limit(n:10, offset: 0)'
201201

202-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
202+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=False)
203203
result = client.query_api().query(query=query)
204204

205205
"""

examples/ingest_dataframe_default_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
df = pd.read_csv("vix-daily.csv")
1414
print(df.head())
1515

16-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
16+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
1717

1818
"""
1919
Ingest DataFrame with default tags

examples/iot_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def line_protocol(temperature):
6161
ops.distinct_until_changed(),
6262
ops.map(lambda temperature: line_protocol(temperature)))
6363

64-
_db_client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=True)
64+
_db_client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=True)
6565

6666
"""
6767
Create client that writes data into InfluxDB

examples/nanosecond_precision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313
Prepare client.
1414
"""
15-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
15+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
1616

1717
write_api = client.write_api(write_options=SYNCHRONOUS)
1818
query_api = client.query_api()

examples/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from influxdb_client import InfluxDBClient, Point, Dialect
22
from influxdb_client.client.write_api import SYNCHRONOUS
33

4-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
4+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
55

66
write_api = client.write_api(write_options=SYNCHRONOUS)
77
query_api = client.query_api()

examples/query_from_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from influxdb_client import InfluxDBClient, Point
1111
from influxdb_client.client.write_api import SYNCHRONOUS
1212

13-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
13+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
1414

1515
write_api = client.write_api(write_options=SYNCHRONOUS)
1616
query_api = client.query_api()

influxdb_client/client/influxdb_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, url, token, debug=None, timeout=10000, enable_gzip=False, org
2525
"""
2626
Initialize defaults.
2727
28-
:param url: InfluxDB server API url (ex. http://localhost:9999).
28+
:param url: InfluxDB server API url (ex. http://localhost:8086).
2929
:param token: auth token
3030
:param debug: enable verbose logging of http requests
3131
:param timeout: default http client timeout
@@ -118,7 +118,7 @@ def from_env_properties(cls, debug=None, enable_gzip=False):
118118
- INFLUXDB_V2_TIMEOUT
119119
- INFLUXDB_V2_VERIFY_SSL
120120
"""
121-
url = os.getenv('INFLUXDB_V2_URL', "http://localhost:9999")
121+
url = os.getenv('INFLUXDB_V2_URL', "http://localhost:8086")
122122
token = os.getenv('INFLUXDB_V2_TOKEN', "my-token")
123123
timeout = os.getenv('INFLUXDB_V2_TIMEOUT', "10000")
124124
org = os.getenv('INFLUXDB_V2_ORG', "my-org")

notebooks/realtime-stream.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"metadata": {},
7272
"outputs": [],
7373
"source": [
74-
"client = InfluxDBClient(url='http://localhost:9999', token='my-token', org='my-org')"
74+
"client = InfluxDBClient(url='http://localhost:8086', token='my-token', org='my-org')"
7575
]
7676
},
7777
{

notebooks/stock-predictions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"#prices_dataset = pd.read_csv('./prices-split-adjusted.csv', header=0)\n",
104104
"\n",
105105
"# read prices from InfluxDB 2.0 \n",
106-
"client = InfluxDBClient(url=\"http://localhost:9999\", token=\"my-token\", org=\"my-org\", debug=False)\n",
106+
"client = InfluxDBClient(url=\"http://localhost:8086\", token=\"my-token\", org=\"my-org\", debug=False)\n",
107107
"query='''\n",
108108
"from(bucket:\"my-bucket\")\n",
109109
" |> range(start: 0, stop: now())\n",

notebooks/stock_predictions_import_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def main():
5757
.from_iterable(DictReader(response.iter_lines(decode_unicode=True))) \
5858
.pipe(ops.map(lambda row: parse_row(row)))
5959

60-
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
60+
client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=False)
6161
write_api = client.write_api(write_options=WriteOptions(batch_size=50_000, flush_interval=10_000))
6262

6363
write_api.write(bucket="my-bucket", record=data)

notebooks/telegraf.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
##
9494
## Multiple URLs can be specified for a single cluster, only ONE of the
9595
## urls will be written to each interval.
96-
urls = ["http://localhost:9999/"]
96+
urls = ["http://localhost:8086/"]
9797

9898
## Token for authentication.
9999
token = "my-token"

scripts/influxdb-onboarding.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
set -e
2525

2626
echo "Wait to start InfluxDB 2.0"
27-
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:9999/metrics
27+
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/metrics
2828

2929
echo
3030
echo "Post onBoarding request, to setup initial user (my-user@my-password), org (my-org) and bucketSetup (my-bucket)"
3131
echo
32-
curl -i -X POST http://localhost:9999/api/v2/setup -H 'accept: application/json' \
32+
curl -i -X POST http://localhost:8086/api/v2/setup -H 'accept: application/json' \
3333
-d '{
3434
"username": "my-user",
3535
"password": "my-password",

scripts/influxdb-restart.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ echo
4949
docker pull ${INFLUXDB_V2_IMAGE} || true
5050
docker run \
5151
--detach \
52+
--env INFLUXD_HTTP_BIND_ADDRESS=:8086 \
5253
--name influxdb_v2 \
5354
--network influx_network \
54-
--publish 9999:9999 \
55+
--publish 8086:8086 \
5556
${INFLUXDB_V2_IMAGE}
5657

5758
echo "Wait to start InfluxDB 2.0"
58-
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:9999/metrics
59+
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/metrics
5960

6061
#
6162
# Post onBoarding request to InfluxDB 2

tests/base_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BaseTest(unittest.TestCase):
1919
def setUp(self) -> None:
2020
self.conf = influxdb_client.configuration.Configuration()
2121

22-
self.host = os.getenv('INFLUXDB_V2_URL', "http://localhost:9999")
22+
self.host = os.getenv('INFLUXDB_V2_URL', "http://localhost:8086")
2323
self.debug = False
2424
self.auth_token = os.getenv('INFLUXDB_V2_TOKEN', "my-token")
2525
self.org = os.getenv('INFLUXDB_V2_ORG', "my-org")

tests/config-disabled-ssl.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[influx2]
2-
url=http://localhost:9999
2+
url=http://localhost:8086
33
org=my-org
44
token=my-token
55
timeout=6000

tests/config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[influx2]
2-
url=http://localhost:9999
2+
url=http://localhost:8086
33
org=my-org
44
token=my-token
55
timeout=6000

tests/test_InfluxDBClient.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def tearDown(self) -> None:
1818
self.httpd_thread.join()
1919

2020
def test_TrailingSlashInUrl(self):
21-
self.client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org")
22-
self.assertEqual('http://localhost:9999', self.client.api_client.configuration.host)
21+
self.client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org")
22+
self.assertEqual('http://localhost:8086', self.client.api_client.configuration.host)
2323

24-
self.client = InfluxDBClient(url="http://localhost:9999/", token="my-token", org="my-org")
25-
self.assertEqual('http://localhost:9999', self.client.api_client.configuration.host)
24+
self.client = InfluxDBClient(url="http://localhost:8086/", token="my-token", org="my-org")
25+
self.assertEqual('http://localhost:8086', self.client.api_client.configuration.host)
2626

2727
def test_ConnectToSelfSignedServer(self):
2828
import http.server

tests/test_QueryApiDataFrame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def _create_point(index) -> Point:
287287
self.assertGreater(len(result), 1)
288288

289289
def test_query_without_credentials(self):
290-
_client = InfluxDBClient(url="http://localhost:9999", token="my-token-wrong-credentials", org="my-org")
290+
_client = InfluxDBClient(url="http://localhost:8086", token="my-token-wrong-credentials", org="my-org")
291291

292292
with self.assertRaises(ApiException) as ae:
293293
query = 'from(bucket: "my-bucket")' \

tests/test_WriteApi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def test_write_list_of_list_point_with_default_tags(self):
374374
self.assertEqual("LA", record[self.data_center_key])
375375

376376
def test_check_write_permission_by_empty_data(self):
377-
client = InfluxDBClient(url="http://localhost:9999", token="my-token-wrong", org="my-org")
377+
client = InfluxDBClient(url="http://localhost:8086", token="my-token-wrong", org="my-org")
378378
write_api = client.write_api(write_options=SYNCHRONOUS)
379379

380380
with self.assertRaises(ApiException) as cm:
@@ -739,14 +739,14 @@ def test_connection_option_from_conf_file(self):
739739
self.client.close()
740740
self.client = InfluxDBClient.from_config_file(self._path_to_config(), self.debug)
741741

742-
self.assertEqual("http://localhost:9999", self.client.url)
742+
self.assertEqual("http://localhost:8086", self.client.url)
743743
self._check_connection_settings()
744744

745745
def test_connection_option_from_env(self):
746746
self.client.close()
747747
self.client = InfluxDBClient.from_env_properties(self.debug)
748748

749-
self.assertEqual("http://localhost:9999", self.client.url)
749+
self.assertEqual("http://localhost:8086", self.client.url)
750750
self._check_connection_settings()
751751

752752
def _check_connection_settings(self):

tests/test_WriteApiDataFrame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DataFrameWriteTest(BaseTest):
1414

1515
def setUp(self) -> None:
1616
super().setUp()
17-
self.influxDb_client = InfluxDBClient(url="http://localhost:9999", token="my-token", debug=False)
17+
self.influxDb_client = InfluxDBClient(url="http://localhost:8086", token="my-token", debug=False)
1818

1919
self.write_options = WriteOptions(batch_size=10_000, flush_interval=5_000, retry_interval=3_000)
2020
self._write_client = WriteApi(influxdb_client=self.influxDb_client, write_options=self.write_options)

tests/test_WriteApiPickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class InfluxDBWriterToPickle:
1212

1313
def __init__(self):
14-
self.client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
14+
self.client = InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org", debug=False)
1515
self.write_api = self.client.write_api(
1616
write_options=WriteOptions(write_type=WriteType.batching, batch_size=50_000, flush_interval=10_000))
1717

tests/test_point.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_DateTimeUtc(self):
233233
self.assertEqual("h2o,location=europe level=2i 1444897215000000000", point.to_line_protocol())
234234

235235
def test_InstantFormatting(self):
236-
instant = "1970-01-01T00:00:45.999999999Z"
236+
instant = "1970-01-01T00:00:45.808680869Z"
237237

238238
point = Point.measurement("h2o") \
239239
.tag("location", "europe") \

0 commit comments

Comments
 (0)