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
    • 最新
    • 标签
主页 / user-30415

Banjer's questions

Martin Hope
Banjer
Asked: 2014-05-21 05:21:07 +0800 CST

“net ads join”在 puppet exec 中失败,但直接从命令行运行正常

  • 3

我有以下exec将 Linux (CentOS 6) 主机加入 Active Directory 域的内容。从 bash 终端以 root 身份运行时,它会成功运行,并且主机已正确加入 AD 域。

但是,当在 puppet 中运行时,net ads join命令失败并显示:

加入域失败:为机器帐户设置密码失败(NT_STATUS_ACCESS_DENIED)

这是执行

exec { 'adjoin':
    command  => "kinit [email protected] -k -t /etc/krb5.keytab && net ads join createcomputer='Machines/Servers/Linux Servers' osName='${operatingsystem}' osVer=${operatingsystemrelease} -k",
    unless   => "net ads testjoin -k | grep -q 'Join is OK'",
    provider => shell,
    user     => root,
    path     => '/usr/sbin:/usr/bin:/sbin:/bin',
    require  => [
        File['/etc/krb5.conf'],
        File['/etc/krb5.keytab'],
    ],
    logoutput => true,
}

我尝试过使用和不使用provideranduser参数。

linux
  • 1 个回答
  • 3312 Views
Martin Hope
Banjer
Asked: 2014-03-13 11:38:02 +0800 CST

让网络广告加入创建 PTR 记录

  • 3

使用该net ads join命令将 Linux 主机(CentOS 6.5)加入域(Windows Server 2008 DC)时,会创建一条 A 记录,但不会创建相应的 PTR 记录。是否可以自动创建 PTR 记录?也许是参数net ads join或设置/etc/samba/smb.conf?

仅供参考,我运行的将主机加入 DC 的完整命令:

sudo net ads join createcomputer="machines/Servers/Linux Servers" osName="CentOS" osVer=6.5 -U banjer

在 Windows Server 上手动创建 DNS A 记录时,会自动创建 PTR 记录。如果您需要更多信息,请告诉我。

linux
  • 2 个回答
  • 4162 Views
Martin Hope
Banjer
Asked: 2014-01-04 05:34:54 +0800 CST

日志中的内核警告:set_rtc_mmss 无法从 0 更新到 58

  • 6

我一直在看到一堆这样的日志消息

Jan 3 00: 58: 57 foo kernel: set_rtc_mmss: can't update from 0 to 58

它们发生在 VMware 上运行的 CentOS 6.4 虚拟机上。我知道这与来宾操作系统上未正确设置硬件时钟有关。我发现这个命令将硬件时钟设置为当前系统时间:

sudo hwclock --systohc

这是虚拟机的正确设置吗?另外,在哪里可以设置它以使其持久化?在内核启动参数?我希望新配置的虚拟机没有这个问题。

更新 1

按照要求:

me@foo:~> ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        .LOCL.          10 l   43   64  377    0.000    0.000   0.000
+dtc-nist01.ntp. .ACTS.           1 u  174 1024  377    3.311   -8.554   0.497
*nist1-nj.ustimi .ACTS.           1 u  205 1024  377    6.737    3.775   0.433
+nist1-pa.ustimi .ACTS.           1 u   55 1024  377    8.610    4.688   0.337

我看到这个虚拟机上的 vmwaretools 已经过时了。也许我用于管理 vmwaretools 安装的 puppet 模块没有正确安装它。我去看看然后回复你。

更新 2

是的,vmware tools 已安装并且是最新版本。

me@foo:~> ps aux | grep vmtools
root     56021  0.0  0.1  59508  4156 ?        S    Jan09   3:29 /usr/sbin/vmtoolsd

更新 3

我尝试在虚拟机上启用“与主机同步访客时间”:

me@foo:~> vmware-toolbox-cmd timesync status
Disabled
me@foo:~> vmware-toolbox-cmd timesync enable
me@foo:~> vmware-toolbox-cmd timesync status
Enabled

但我仍然收到这些消息。事实上,date现在hwclock --show相隔几分钟,而过去它们很紧。

过去,较旧的 SLES 9 虚拟机受益于 VMware 文章Timekeeping best practice for Linux guest中的设置,但它指出 CentOS/RHEL 6 来宾不需要设置任何额外的内核参数。

更新 4

升级到 CentOS 6.5 并没有帮助。内核是:

Linux foo 2.6.32-431.1.2.0.1.el6.x86_64 #1 SMP Fri Dec 13 13:06:13 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
centos
  • 4 个回答
  • 19516 Views
Martin Hope
Banjer
Asked: 2013-11-13 08:35:04 +0800 CST

uWSGI snmp 统计信息

  • 0

我有兴趣通过 snmp 收集 uWSGI 的统计信息,以便在 Cacti 中绘图。根据这些文档,我开始使用 uwsgi:

uwsgi -s :3031 --udp 192.168.10.1:2222 --snmp --snmp-community foo --emperor /usr/local/uwsgi/vassals --emperor-tyrant --pidfile /var/run/uwsgi.pid --vacuum

他们提供的示例 snmpget 命令工作正常:

$ snmpget -v2c -c foo 192.168.10.1:2222 1.3.6.1.4.1.35156.17.1.1
SNMPv2-SMI::enterprises.35156.17.1.1 = Counter64: 0

但是,除了那个之外,我看不到任何其他 snmp“值”。我不应该能够从基本 OID snmpwalk 吗?当我尝试查看暴露了哪些值时,我得到了超时。

