【发布时间】:2020-12-04 04:50:27
【问题描述】:
我有这个 .yml 文件:
name: CasDB
on: push
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
services:
cassandra:
image: cassandra
ports:
- 9042:9042
options: --health-cmd "cqlsh --debug" --health-interval 5s --health-retries 10
steps:
- run: docker ps
- run: docker exec ${{ job.services.cassandra.id }} cqlsh --debug localhost:9042 --execute="use somekeyspace;"
我希望在我的 Github 操作中启动 Cassandra 数据库,然后执行一些查询。 Cassandra 数据库正在运行,但是当我想执行查询(“使用 somekeyspace”)时,它会失败并显示以下错误消息:
使用 CQL 驱动程序:
使用连接超时:5秒 使用 'utf-8' 编码 使用 ssl: 错误回溯(最近一次调用最后一次):文件 “/opt/cassandra/bin/cqlsh.py”,第 2459 行,在 main(*read_options(sys.argv[1:], os.environ)) 文件 “/opt/cassandra/bin/cqlsh.py”,第 2437 行,主要 encoding=options.encoding) 文件“/opt/cassandra/bin/cqlsh.py”,行 485,在初始化中 load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]), 文件 “/opt/cassandra/bin/.../lib/cassandra-driver-internal-only-3.11.0-bb96859b.zip/cassandra-driver-3.11.0-bb96859b/cassandra/policies.py”,第 417 行,在 init socket.gaierror: [Errno -2] 名称或服务不是 已知 ##[错误]进程完成,退出代码为 1。
我需要将 .yml 中的哪些内容更改为:
- 执行一个 .sql 脚本(多个数据库脚本)
- 执行单个 cqlsh 语句
谢谢
【问题讨论】:
标签: docker cassandra github-actions scylla