Docker (docker compose)
$ brew install docker
$ brew install docker-compose
$ brew install httpie
$ brew install direv
$ brew install git
$ brew install jq
$ curl -s "https://get.sdkman.io" | bash
# Follow the instructions on-screen to complete installation.
# Next, open a new terminal or enter:
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
$ sudo apt install git jq httpie direvent unzip zip
$ curl -s "https://get.sdkman.io" | bash
# Follow the instructions on-screen to complete installation.
# Next, open a new terminal or enter:
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
$ sdk version
Commands to install:
$ sdk install mvnd
$ sdk install java 11.0.16-tem
install plugitns for IDE
direnv
sonarlint
Add
# Local
127.0.0.1 zookeeper
127.0.0.1 schema-registry
127.0.0.1 kafka
127.0.0.1 rest-proxy
127.0.0.1 control-center
to /etc/hosts
on local
host
.envrc
:
## Examples
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/work/spanner/utility-operand-danyl.json”
export SPANNER_CONNECTOR_PROJECT_DIR="$HOME/work/spanner/debezium.connector.spanner”
export JAVA_DEBUG_PORT="*:5005”
export KAFKA_DEBUG=y # "y" - debug enabled, "n" - not enabled
export DEBUG_SUSPEND_FLAG=n # "y" - wait until debugger connected, "n" - do not wait
.sdkmanrc
:
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=11.0.16-tem
$ docker-compose up -d
$ docker-compose ps
# build binaries
$ mvn -B clean install
# integration tests
$ mvn -pl debezium-connector-spanner-integration-tests verify -P integration-tests
$ mvn test --batch-mode -Dmaven.test.failure.ignore=true
#>
http POST localhost:8083/connectors < ./spanner-source.json
http GET localhost:8083/connectors/my_spanner_connector
http DELETE localhost:8083/connectors/my_spanner_connector
Wait for 30-60 sec. Check connector is working:
#>
http kafka-connect:8083/connectors/my_spanner_connector/status
{
"name": "my_spanner_connector",
"config": {
"connector.class": "io.debezium.connector.spanner.SpannerConnector",
"heartbeat.interval.ms": "300000",
"gcp.spanner.change.stream": "TestStream",
"gcp.spanner.project.id": "boxwood-weaver-353315",
"gcp.spanner.instance.id": "kafka-connector",
"gcp.spanner.database.id": "stage-1",
"gcp.spanner.low-watermark.enabled": true,
"gcp.spanner.low-watermark.update-period.ms": 1000
}
}