解决telnet: connect to address 127.0.0.1: Connection refused的错误信息

今天在测试Memcached功能的时候,需要使用到telnet服务,于是连接到本机的localhost,发现报错如下:

[root@localhost software]# telnet localhost 11211
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

查询一下rpm包是否有安装

[root@localhost software]# rpm -qa telnet
telnet-0.17-47.el6_3.1.i686   #telnet包已安装

[root@localhost software]# rpm -qa telnet-server

检查原因是没有安装telenet-server的服务。

运行yum命令我们来进行安装:

[root@localhost software]# yum install telnet-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.esocc.com
 * extras: mirror.esocc.com
 * updates: mirror.esocc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet-server.i686 1:0.17-47.el6_3.1 will be installed
--> Processing Dependency: xinetd for package: 1:telnet-server-0.17-47.el6_3.1.i686
--> Running transaction check
---> Package xinetd.i686 2:2.3.14-38.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package                           Arch                     Version                                  Repository                Size
========================================================================
Installing:
 telnet-server                     i686                     1:0.17-47.el6_3.1                        base                      36 k
Installing for dependencies:
 xinetd                            i686                     2:2.3.14-38.el6                          base                     122 k

Transaction Summary
========================================================================
Install       2 Package(s)

Total download size: 158 k
Installed size: 311 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): telnet-server-0.17-47.el6_3.1.i686.rpm                                                                |  36 kB     00:00    
(2/2): xinetd-2.3.14-38.el6.i686.rpm                                                                         | 122 kB     00:00    
------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                               270 kB/s | 158 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:xinetd-2.3.14-38.el6.i686                                                                                      1/2
  Installing : 1:telnet-server-0.17-47.el6_3.1.i686                                                                             2/2
  Verifying  : 2:xinetd-2.3.14-38.el6.i686                                                                                      1/2
  Verifying  : 1:telnet-server-0.17-47.el6_3.1.i686                                                                             2/2

Installed:
  telnet-server.i686 1:0.17-47.el6_3.1                                                                                             

Dependency Installed:
  xinetd.i686 2:2.3.14-38.el6                                                                                                      

Complete!

你可能感兴趣的:(IT-Linux)