snmpwalk -v2c -c foo 192.168.10.1:2222 1.3.6.1.4.1.35156.17
Timeout: No Response from 192.168.10.1:2222

从我引用的文档中:

一般信息由 uWSGI 服务器本身管理。访问 uWSGI SNMP 信息的基本 OID 是 1.3.6.1.4.1.35156.17 (iso.org.dod.internet.private.enterprise.unbit.uwsgi)。常规选项映射到 1.3.6.1.4.1.35156.17.1.x。

我要么不了解 snmp,要么不了解 uWSGI 提供的 snmp 方式。谢谢你的帮助。

django
  • 1 个回答
  • 608 Views
Martin Hope
Banjer
Asked: 2013-02-02 07:15:41 +0800 CST

NFS 客户端读写速度不平衡

  • 5

我有一台 NetApp 作为我的 nfs 服务器,还有两台 Linux 服务器作为 nfs 客户端。问题是两台服务器中较新的一台在同时对 nfs 服务器进行读取和写入时,读取和写入速度差异很大。另外,对于这个新服务器来说,读取和写入看起来都很棒。旧服务器没有这个问题。

旧主人:鲤鱼

Sun Fire x4150,带 8 个内核,32 GB RAM

SLES 9 SP4

网络驱动:e1000

me@carp:~> uname -a
Linux carp 2.6.5-7.308-smp #1 SMP Mon Dec 10 11:36:40 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux

新宿主:胡椒

HP ProLiant Dl360P Gen8 带 8 核,64 GB 内存

中央操作系统 6.3

网络驱动:tg3

me@pepper:~> uname -a
Linux pepper 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

我将跳到一些说明读/写测试的图表。这是胡椒及其不平衡的读/写:

胡椒吞吐量

这是鲤鱼,看起来不错:

鲤鱼吞吐量

测试

这是我正在运行的读/写测试。我已经分别运行了它们,它们在 pepper 上看起来很棒,但是当一起运行时(使用&),写入性能仍然稳定,而读取性能却受到很大影响。测试文件是 RAM 大小的两倍(胡椒为 128 GB,鲤鱼为 64 GB)。

# write
time dd if=/dev/zero of=/mnt/peppershare/testfile bs=65536 count=2100000 &
# read 
time dd if=/mnt/peppershare/testfile2 of=/dev/null bs=65536 &

NFS 服务器主机名是 nfsc。Linux 客户端在子网上有一个专用的 NIC,它与其他任何东西都是分开的(即与主 IP 不同的子网)。每个 Linux 客户端从服务器 nfsc 挂载一个 nfs 共享到 /mnt/hostnameshare。

非甾体抗炎药

这是 Pepper 的同步 r/w 测试期间的 1 分钟示例:

me@pepper:~> nfsiostat 60

nfsc:/vol/pg003 mounted on /mnt/peppershare:

   op/s         rpc bklog
1742.37            0.00
read:             ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)
                 49.750         3196.632         64.254        0 (0.0%)           9.304          26.406
write:            ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)
                1642.933        105628.395       64.293        0 (0.0%)           3.189         86559.380

我还没有在旧主机 carp 上安装 nfsiostat,但正在努力。

/过程/坐骑

me@pepper:~> cat /proc/mounts | grep peppershare 
nfsc:/vol/pg003 /mnt/peppershare nfs rw,noatime,nodiratime,vers=3,rsize=65536,wsize=65536,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.x.x.x,mountvers=3,mountport=4046,mountproto=tcp,local_lock=none,addr=172.x.x.x 0 0

me@carp:~> cat /proc/mounts | grep carpshare 
nfsc:/vol/pg008 /mnt/carpshare nfs rw,v3,rsize=32768,wsize=32768,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,timeo=60000,retrans=3,hard,tcp,lock,addr=nfsc 0 0

网卡设置

me@pepper:~> sudo ethtool eth3
Settings for eth3:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 4
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
        Link detected: yes

me@carp:~> sudo ethtool eth1
Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: umbg
        Wake-on: g
        Current message level: 0x00000007 (7)
        Link detected: yes

卸载设置:

me@pepper:~> sudo ethtool -k eth3
Offload parameters for eth3:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off

me@carp:~> # sudo ethtool -k eth1
Offload parameters for eth1:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: on

它全部在 LAN 上,在 nfs 客户端和 nfs 服务器之间有一个全双工的千兆交换机。另一方面,我看到在 CPU 上等待 pepper 的 IO 比 carp 多得多,正如预期的那样,因为我怀疑它在等待 nfs 操作。

我已经用 Wireshark/Ethereal 捕获了数据包,但我在这方面并不强,所以不确定要寻找什么。我没有在 Wireshark 中看到一堆以红色/黑色突出显示的数据包,所以这就是我要查找的所有内容:)。这种糟糕的 nfs 性能已经体现在我们的 Postgres 环境中。

任何进一步的想法或故障排除技巧?如果我可以提供更多信息,请告诉我。

更新

根据@ewwhite 的评论,我尝试了两种不同的 tuned-adm 配置文件,但没有任何变化。

在我的红色标记的右边还有两个测试。第一座山是与,throughput-performance第二座山是与enterprise-storage。

胡椒广告调整

企业存储配置文件的 nfsiostat 60

nfsc:/vol/pg003 mounted on /mnt/peppershare:

   op/s         rpc bklog
1758.65            0.00
read:             ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)
                 51.750         3325.140         64.254        0 (0.0%)           8.645          24.816
