AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[xinetd](server)

Martin Hope
Mojtaba Rezaeian
Asked: 2021-04-13 13:42:11 +0800 CST

xinetd 如何在自定义端口上激活 sshd 服务?

  • 0

当我尝试使用自定义端口(端口 = 2211)在 xinetd 中运行 ssh 服务时,它向我显示此错误:

xinetd[16783]:服务 ssh 需要端口 22,而不是 2211

如果我在 xinetd 中将端口更改为 22,它可以正常工作,但是如何自定义在 xinetd 中使用我的端口?

ssh port xinetd
  • 2 个回答
  • 294 Views
Martin Hope
yaugenka
Asked: 2021-02-21 13:44:39 +0800 CST

使 inetd 将连接传递到 unix 域套接字

  • 0

我正在尝试将 Postfix 放在 inetd 后面。这个想法是配置 inetd 来监听 inet smtp 端口,并使 Postfix 监听一个 unix-domain 端口。

是否可以将 inetd 传递连接到 unix 域套接字?

xinetd inetd
  • 1 个回答
  • 155 Views
Martin Hope
vasco.debian
Asked: 2014-08-02 01:58:49 +0800 CST

在 NATed 环境中通过 xinetd 进行端口转发

  • 1

我正在研究一种设置,该设置需要将来自服务器端口之一的请求重定向到 NATed 环境中的其他服务器端口(例如:来自 192.168.1.100:843 的所有请求都应重定向到 192.168.1.200:8443 - 两台服务器位于专用防火墙后面并在所有端口之间相互通信。)

服务正在服务器 192.168.1.200 的 8443 端口上运行。我通过 xinetd 在服务器 192.168.1.100 上配置了端口转发,如下所示。

service serv1
{
        bind            = 192.168.1.100
        protocol        = tcp
        flags           = REUSE
        socket_type     = stream
        port            = 843
        wait            = no
        user            = root
        redirect        = 192.168.1.200 8443
}

现在,当我在 LAN 内远程登录到 192.168.1.100 843 时,我可以在 192.168.1.200:8443 上连接服务

-> telnet 192.168.1.100 843
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.

但是当我试图通过 192.168.1.100 的公共 IP 连接时,我得到“连接关闭”

-> telnet 1.2.3.4 843
Trying 1.2.3.4...
Connected to 1.2.3.4.
Escape character is '^]'.
Connection closed by foreign host.

在执行 tcpdump 时,我发现在后面的情况下请求不会到达服务器 192.168.1.200 本身。

我在我们的一个 DC 中进行了类似的设置,并且工作正常。任何想法,如果这里有什么问题。

谢谢,梅加南德

xinetd
  • 2 个回答
  • 632 Views
Martin Hope
sjaensch
Asked: 2014-03-19 05:47:02 +0800 CST

systemd:获取 xinetd 启动的服务的核心转储

  • 4

我最近将系统升级到 openSUSE 13.1。我们正在通过 xinetd 在系统上运行定制服务,并且在旧的 xinetd 初始化脚本中,ulimit -c unlimited在启动 xinetd 之前有一行代码来启用核心转储。由于 openSUSE 13.1 使用 systemd,这不再起作用。

systemd-coredumpctl即使有确认崩溃的内核日志消息,也找不到任何核心转储。从 bash 手动启动服务,然后发送 SIGSEGV 确实会在我们配置的目录中创建核心转储。如何恢复我的核心转储?

xinetd
  • 1 个回答
  • 2621 Views
Martin Hope
Brad
Asked: 2013-05-04 04:41:51 +0800 CST

使用 Percona XtraDB 集群检查从对等方接收数据时卷曲失败

  • 0

我遇到了与此处提到的问题类似的问题: xinetd 'connection reset by peer'

我已经使用 xinetd 设置了 percona-clustercheck(Percona 的 XtraDB Cluster 软件包附带),并且在尝试远程 curl clustercheck 时出现错误。(注意它在本地工作得很好。)

这是它在本地的样子:

[root@db1 tmp]# for i in {1..1000}; do curl http://db1.ourdomain.local:9200; sleep 2; date;  done Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:16 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:18 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:20 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:22 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:24 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:26 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:28 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:30 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:32 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:30:34 EDT 2013
Percona XtraDB Cluster Node is synced.

和远程:

[root@db2 ~]# for i in {1..1000}; do curl http://db1.ourdomain.local:9200; sleep 2; date;  done Percona XtraDB Cluster Node is synced.
Fri May  3 07:32:23 EDT 2013
curl: (56) Failure when receiving data from the peer            <----- error
Fri May  3 07:32:25 EDT 2013
curl: (56) Failure when receiving data from the peer            <----- error
Fri May  3 07:32:27 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:32:29 EDT 2013
curl: (56) Failure when receiving data from the peer            <----- error
Fri May  3 07:32:31 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:32:33 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:32:35 EDT 2013
Percona XtraDB Cluster Node is synced.
Fri May  3 07:32:37 EDT 2013

上一篇文章中的解决方案是设置“Content-Length:”,但我正在使用的脚本已经尝试设置内容长度:

if [[ "${WSREP_STATUS}" == "4" ]] || [[ "${WSREP_STATUS}" == "2" && ${AVAILABLE_WHEN_DONOR} == 1 ]]
then
    # Percona XtraDB Cluster node local state is 'Synced' => return HTTP 200
    # Shell return-code is 0
    echo -en "HTTP/1.1 200 OK\r\n"
    echo -en "Content-Type: text/plain\r\n"
    echo -en "Connection: close\r\n"
    echo -en "Content-Length: 40\r\n"
    echo -en "\r\n"
    echo -en "Percona XtraDB Cluster Node is synced.\r\n"
    exit 0
