liveBook · Manning

Port forwarding

As explained in ScyllaDB in Action

Port forwarding maps a port on one network endpoint to a port on another endpoint so that connections can reach a service.

Port forwarding maps a port on the local machine to a port inside a Docker container. It lets a local application reach a service such as ScyllaDB’s CQL endpoint. section 2.1.1 section 10.2.1

Containers on a shared Docker network can communicate through hostnames, but local access requires forwarded ports. A multi-node setup needs different host ports for each node, which conflicts with a Scylla driver that assumes one port; a single-node cluster is simpler for local development. section 10.2.1

Forwarding ScyllaDB ports

The mapping -p 9241:9042 forwards local port 9241 to container port 9042. A local application can therefore use port 9241 while ScyllaDB continues listening on its container CQL port. section 2.1.1

$ docker run --name scylla-1 --hostname scylla-1 \
 --network scylla-network --detach -p 9241:9042 \
 -p 19241:9042 scylladb/scylla:5.4 --reactor-backend=epoll

Shows a runnable Docker command forwarding two local ports to ScyllaDB container ports. section 2.1.1

How ScyllaDB in Action covers it

How deep it goes
Defines host-to-container mapping and applies it to Docker, but defers complicated multi-node workarounds.
Examples
Uses ScyllaDB 5.4 containers with mappings such as 9241:9042 and 9042:9042.
What it assumes
Assumes Docker containers and networks, while explaining the -p mapping syntax from the beginning.
What you can do after
Operate/configure Docker port mappings so a local application can reach ScyllaDB during development.
How it connects
Connects Docker containers, CQL, Scylla drivers, and single-node clusters.

Also explained in

Compare how 5 books explain port forwarding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.