gpt4 book ai didi

docker - 通过 Docker 的本地 DSE 集群

转载 作者:行者123 更新时间:2023-12-02 19:44:41 29 4
gpt4 key购买 nike

你好,
我想构建一个具有 3 个节点的语言环境 dse 集群。我在 docker 容器中按如下方式构建每个 dse 节点

sudo docker pull debian:latest
sudo docker run -p 7001:7001 -p 9042:9042 -p 9160:9160 -u root --name mein-container -it -e https_proxy=http://10.241.50.94:8080 -e http_proxy=http://10.241.50.94:8080 debian:latest
apt-get update
apt-cache search wget
apt-cache search wget | grep wget
apt search wget
apt-get install wget -y

apt-get update && apt-get install -y gnupg2

wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
apt-get install software-properties-common -y

add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
apt-get update && apt-get install adoptopenjdk-8-hotspot -y

echo "deb https://debian.datastax.com/enterprise stable main" | tee -a /etc/apt/sources.list.d/datastax.sources.list
apt install curl -y

curl -L https://debian.datastax.com/debian/repo_key | apt-key add -
apt-get update

apt-get install dse=5.1.10-1 \
dse-full=5.1.10-1 \
dse-libcassandra=5.1.10-1 \
dse-libgraph=5.1.10-1 \
dse-libhadoop2-client-native=5.1.10-1 \
dse-libhadoop2-client=5.1.10-1 \
dse-liblog4j=5.1.10-1 \
dse-libsolr=5.1.10-1 \
dse-libspark=5.1.10-1 \
dse-libtomcat=5.1.10-1 -y

service dse start
我的问题是...
  • 如何通过 cqlsh 从主机访问容器中的 cassandra? cqlsh localhost:9042抛出错误:
  • Traceback (most recent call last):
    File "/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py", line 2434, in <module>
    main(*read_options(sys.argv[1:], os.environ))
    File "/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py", line 2413, in main
    encoding=options.encoding)
    File "/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py", line 479, in __init__
    load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]),
    File "/home/Software/apache-cassandra-3.11.1/bin/../lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/policies.py", line 417, in __init__
    socket.gaierror: [Errno -2] Name or service not known
  • 适配cassandra.yaml就够了?
  • 最佳答案

    对于 DSE,我建议不要自己构建 Docker 镜像,而是使用发布到 Docker hub 的现有镜像(您仍然可以从 repository 获取 Dockerfile 定义)。还有Docker compose files您可以使用它来创建本地集群 - 最好使用它们。
    关于您的问题 - 您正在启动每个 docker 绑定(bind)每个进程的端口,但由于冲突而无法正常工作。解决方案是只启动一个绑定(bind)到 9042,其余不绑定(bind)到该端口

    关于docker - 通过 Docker 的本地 DSE 集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64268165/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com