else
    # Percona XtraDB Cluster node local state is not 'Synced' => return HTTP 503
    # Shell return-code is 1
    echo -en "HTTP/1.1 503 Service Unavailable\r\n"
    echo -en "Content-Type: text/plain\r\n"
    echo -en "Connection: close\r\n"
    echo -en "Content-Length: 44\r\n"
    echo -en "\r\n"
    echo -en "Percona XtraDB Cluster Node is not synced.\r\n"
    exit 1
fi

我尝试按照建议将内容长度更改为零。echo -en "Content-Length: 0\r\n" 在 if 和 else 语句中 - 但这似乎对我的情况没有帮助。

这是我在详细模式下运行 curl 时看到的内容:

Fri May  3 08:34:33 EDT 2013
* About to connect() to db1.ourdomain.local port 9200 (#0)
*   Trying 1.2.3.4... connected
* Connected to db1..local (1.2.3.4) port 9200 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: db1.ourdomain.local:9200
> Accept: */*
>
< HTTP/1.1 200 OK
* Closing connection #0
* Failure when receiving data from the peer
curl: (56) Failure when receiving data from the peer

如果我在本地使用 curl 或远程使用 telnet,一切似乎都能正常工作。它只是远程卷曲,这是一个问题。不幸的是,我们使用的硬件负载平衡器要求我执行 http 检查(没有 telnet 选项)。

我该如何进一步解决这个问题?

谢谢!布拉德

编辑 - 添加 xinetd 脚本的内容:

cat /etc/xinetd.d/mysqlchk
# default: on
# description: mysqlchk
service mysqlchk
{
# this is a config for xinetd, place it in /etc/xinetd.d/
    disable = no
    flags           = REUSE
    socket_type     = stream
    port            = 9200
    wait            = no
    user            = nobody
    server          = /usr/bin/clustercheck
    log_type        = FILE /var/log/xinetdlog
    log_on_failure  += USERID
    only_from       = 0.0.0.0/0
    # recommended to put the IPs that need
    # to connect exclusively (security purposes)
    per_source      = UNLIMITED
}
xinetd
  • 2 个回答
  • 4430 Views
Martin Hope
ceejayoz
Asked: 2013-03-22 09:38:42 +0800 CST

xinetd '连接被对等方重置'

  • 3

我在 xinetd 中使用percona-clustercheck(Percona 的 XtraDB Cluster 软件包附带),在尝试卷曲 clustercheck 服务时出现错误。

/usr/bin/clustercheck:

#!/bin/bash 
#
# Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly
#
# Author: Olaf van Zandwijk <[email protected]>
# Documentation and download: https://github.com/olafz/percona-clustercheck
#
# Based on the original script from Unai Rodriguez 
#

MYSQL_USERNAME="clustercheckuser" 
MYSQL_PASSWORD="clustercheckpassword!" 
ERR_FILE="/dev/null" 
AVAILABLE_WHEN_DONOR=0

#
# Perform the query to check the wsrep_local_state
#
WSREP_STATUS=`mysql --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} -e "SHOW STATUS LIKE 'wsrep_local_state';" 2>${ERR_FILE} | awk '{if (NR!=1){print $2}}' 2>${ERR_FILE}` 

if [[ "${WSREP_STATUS}" == "4" ]] || [[ "${WSREP_STATUS}" == "2" && ${AVAILABLE_WHEN_DONOR} == 1 ]]
then 
    # Percona XtraDB Cluster node local state is 'Synced' => return HTTP 200
    /bin/echo -en "HTTP/1.1 200 OK\r\n" 
    /bin/echo -en "Content-Type: text/plain\r\n" 
    /bin/echo -en "\r\n" 
    /bin/echo -en "Percona XtraDB Cluster Node is synced.\r\n" 
    /bin/echo -en "\r\n" 
    exit 0
else 
    # Percona XtraDB Cluster node local state is not 'Synced' => return HTTP 503
    /bin/echo -en "HTTP/1.1 503 Service Unavailable\r\n" 
    /bin/echo -en "Content-Type: text/plain\r\n" 
    /bin/echo -en "\r\n" 
    /bin/echo -en "Percona XtraDB Cluster Node is not synced.\r\n" 
    /bin/echo -en "\r\n"
    exit 1 
fi

/etc/xinetd.mysqlchk:

# default: on
# description: mysqlchk
service mysqlchk
{
# this is a config for xinetd, place it in /etc/xinetd.d/
  disable = no
  flags = REUSE
  socket_type = stream
  port = 9200
  wait = no
  user = nobody
  server = /usr/bin/clustercheck
  log_on_failure += USERID
  only_from = 10.0.0.0/8 127.0.0.1
  # recommended to put the IPs that need
  # to connect exclusively (security purposes)
  per_source = UNLIMITED
}

当尝试 curl 服务时,我得到了一个有效的响应(HTTP 200,文本),但最后有一个“连接被对等重置”的通知:

HTTP/1.1 200 OK
Content-Type: text/plain

Percona XtraDB Cluster Node is synced.

curl: (56) Recv failure: Connection reset by peer

不幸的是,Amazon ELB 似乎将此视为失败的检查,而不是成功的检查。

如何让 clustercheck 以 curl 看不到连接失败的方式正常退出?

xinetd
  • 4 个回答
  • 3185 Views
Martin Hope
crazybyte
Asked: 2010-02-28 14:27:45 +0800 CST

svnserve 与 xinetd + svnserve

  • 0

考虑到可扩展性/负载和安全性、svnserve + xinetd 或独立 svnserver,什么是最佳解决方案?谢谢!

svn svnserve xinetd
  • 2 个回答
  • 611 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve