docs: Tweak local run guide (#5787)

Update the instructions on how to run IOx locally

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/24376/head
Andrew Lamb 2022-10-07 16:34:00 -04:00 committed by GitHub
parent 8013781ac2
commit d8a318eb57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 6 deletions

View File

@ -15,17 +15,25 @@ developers.
Build IOx for release with pprof:
```shell
cd influxdb_iox
cargo build --release --features=pprof
```
## Step 2: Start redpanda and postgres
You can also install the `influxdb_iox` command locally via
Now, start up redpanda and postgres locally in docker containers:
```shell
cd influxdb_iox
cargo install --path influxdb_iox
```
## Step 2: Start kafka and postgres
Now, start up kafka and postgres locally in docker containers:
```shell
# get rskafka from https://github.com/influxdata/rskafka
cd rskafka
# Run redpanda on localhost:9010
docker-compose -f docker-compose-redpanda.yml up &
# Run kafka on localhost:9010
docker-compose -f docker-compose-kafka.yml up &
# now run postgres
docker run -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres &
```
@ -136,8 +144,8 @@ INFLUXDB_IOX_GRPC_BIND_ADDR=localhost:8084 \
INFLUXDB_IOX_WRITE_BUFFER_TYPE=kafka \
INFLUXDB_IOX_WRITE_BUFFER_ADDR=localhost:9010 \
xINFLUXDB_IOX_WRITE_BUFFER_AUTO_CREATE_TOPICS=10 \
INFLUXDB_IOX_WRITE_BUFFER_PARTITION_RANGE_START=0 \
INFLUXDB_IOX_WRITE_BUFFER_PARTITION_RANGE_END=0 \
INFLUXDB_IOX_SHARD_INDEX_RANGE_START=0 \
INFLUXDB_IOX_SHARD_INDEX_RANGE_END=0 \
INFLUXDB_IOX_PAUSE_INGEST_SIZE_BYTES=5000000000 \
INFLUXDB_IOX_PERSIST_MEMORY_THRESHOLD_BYTES=4000000000 \
INFLUXDB_IOX_CATALOG_DSN=postgres://postgres@localhost:5432/postgres \
@ -151,6 +159,11 @@ LOG_FILTER=info \
# Step 5: Ingest data
You can load data using the influxdb_iox client:
```shell
influxdb_iox --host=http://localhost:8080 -v write test_db test_fixtures/lineproto/*.lp
```
Now you can post data to `http://localhost:8080` with your favorite load generating tool
My favorite is https://github.com/alamb/low_card
@ -171,3 +184,17 @@ posting fairly large requests (necessitating the
# Step 6: Profile
See [`profiling.md`](./profiling.md).
# Step 7: Clean up local state
If you find yourself needing to clean up postgres / kafka state use these commands:
```shell
docker ps -a -q | xargs docker stop
docker rm rskafka_proxy_1
docker rm rskafka_kafka-0_1
docker rm rskafka_kafka-1_1
docker rm rskafka_kafka-2_1
docker rm rskafka_zookeeper_1
docker volume rm rskafka_kafka_0_data rskafka_kafka_1_data rskafka_kafka_2_data rskafka_zookeeper_data
```