我无法连接到我的nodecluster,我的nodetool状态是当前拒绝,我正在使用Cassandra 4.1,但不工作尝试编辑在cassandra. yaml为localhost使用www.example.com也编辑我的www.example.com为公共名称重命名它与localhost也不工作,所以我决定降级到4.0.7和工作完美没有改变为参数的cassandra. yaml也 127.0.0.1 also edit my cassandra-env.sh for public name rename it with localhost too is also not working, so i decided to downgrade into 4.0.7 and working perfectly nothing to change into parameter of cassandra.yaml also www.example.com
工具
1.Cassandra4.1
1.操作系统:Ubuntu 20.04
- Java版本:openjdk版本"11.0.17" 2022年10月18日OpenJDK运行时环境(内部版本号11.0.17 + 8-post-Ubuntu-1ubuntu220.04)OpenJDK 64位服务器虚拟机(内部版本号11.0.17 + 8-post-Ubuntu-1ubuntu220.04,混合模式)
这里是我的nodetool状态中的代码错误
root@myserver:/etc/cassandra# nodetool status
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.
我的cqlsh也不工作,只能这样显示
root@myserver:/etc/cassandra# cqlsh 161.97.96.126 9042
Connection error: ('Unable to connect to any servers', {'161.97.96.126:9042': ConnectionRefusedError(111, "Tried connecting to [('161.97.96.126', 9042)]. Last error: Connection refused")})
我是绝望的,但尝试安装另一个版本意味着降级从4. 1到4. 0. 7(我使清除删除我所有的cassandra 4. 1文件,安装从一开始为4. 0. 7),然后viola没有什么要改变的参数在cassandra. yaml也www.example.com,但与我目前的工具完美以上cassandra-env.sh but works perfectly with my current tools above
Cassandra4.1仍然不兼容Ubuntu 20.04?
- 更新日期:2023年1月23日22:10 pm**
这里我的代码,当我再次尝试安装cassandra 4.1没有编辑任何东西,只是新鲜安装一次
root@myvps:~# sudo service cassandra status
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (running) since Mon 2023-01-23 14:49:41 CET; 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 1644739 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Tasks: 24 (limit: 9479)
Memory: 2.2G
CGroup: /system.slice/cassandra.service
└─1644848 /usr/bin/java -ea -da:net.openhft... -XX:+UseThreadPriorities -XX:+HeapDumpOnOutOfMemoryError -X>
Jan 23 14:49:41 myvps.contaboserver.net systemd[1]: Starting LSB: distributed storage system for structured data...
Jan 23 14:49:41 myvps.contaboserver.net systemd[1]: Started LSB: distributed storage system for structured data.
root@myvps:~# sudo service cassandra status
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (exited) since Mon 2023-01-23 14:49:41 CET; 31s ago
Docs: man:systemd-sysv-generator(8)
Process: 1644739 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Jan 23 14:49:41 myvps.contaboserver.net systemd[1]: Starting LSB: distributed storage system for structured data...
Jan 23 14:49:41 myvps.contaboserver.net systemd[1]: Started LSB: distributed storage system for structured data.
root@myvps:~# nodetool version
nodetool: Failed to connect to '127.0.0.1:7199' - ConnectException: 'Connection refused (Connection refused)'.
root@myvps:~# cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': ConnectionRefusedError(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
更新23 - 01 - 2023 22:16 PM我尝试访问2件事netstat -tnlp
并显示此
root@myvps:~# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 537/redis-server 12
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 598/nginx: master p
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 447/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 534/sshd: /usr/sbin
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 578/postgres
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 598/nginx: master p
tcp6 0 0 ::1:6379 :::* LISTEN 537/redis-server 12
tcp6 0 0 :::80 :::* LISTEN 598/nginx: master p
tcp6 0 0 :::22 :::* LISTEN 534/sshd: /usr/sbin
tcp6 0 0 ::1:5432 :::* LISTEN 578/postgres
tcp6 0 0 :::443 :::* LISTEN 598/nginx: master p
输入sudo lsof -nPi -sTCP:LISTEN
也会显示此内容
root@myvps:~# sudo lsof -nPi -sTCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd-r 447 systemd-resolve 13u IPv4 18529 0t0 TCP 127.0.0.53:53 (LISTEN)
sshd 534 root 3u IPv4 18387 0t0 TCP *:22 (LISTEN)
sshd 534 root 4u IPv6 18389 0t0 TCP *:22 (LISTEN)
redis-ser 537 redis 6u IPv4 20184 0t0 TCP 127.0.0.1:6379 (LISTEN)
redis-ser 537 redis 7u IPv6 20185 0t0 TCP [::1]:6379 (LISTEN)
postgres 578 postgres 5u IPv6 20704 0t0 TCP [::1]:5432 (LISTEN)
postgres 578 postgres 6u IPv4 20705 0t0 TCP 127.0.0.1:5432 (LISTEN)
nginx 598 root 6u IPv6 18878 0t0 TCP *:443 (LISTEN)
nginx 598 root 7u IPv4 18879 0t0 TCP *:443 (LISTEN)
nginx 598 root 8u IPv4 18880 0t0 TCP *:80 (LISTEN)
nginx 598 root 9u IPv6 18881 0t0 TCP *:80 (LISTEN)
nginx 601 www-data 6u IPv6 18878 0t0 TCP *:443 (LISTEN)
nginx 601 www-data 7u IPv4 18879 0t0 TCP *:443 (LISTEN)
nginx 601 www-data 8u IPv4 18880 0t0 TCP *:80 (LISTEN)
nginx 601 www-data 9u IPv6 18881 0t0 TCP *:80 (LISTEN)
nginx 602 www-data 6u IPv6 18878 0t0 TCP *:443 (LISTEN)
nginx 602 www-data 7u IPv4 18879 0t0 TCP *:443 (LISTEN)
nginx 602 www-data 8u IPv4 18880 0t0 TCP *:80 (LISTEN)
nginx 602 www-data 9u IPv6 18881 0t0 TCP *:80 (LISTEN)
nginx 603 www-data 6u IPv6 18878 0t0 TCP *:443 (LISTEN)
nginx 603 www-data 7u IPv4 18879 0t0 TCP *:443 (LISTEN)
nginx 603 www-data 8u IPv4 18880 0t0 TCP *:80 (LISTEN)
nginx 603 www-data 9u IPv6 18881 0t0 TCP *:80 (LISTEN)
nginx 604 www-data 6u IPv6 18878 0t0 TCP *:443 (LISTEN)
nginx 604 www-data 7u IPv4 18879 0t0 TCP *:443 (LISTEN)
nginx 604 www-data 8u IPv4 18880 0t0 TCP *:80 (LISTEN)
nginx 604 www-data 9u IPv6 18881 0t0 TCP *:80 (LISTEN)
1条答案
按热度按时间lymgl2op1#
我可以确认Cassandra 4.1可以在Ubuntu的最新版本上工作,包括20.04 LTS和22.04 LTS。
我在安装/运行Cassandra 4.1时没有遇到任何问题。你没有指定复制问题的步骤,所以我假设你所做的就是重新安装Cassandra 4.1。无论如何,我按照官方网站上的Installing Cassandra说明操作,它就工作了。
无论如何,我安装的Java 11版本与您相同:
零配置更改
安装Cassandra 4.1后,没有进行任何配置更改,我可以按预期运行
nodetool
命令:x一个一个一个一个x一个一个二个x
我还可以使用
cqlsh
连接到群集:配置IP地址
为了重复您的操作,我使用测试机器的IP地址更新了
cassandra.yaml
:启动Cassandra后,我又可以按预期运行
nodetool
命令了:我还可以使用
cqlsh
连接到群集:结论
您无法连接到群集的最可能原因是节点上没有运行Cassandra。您可以使用
lsof
和netstat
等Linux实用程序轻松验证:您将需要检查Cassandra
system.log
,以查找它为什么不运行的线索。如果您在
listen_address
中指定了一个IP地址,请确保您也使用相同的IP地址更新了种子列表,否则Cassandra将关闭,因为它无法与种子聊天。👉 请将鼠标悬停在cassandra标签上,然后单击
Watch tag
按钮,以支持Apache Cassandra社区。谢谢!🙏 Thanks!