write:            ops/s            kB/s           kB/op         retrans         avg RTT (ms)    avg exe (ms)
                1655.183        106416.517       64.293        0 (0.0%)           3.141         159500.441

更新 2

sysctl -a 用于胡椒

linux
  • 1 个回答
  • 9863 Views
Martin Hope
Banjer
Asked: 2013-01-31 07:23:59 +0800 CST

如何更改千兆网卡上的“Advertised pause frame use”和自动协商设置

  • 4

与旧服务器相比,我正在调查新服务器上一些较差的 nfs 性能。旧服务器和新服务器都是 nfs 客户端,它们连接到完全相同的 NetApp nfs 服务器。

我的具体问题: 如何更改“Advertised pause frame use”设置?

我看了一下交换机端,交换机上的端口对两台主机都显示 1000 全双工。但是,旧服务器的流量控制显示“Sy/Asy”,但新服务器设置为 Sym。我假设 Asy=Asymmetric 和 Sym=Symmetric,我的另一个假设是开关看到Sym因为在 Linux 端Advertised pause frame use设置为Symmetric。我怎样才能将其更改为非对称?此设置会影响性能吗?我只是想尽可能多地排除。

这些是专用存储链接,即它们是一个单独的 NIC,并且位于与主 NIC 不同的子网上。

我在旧服务器和新服务器上都没有看到 iowait 问题,因此 CPU 和内存似乎不是问题。我认为它与 eth 设置或 nfs 设置有关。我可以详细介绍设置,但想先回答这个具体问题。

新主机(HP ProLiant Dl360P Gen8 上的 CentOS 6.3)

$ sudo ethtool eth3
Settings for eth3:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        **Advertised pause frame use: Symmetric**
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 4
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
        Link detected: yes

司机:tg3

旧主机(Sun Fire x4150 上的 SLES 9 SP4)

$ sudo ethtool eth1
Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: umbg
        Wake-on: g
        Current message level: 0x00000007 (7)
        Link detected: yes

司机:e1000

linux
  • 2 个回答
  • 17762 Views
Martin Hope
Banjer
Asked: 2012-11-21 04:45:05 +0800 CST

同一台服务器上的多个 MongoDB 实例

  • 5

我们在 CentOS 6.3 上搭建了一个MongoDB开发服务器,并且能够通过使用单独的配置文件和 rc 脚本来分离不同的项目。现在我们正在考虑设置 MongoDB 生产环境。

我读到不建议在生产中的同一台服务器上托管多个 MongoDB 实例。 这是否意味着每个项目都需要自己的生产 MongoDB 环境?

这些项目不是非常“大”,因此不需要很多资源,所以我们给每个项目提供自己的主机感觉就像是在抢先一步。也许我们只需要将头脑从 RDBMS 世界中解脱出来。

我们将监控我们的开发服务器以了解它的运行情况,但我正在寻找一些见解和您自己的一些个人经验来补充我所阅读的内容。

linux
  • 1 个回答
  • 5861 Views
Martin Hope
Banjer
Asked: 2012-11-15 12:23:45 +0800 CST

让 fail2ban 向被禁方发送通知

  • 5

我在某些 CentOS 5 和 6 服务器上配置了fail2ban,每当 IP 被禁止时,它都会向我发送一封包含 IP whois 的电子邮件。是否可以将 fail2ban 配置为从 whois 报告向电子邮件发送通知?

这是我的监狱配置:

# /etc/fail2ban/jail.conf    

[ssh-iptables]

enabled  = true
filter   = sshd
action   = iptables-allports[name=SSH, protocol=all]
           sendmail-whois[name=SSH, [email protected], sender=fail2ban]
logpath  = /var/log/secure
maxretry = 3

是否有某种变量可以dest=发送到 whois 电子邮件?

linux
  • 3 个回答
  • 8768 Views
Martin Hope
Banjer
Asked: 2012-11-09 06:21:50 +0800 CST

读取密钥表文件 krb5.keytab 时出错

  • 6

我在 SLES 11.2 和 CentOS 6.3 上都注意到了这些 kerberos keytab 错误消息:

sshd[31442]: pam_krb5[31442]: error reading keytab 'FILE: / etc/ krb5. keytab'

/etc/krb5.keytab在我们的主机上不存在,根据我对 keytab 文件的了解,我们不需要它。根据这个 kerberos keytab 介绍:

keytab 是一个文件,其中包含成对的 Kerberos 主体和加密密钥(这些密钥源自 Kerberos 密码)。您可以使用此文件登录到 Kerberos 而无需提示输入密码。keytab 文件最常见的个人用途是允许脚本在没有人工交互的情况下向 Kerberos 进行身份验证,或者将密码存储在纯文本文件中。

这听起来像是我们不需要的东西,从安全角度来说,没有它可能更好。

我怎样才能防止这个错误出现在我们的系统日志中?如果有用的话,这是我的 krb5.conf:

banjer@myhost:~> cat /etc/krb5.conf
# This file managed by Puppet
#
[libdefaults]
        default_tkt_enctypes = RC4-HMAC DES-CBC-MD5 DES-CBC-CRC
        default_tgs_enctypes = RC4-HMAC DES-CBC-MD5 DES-CBC-CRC
        preferred_enctypes = RC4-HMAC DES-CBC-MD5 DES-CBC-CRC
        default_realm = FOO.EXAMPLE.COM
        dns_lookup_kdc = true
        clockskew = 300

