Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过Docker的本地DSE群集_Docker_Cassandra_Dse - Fatal编程技术网

通过Docker的本地DSE群集

通过Docker的本地DSE群集,docker,cassandra,dse,Docker,Cassandra,Dse,你好 我想构建一个具有3个节点的locales 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:

你好

我想构建一个具有3个节点的locales 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

我的问题是

  • 如何通过cqlsh从主机访问容器中的cassandra
    cqlsh localhost:9042
    引发错误:
  • 回溯(最近一次呼叫最后一次):
    文件“/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py”,第2434行,在
    main(*读取选项(sys.argv[1:],os.environ))
    文件“/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py”,第2413行,主视图
    编码=选项。编码)
    文件“/home/Software/apache-cassandra-3.11.1/bin/cqlsh.py”,第479行,在__
    负载平衡策略=WhiteListRoundRobinPolicy([self.hostname]),
    文件“/home/Software/apache-cassandra-3.11.1/bin/。/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/policies.py”,第417行,在__
    socket.gaierror:[Errno-2]名称或服务未知
    
  • 这足以适应卡桑德拉。亚马尔

  • 对于DSE,我建议使用发布到Docker hub的现有图像(您仍然可以从中获取Docker文件定义),而不是自己构建Docker图像。还有一些方法可以用来创建本地集群——最好使用它们


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

    关于您的问题-您正在使用每个进程的端口绑定启动每个docker,但由于冲突,它无法工作。解决方案是只启动一个绑定到9042的端口,其余端口不绑定到该端口

    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
    
    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