Code: 210. DB::NetException: Connection refused (localhost:9000)

Posted Biexiansheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Code: 210. DB::NetException: Connection refused (localhost:9000)相关的知识,希望对你有一定的参考价值。

1、为啥子报这个错误呢,因为我在Clickhouse中使用了mysql引擎,创建一个数据表。当我使用drop database删除数据库之后,发现删除不掉,然后ctrl+c了,之后再次进入clickhouse客户端就报下面的错误了。

1 [root@master ~]# clickhouse-client -m
2 ClickHouse client version 20.8.3.18.
3 Connecting to localhost:9000 as user default.
4 Code: 210. DB::NetException: Connection refused (localhost:9000)

解决方法,我是先将/var/lib/clickhouse/data下面的创建的mysql引擎的数据库目录删除掉,然后再将/var/lib/clickhouse/metadata下面创建的mysql引擎的数据库目录删除掉,然后再次重启Clickhouse服务,最后启动clickhouse客户端,基本就解决了问题了。如果还是不行,重启服务器试试,再重启Clickhouse服务,最后启动clickhouse客户端。

 

2、可以查看Clickhouse的服务启动状态,如下所示:

 1 [root@master ~]# systemctl status clickhouse-server.service
 2 ● clickhouse-server.service - LSB: Yandex clickhouse-server daemon
 3    Loaded: loaded (/etc/rc.d/init.d/clickhouse-server; bad; vendor preset: disabled)
 4    Active: active (exited) since 二 2021-02-23 20:04:35 CST; 3h 13min ago
 5      Docs: man:systemd-sysv-generator(8)
 6   Process: 1132 ExecStart=/etc/rc.d/init.d/clickhouse-server start (code=exited, status=0/SUCCESS)
 7     Tasks: 0
 8 
 9 2月 23 20:04:31 master systemd[1]: Starting LSB: Yandex clickhouse-server daemon...
10 2月 23 20:04:31 master su[1168]: (to clickhouse) root on none
11 2月 23 20:04:32 master clickhouse-server[1132]: Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var...ckhouse/
12 2月 23 20:04:32 master su[1324]: (to clickhouse) root on none
13 2月 23 20:04:32 master su[1344]: (to clickhouse) root on none
14 2月 23 20:04:33 master su[1370]: (to clickhouse) root on none
15 2月 23 20:04:33 master su[1405]: (to clickhouse) root on none
16 2月 23 20:04:35 master clickhouse-server[1132]: DONE
17 2月 23 20:04:35 master systemd[1]: Started LSB: Yandex clickhouse-server daemon.
18 Hint: Some lines were ellipsized, use -l to show in full.
19 [root@master ~]# 

 

3、当然了,有的说是修改下面的配置文件,我的不是这个问题,这里简单列一下。

1 [root@master ~]# vim /etc/clickhouse-server/config.xml

有的说,改成下面这个配置,由于我要远程连接服务器的Clickhouse服务,所以本身就已经改成这个了。

 

以上是关于Code: 210. DB::NetException: Connection refused (localhost:9000)的主要内容,如果未能解决你的问题,请参考以下文章

tiny210(s5pv210)移植u-boot(基于 2014.4 版本号)——移植u-boot.bin(打印串口控制台)

clickhouse未解决 ClickHouse exception, code: 1002 DB::Exception: Directory already exists

K210学习笔记 K210与STM32进行串口通信,K210发STM收

DP整理

K210学习笔记 K210与STM32串口通信相关

K210学习笔记 K210与STM32进行串口通信,K210收,STM32发