[logging]
        default = SYSLOG:NOTICE:DAEMON
        kdc = FILE:/var/log/kdc.log
        kadmind = FILE:/var/log/kadmind.log

[appdefaults]
pam = {
        ticket_lifetime = 1d
        renew_lifetime = 1d
        forwardable = true
        proxiable = false
        retain_after_close = false
        minimum_uid = 0
        debug = false
        banner = "Enter your current"
}

如果您需要查看任何其他配置,请告诉我。谢谢。

编辑

/var/log/secure每当非根用户通过 SSH 或控制台登录时,都会显示此消息。它似乎只发生在基于密码的身份验证中。如果我对服务器执行基于密钥的 ssh,我看不到错误。如果我使用 root 登录,则看不到错误。我们的 Linux 服务器根据 Active Directory 进行身份验证,因此它是 PAM、samba、kerberos 和 winbind 的完美组合,用于对用户进行身份验证。

linux
  • 5 个回答
  • 66255 Views
Martin Hope
Banjer
Asked: 2012-08-08 09:09:18 +0800 CST

kill -9 一个postgres进程

  • 27

一个 postgres SELECT 查询在我们的数据库服务器上失控并开始消耗大量内存和交换,直到服务器内存耗尽。ps aux | grep postgres我通过并运行找到了特定的过程kill -9 pid。这终止了进程并按预期释放了内存。系统的其余部分和 postgres 查询似乎不受影响。此服务器在 SLES 9 SP4 上运行 postgres 9.1.3。

然而,我们的一位开发人员斥责我用 终止了一个 postgres 进程kill -9,说这将关闭整个 postgres 服务。事实上,它没有。我以前做过几次,没有看到任何负面影响。

话虽如此,在进一步阅读之后,看起来kill pid没有标志是杀死失控的 postgres 进程的首选方法,但对于 postgres 社区的其他用户来说,这听起来也像 postgres 这些年来“变得更好”,以至于kill -9在单个查询进程/线程上不再是死刑。

有人能告诉我杀死失控的 postgres 进程的正确方法以及kill -9这些天使用 Postgres 的灾难性(或良性)吗?感谢您的洞察力。

linux
  • 3 个回答
  • 23200 Views
Martin Hope
Banjer
Asked: 2012-06-23 10:05:25 +0800 CST

在 Fabric 中使用 /etc/ssh 中的 SSH 配置和密钥

  • 0

我正在尝试将 SSH 密钥与 Fabric 一起使用,而不是每次运行时都必须输入密码fab。我们所有的主机都共享同一个/etc/ssh/ssh_known_hosts文件,其中包含它们所有的公共 rsa 密钥,而且我能够在没有密码的情况下从一台主机到另一台主机进行 SSH。

我必须遵循我的环境变量设置fabfile.py:

env.use_ssh_config = True
env.ssh_config_path = '/etc/ssh/ssh_config'
env.key_filename = '/etc/ssh/ssh_host_rsa_key'

我fab test以 root 身份运行一个简单的命令:

def test:
    run('uname -s')

我已经浏览了所有文档并进行了大量搜索,但我没有看到使用密钥和配置的示例/etc/ssh;这些示例通常展示如何使用 configs 和 keys in ~/.ssh/,所以我可能误解了如何使用这些设置。

这是一个调试:

root@beef:~> fab test
[chicken] Executing task 'test'
[chicken] run: uname -s
DEBUG:ssh.transport:starting thread (client mode): 0x141c710L
INFO:ssh.transport:Connected (version 1.99, client OpenSSH_5.1)
DEBUG:ssh.transport:kex algos:['diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour128', 'arcfour256', 'arcfour', 'aes192-cbc', 'aes256-cbc', '[email protected]', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour128', 'arcfour256', 'arcfour', 'aes192-cbc', 'aes256-cbc', '[email protected]', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] client mac:['hmac-md5', 'hmac-sha1', '[email protected]', 'hmac-ripemd160', '[email protected]', 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', '[email protected]', 'hmac-ripemd160', '[email protected]', 'hmac-sha1-96', 'hmac-md5-96'] client compress:['none', '[email protected]', 'zlib'] server compress:['none', '[email protected]', 'zlib'] client lang:[''] server lang:[''] kex follows?False
DEBUG:ssh.transport:Ciphers agreed: local=aes128-ctr, remote=aes128-ctr
DEBUG:ssh.transport:using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
DEBUG:ssh.transport:Switch to new keys ...
DEBUG:ssh.transport:Adding ssh-rsa host key for chicken: 56f3f71a494013976c183844d342ed1b
[chicken] Login password for 'root':

系统日志chicken说

Jun 22 13:48:47 chicken sshd[7328]:未收到来自 172.xxx 的标识字符串

所以我没有传递正确的密钥文件或其他东西......

更新

我从 Fabric 用户邮件列表收到了一些故障排除提示。

我可以看到,当我从 shell 连接到 ssh 客户端时,客户端请求连接方法为“无”,然后是“基于主机”。Fabric(或 Paramiko)似乎立即请求公钥。请注意每个示例中选择的连接方法:

登录成功

root@beef:~> ssh -t -i /etc/ssh/ssh_host_rsa_key chicken uname -s

root@chicken:~> /usr/sbin/sshd -d
...snip...
debug1: userauth-request for user root service ssh-connection method none
debug1: attempt 0 failures 0
debug1: PAM: initializing for "root"
debug1: userauth-request for user root service ssh-connection method hostbased
debug1: attempt 1 failures 0
debug1: userauth_hostbased: cuser root chost beef. pkalg ssh-dss slen 55
debug1: PAM: setting PAM_RHOST to "beef"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: fd 4 clearing O_NONBLOCK
debug1: restore_uid: 0/0
Failed hostbased for root from 172.x.x.x port 54623 ssh2
debug1: userauth-request for user root service ssh-connection method hostbased
debug1: attempt 2 failures 1
debug1: userauth_hostbased: cuser root chost beef. pkalg ssh-rsa slen 271
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: fd 4 clearing O_NONBLOCK
debug1: restore_uid: 0/0
debug1: ssh_rsa_verify: signature correct
debug1: do_pam_account: called
Accepted hostbased for root from 172.x.x.x port 54623 ssh2

通过 Fabric 登录失败

root@beef:~ > fab test

root@chicken:~> /usr/sbin/sshd -d
...snip...
debug1: userauth-request for user root service ssh-connection method publickey
debug1: attempt 0 failures 0
debug1: PAM: initializing for "root"
debug1: PAM: setting PAM_RHOST to "beef"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 0/0 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys2
debug1: restore_uid: 0/0
Failed publickey for root from 172.x.x.x port 54630 ssh2

所以...问题:有什么方法可以将 hostbased 指定为 Fabric/Paramiko 中的首选连接方法?

linux ssh fabric
  • 1 个回答
  • 3378 Views
Martin Hope
Banjer
Asked: 2012-06-23 05:33:25 +0800 CST

eth0 和 eth1 都在启动时分配了相同的 IP

  • 1

我在 Sun Fire x4140 上有一个物理 SLES 11 SP2 服务器,它在重新启动时给我带来网络问题。NIC 是板载的。

引导期间网络似乎成功,但网络服务(如 nfs)却严重失败。这是因为 eth0 和 eth1 都接收相同的配置并且都被 ifup-ed。一旦一切都超时并且我在控制台,ifconfig 显示 eth0 和 eth1 已启动并使用相同的 IP 运行。尝试 ping 该子网中的任何内容都失败。重新启动网络服务可解决此问题。

根据 MA​​C 地址,eth0 是应该配置为主网卡的正确网卡。

问题:是什么导致 eth1 使用与 eth0 相同的配置?

我没有为 eth1 设置配置脚本:

banjer@harp:~> ls -la /etc/sysconfig/network/
total 104
drwxr-xr-x 6 root root  4096 Jun 11 12:21 .
drwxr-xr-x 6 root root  4096 Apr 10 09:46 ..
-rw-r--r-- 1 root root 13916 Apr 10 09:32 config
-rw-r--r-- 1 root root  9952 Apr 10 09:36 dhcp
-rw------- 1 root root   180 Jun 11 12:21 ifcfg-eth0
-rw------- 1 root root   180 Jun 11 12:21 ifcfg-eth3
-rw------- 1 root root   172 Feb  1 08:32 ifcfg-lo
-rw-r--r-- 1 root root 29333 Feb  1 08:32 ifcfg.template
drwxr-xr-x 2 root root  4096 Apr 10 09:32 if-down.d
-rw-r--r-- 1 root root   239 Feb  1 08:32 ifroute-lo
drwxr-xr-x 2 root root  4096 Apr 10 09:33 if-up.d
drwx------ 2 root root  4096 May  5  2010 providers
-rw-r--r-- 1 root root    25 Nov 16  2010 routes
drwxr-xr-x 2 root root  4096 Apr 10 09:36 scripts

附带说明一下,eth3 还配置了不同子网中的 IP,但这没有造成任何问题。仅供参考,正在使用的内核模块是forcedeth.

banjer@harp:~> sudo cat /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='172.21.64.25/20'
MTU=''
NAME='MCP55 Ethernet'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
ONBOOT="yes"

这是 eth3,以备不时之需:

banjer@harp:~> sudo cat /etc/sysconfig/network/ifcfg-eth3
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='172.11.200.4/24'
MTU=''
NAME='MCP55 Ethernet'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
ONBOOT="yes"

也许与 udev 有关? 70-persistent-net-rules对我来说看起来不错,但我可能不完全理解。

banjer@harp:~> cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10de:0x0373 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x10de:0x0373 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10de:0x0373 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x10de:0x0373 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:18:4f:8d:85:4d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x1077:0x3032 (qla3xxx)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c1:dd:0e:34:6c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

关于什么会导致这种情况的任何其他想法?

更新 1

根据建议,我为所有其他未使用的 NIC(eth1 和 eth2)提供了配置,例如这里是 eth1:

banjer@harp:/etc/sysconfig/network> sudo cat ifcfg-eth1
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME='MCP55 Ethernet'
NETMASK='255.255.255.0'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='off'
ONBOOT='no'
USERCONTROL='no'

并将具体添加HWADDR到实际插入的 NIC(eth0 和 eth3)。在测试重启期间,我看到网络按预期出现,并且 eth1 和 eth2 按预期显示“已跳过”。然而,eth1 仍然会随着 eth0 的配置一起出现。

我设置udev_log="debug"了/etc/udev/udev.conf,现在我在/var/log/messages. 这是 的粘贴,grep eth1 /var/log/messages但与其他 eth 的 grep 相比,我看不出有什么突出之处。

更新 2

认为这是一个 udev 问题,我进行了更改/lib/udev/rules.d/75-persistent-net-generator.rules并做了rm /etc/udev/rules.d/70-persistent-net.rules.

# device name whitelist
#KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
KERNEL!="eth[03]|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"

重新启动后,这正是我想要的(为 eth0、eth3 生成规则),但它没有解决问题。eth1 仍然被提出。有没有办法调试整个启动过程,例如strace?我不知道这是从哪里来的。

作为创可贴,我添加了一个 rc 脚本以在引导过程的后期重新启动网络。

linux networking udev sles sles11
  • 4 个回答
  • 7513 Views
Martin Hope
Banjer
Asked: 2012-06-20 03:51:44 +0800 CST

PuppetDB:无法提交“替换事实”命令

  • 6

我最近撤销/清理了 Puppet 代理证书,这似乎对 PuppetDB 产生了负面影响。我看到这里已经提交了一个错误,其中包含一些有关解决该问题的说明。一位用户在这里遇到了类似的问题,但这些都不适合我。

服务器运行 CentOS 6.2、Puppet 2.7.13 和 Puppet DB 0.9。错误是:

root@harp:/etc/puppetdb/ssl> puppet agent --test
err: Cached facts for harp failed: Failed to find facts from PuppetDB at harp.mydomain.com:8081: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed.  This is often because the time is out of sync on the server or client
info: Loading facts in /etc/puppet/modules/dns/lib/facter/datacenter.rb
info: Caching facts for harp
err: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed.  This is often because the time is out of sync on the server or client
err: Could not run Puppet configuration client: Could not retrieve local facts: Failed to submit 'replace facts' command for harp to PuppetDB at harp.mydomain.com:8081: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed.  This is often because the time is out of sync on the server or client

从我所见,NTP 工作正常,日期时间看起来不错。“harp”实际上是傀儡主服务器,所以代理和服务器之间的时间应该没有问题,因为它们是一样的。

旧证书:

root@harp:/etc/puppetdb/ssl> puppet cert list --all
+ harp  (DF:8F:65:36:58:4C:DE:66:2B:65:D1:E6:18:B7:F2:33)

清理并为代理生成新证书:

root@harp:/etc/puppetdb/ssl> puppet cert clean harp
notice: Revoked certificate with serial 18
notice: Removing file Puppet::SSL::Certificate harp at '/var/lib/puppet/ssl/ca/signed/harp.pem'
notice: Removing file Puppet::SSL::Certificate harp at '/var/lib/puppet/ssl/certs/harp.pem'
notice: Removing file Puppet::SSL::CertificateRequest harp at '/var/lib/puppet/ssl/certificate_requests/harp.pem'
notice: Removing file Puppet::SSL::Key harp at '/var/lib/puppet/ssl/private_keys/harp.pem'

root@harp:/etc/puppetdb/ssl> puppet agent --test
info: Creating a new SSL key for harp
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for harp
info: Certificate Request fingerprint (md5): 72:5E:99:6A:DE:B0:76:BD:1A:7D:FD:DC:A9:E8:71:AD
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled

root@harp:/etc/puppetdb/ssl> puppet cert list
  harp (72:5E:99:6A:DE:B0:76:BD:1A:7D:FD:DC:A9:E8:71:AD)

root@harp:/etc/puppetdb/ssl> puppet cert sign harp
notice: Signed certificate request for harp
notice: Removing file Puppet::SSL::CertificateRequest harp at '/var/lib/puppet/ssl/ca/requests/harp.pem'

root@harp:/etc/puppetdb/ssl> puppet cert list --all
+ harp  (4A:D4:90:87:15:1B:D3:FD:A8:15:D9:C0:FB:08:5C:79)

root@harp:/etc/puppetdb/ssl> service puppetdb restart
Stopping puppetdb: /etc/init.d/puppetdb: line 77: kill: (8623) - No such process
                                                           [FAILED]
Starting puppetdb:                                         [  OK  ]

那么好吧,再次重新启动以备不时之需:

root@harp:/etc/puppetdb/ssl> service puppetdb restart
Stopping puppetdb:                                         [  OK  ]
Starting puppetdb:                                         [  OK  ]

运行SSL 配置脚本

root@harp:/etc/puppetdb/ssl> /usr/sbin/puppetdb-ssl-setup
cp: cannot stat `/var/lib/puppet/ssl/certs/harp.pem': No such file or directory

root@harp:/etc/puppetdb/ssl> ls -la /var/lib/puppet/ssl/certs
total 12
drwxr-xr-x 2 puppet root 4096 Jun 19 07:19 ./
drwxrwx--x 8 puppet root 4096 Apr 24 10:04 ../
-rw-r--r-- 1 puppet root 1854 Apr 24 10:04 ca.pem

那么好吧,再试一次:

root@harp:/etc/puppetdb/ssl> /usr/sbin/puppetdb-ssl-setup
Certificate was added to keystore
Usage: pkcs12 [options]
where options are
-export       output PKCS12 file
-chain        add certificate chain
-inkey file   private key if not infile
-certfile f   add all certs in f
-CApath arg   - PEM format directory of CA's
-CAfile arg   - PEM format file of CA's
-name "name"  use name as friendly name
-caname "nm"  use nm as CA friendly name (can be used more than once).
-in  infile   input filename
...snip...
-CSP name     Microsoft CSP name
-LMK          Add local machine keyset attribute to private key

/etc/puppetdb/ssl 中的密钥库似乎没有更改/重新生成。此时运行puppet agent --test同样报错,重启puppet和puppetdb也无济于事。

密钥库信息:

root@harp:/etc/puppetdb/ssl> keytool -list -keystore /etc/puppetdb/ssl/keystore.jks
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

harp.mydomain.com, May 25, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): 06:A8:D3:2A:70:F3:6D:34:62:91:45:22:8A:C4:A8:86
root@harp:/etc/puppetdb/ssl> keytool -list -keystore /etc/puppetdb/ssl/truststore.jks
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

puppetdb ca, May 25, 2012, trustedCertEntry,
Certificate fingerprint (MD5): 13:AD:D8:BC:42:40:47:BB:D2:5C:ED:3C:D1:78:26:88
root@harp:/etc/puppetdb/ssl> puppet cert --fingerprint ca harp.mydomain.com
ca 13:AD:D8:BC:42:40:47:BB:D2:5C:ED:3C:D1:78:26:88
err: Could not call fingerprint: Could not find a certificate or csr for harp.mydomain.com

root@harp:/etc/puppetdb/ssl> puppet cert --fingerprint ca harp
ca 13:AD:D8:BC:42:40:47:BB:D2:5C:ED:3C:D1:78:26:88
harp 4A:D4:90:87:15:1B:D3:FD:A8:15:D9:C0:FB:08:5C:79

如何让 puppetdb 密钥库真正重新生成?我尝试删除 /etc/puppetdb/ssl/ 中的文件,但没有成功。

puppet ssl puppetdb
  • 4 个回答
  • 19610 Views
Martin Hope
Banjer
Asked: 2012-06-15 05:17:18 +0800 CST

Puppet:仅当值不相等时才执行

  • 0

我有一个脚本,实际上只需要在服务器上运行一次,即在部署时,但我认为最好让 Puppet 管理它。该脚本重新映射了几个与本地系统用户冲突的旧用户 ID。

我检查这个的方法是 gopher 用户是否具有默认 uid 13。如果是这样,那么我需要运行我的重新映射脚本。

exec { "change_uid":
   command  => "/script/to/run.sh",
   provider => 'shell',
   path => [ "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", "/usr/local/sbin" ],
   onlyif   => "test `/usr/bin/id -u gopher` -eq 13; echo $?",
}

我已经尝试了上述onlyif检查的几种不同排列,但 exec 总是被代理人解雇。

当我直接在命令行上运行该命令时,它返回 0 或 1。这可能与 bash在 true 时返回 0 而在 false 时返回 1这一事实有关,但我认为更有可能是我误解了onlyif工作方式.

当 gopher 的 uid=13 时,我怎样才能让这个 exec 启动?我愿意接受其他方法来实现我在这里想要完成的事情。

更新

我放弃了回声部分。最终的工作解决方案是:

exec { "change_uid":
   command  => "/script/to/run.sh",
   path     => [ "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", "/usr/local/sbin" ],
   onlyif   => "test `id -u gopher` -eq 13",
}

使用ralsh命令有助于测试,感谢@Daniel C. Sobral。我将@Daniel 标记为已接受的答案,因为这是主要问题,除了我对一些概念的误解,而且他首先回答了问题。谢谢大家。

centos puppet exec
  • 2 个回答
  • 15201 Views
Martin Hope
Banjer
Asked: 2012-06-09 07:11:32 +0800 CST

从我的站点清单中的 Puppet 仪表板引用组/类

  • 2

我正在使用 Puppet Dashboard 作为我的 ENC,但我不确定如何引用或使用/etc/puppet/manifests/site.pp.

我在仪表板中定义了两个组:CentOS6和SLES11。如果我想包含组中CentOS6的某个模块列表和组中的某个模块列表,我的 site.pp 应该是什么样子SLES11?

我正在尝试做这样的事情:

# /etc/puppet/manifests/site.pp

node basenode {
  include hosts
  include ssh::server
  include ssh::client
  include authentication
  include sudo
  include syslog
  include mail
}

node 'CentOS6' inherits basenode {
  include profile
}

node 'SLES11' inherits basenode {
  include usrmounts
}

我的模块中有特定于操作系统的案例语句,但有些模块仅适用于特定发行版。所以我想我有两个问题:

  1. 这是以特定于操作系统的方式应用模块/资源的最佳方式吗?还是以上内容让你想吐?
  2. 不管#1,我仍然很好奇如何在我的清单中从仪表板引用类、组和节点。我已阅读外部节点文档,但我没有看到它们与清单的对应关系。

谢谢大家。

puppet puppet-dashboard
  • 2 个回答
  • 2056 Views
Martin Hope
Banjer
Asked: 2012-05-26 07:16:48 +0800 CST

puppet-dashboard:无法从库存服务中检索事实

  • 3

我正在尝试配置 puppet-dashboard,但我遇到了库存/事实问题:

Could not retrieve facts from inventory service: 403 "Forbidden request: puppetmasterhostname(ip.address.was.here) access to /facts/agenthostname.example.com [find] at line 99 "

在 puppet master 的 /etc/puppet/auth.conf 中:

path /facts
method find
auth any
allow *

我重新启动了 puppetmaster 和 puppet-dashboard,但仍然出现上述错误。任何想法或故障排除技巧?

更新

我正在运行木偶 v2.7.13。根据要求,这是我的完整 /etc/puppet/auth.conf。其中大部分是配置中已有的默认值:

# allow nodes to retrieve their own catalog (ie their configuration)
path ~ ^/catalog/([^/]+)$
method find
allow $1

# allow nodes to retrieve their own node definition
path ~ ^/node/([^/]+)$
method find
allow $1

# allow all nodes to access the certificates services
path /certificate_revocation_list/ca
method find
allow *

# allow all nodes to store their reports
path /report
method save
allow *

# inconditionnally allow access to all files services
# which means in practice that fileserver.conf will
# still be used
path /file
allow *

### Unauthenticated ACL, for clients for which the current master doesn't
### have a valid certificate; we allow authenticated users, too, because
### there isn't a great harm in letting that request through.

# allow access to the master CA
path /certificate/ca
auth any
method find
allow *

path /certificate/
auth any
method find
allow *

path /certificate_request
auth any
method find, save
allow *

# this one is not stricly necessary, but it has the merit
# to show the default policy which is deny everything else
path /
auth any

# Inventory
path /facts
method find
auth any
allow *

/etc/puppet/puppet.conf

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

[master]
   reports = store, http
   reporturl = http://puppetmasterhostname.example.com:3000/reports/upload
   facts_terminus = yaml
   storeconfigs = true
   storeconfigs_backend = puppetdb
   node_terminus = exec
   external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://localhost:3000 /opt/puppet-dashboard/bin/external_node
puppet puppet-dashboard centos6.2
  • 4 个回答
  • 3425 Views
Martin Hope
Banjer
Asked: 2012-05-23 06:39:00 +0800 CST

使用 puppet 管理 ssh_known_hosts

  • 5

我是Puppet(开源版本)的新手,有一个相对简单的问题。

当我启动一个新主机时,我希望 puppetmaster 将新主机的公共 rsa 密钥添加到 /etc/ssh/ssh_known_hosts,这样更新的 ssh_known_hosts 文件就可以被 puppet 代理拉下来。

我试过sshkey资源:

# /etc/puppet/modules/ssh/manifests/client.pp

sshkey { $hostname:
    ensure => present,
    type => "rsa",
    key  => $sshrsakey,
}

但是,ssh_known_hosts 似乎没有在 puppetmaster 或代理上进行修改。我的清单在我运行时通过了语法验证,puppet parser validate client.pp并且puppet agent --test在代理上运行时未报告任何问题。

我是否必须设置存储配置才能使用 sshkey 资源?我喜欢 Stored Configs 的功能,但它似乎对我需要的东西来说太过分了,而且似乎增加了很多开销。我的另一个选择是将事实吐$sshrsakey给 a file,但它需要检查公钥是否存在,这样它就不会被多次添加。

linux puppet ssh-keys puppetdb
  • 1 个回答
  • 4377 Views
Martin Hope
Banjer
Asked: 2010-04-17 11:09:36 +0800 CST

在 SLES 11 自动安装期间指定网络设置

  • 3

我正在设置一个用于自动安装 SLES 11 的 autoinst.xml 文件。系统会提示我输入下面的各种界面设置,但是一旦服务器重新启动,它们似乎就不会粘住。我认为我没有正确定义 xml。我希望有人有这方面的经验。

<ask-list>
  <ask>
    <path>networking,dns,hostname</path>
    <question>Enter Hostname (server name)</question>
    <stage>initial</stage>
    <default>merkin</default>
  </ask>
  <ask>
    <path>networking,interfaces,interface,0,device</path>
    <question>Enter the primary ethernet device:</question>
    <stage>initial</stage>
    <default>eth0</default>
  </ask>
  <ask>
    <path>networking,interfaces,interface,0,ipaddr</path>
    <question>Enter the primary IP Address:</question>
    <stage>initial</stage>
    </ask>
  <ask>
    <path>networking,interfaces,interface,0,netmask</path>
    <question>Enter the Netmask Address:</question>
    <stage>initial</stage>
  </ask>
  <ask>
    <path>networking,routing,routes,route,0,gateway</path>
    <question>Enter the primary Gateway Address:</question>
    <stage>initial</stage>
  </ask>
</ask-list>

主机名的第一个似乎很好,但其余的则没有。作为替代方案,有没有办法在您配置网络设备的部分停止自动安装,以便用户可以接管?我能够展示分区提案,但不确定如何对网络设置进行同样的操作。

networking sles autoyast sles11
  • 1 个回答
  • 1170 Views
Martin Hope
Banjer
Asked: 2010-04-15 10:09:48 +0800 CST

如果我启动到运行级别 1,为什么 eth0 会显示 IP?

  • 0

我正在构建的新 Linux 服务器上的网络存在一些问题。操作系统是 SLES 11。当启动到运行级别 1 时,我看到 eth0 显示 IP。物理上,有一根网线插入与 eth1 关联的卡,然后有一根网线插入 QLogic iSCSI 卡(eth4,未显示)。我已经对此进行了一段时间的故障排除,似乎 eth0 以某种方式被分配了一个 IP,即使它没有在 Linux 中配置,甚至没有插入网络。想法?

ifconfig -a

这是 ifconfig 输出

(抱歉,我需要更多代表才能在 SF 上发布图片……)

sles linux-networking sles11
  • 1 个回答
  • 231 Views
Martin Hope
Banjer
Asked: 2010-01-13 11:14:44 +0800 CST

是否有从 python setup.py install 生成的日志文件?

  • 0

当我安装 python 模块时,我使用

python setup.py install

我在命令行上看到了所有输出,但是所有这些输出是否都保存到某个地方的日志文件中?我问是因为我在我们的开发服务器上安装了一个模块没有问题。我去将它安装在我们的生产服务器上并且遇到了问题。我希望比较两个安装的日志。

installation python
  • 2 个回答
  • 9031 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