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-290403

Skullone's questions

Martin Hope
Skullone
Asked: 2017-06-23 12:08:17 +0800 CST

将多个 puppet master 连接到一个 puppetdb

  • 1

我在我的一个 puppetmaster 上安装了一个 puppetdb,它可以工作。但我无法将第二个连接到木偶大师。

命令“puppet agent -t”适用于我的第二个主人。

每个主节点处理自己的节点(它们不是 LB)。

这是我运行 puppet 代理命令时的 puppetserver.log:

2017-06-22 15:48:21,255 ERROR [qtp1178717687-64] [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
        at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1431) ~[na:1.8.0_65]
        at sun.security.ssl.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:535) ~[na:1.8.0_65]
        at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1214) ~[na:1.8.0_65]
        at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1186) ~[na:1.8.0_65]
        at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:469) ~[na:1.8.0_65]
        at org.apache.http.nio.reactor.ssl.SSLIOSession.doWrap(SSLIOSession.java:263) ~[puppet-server-release.jar:na]
        at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:303) ~[puppet-server-release.jar:na]
        at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:507) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:122) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:164) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106) ~[puppet-server-release.jar:na]
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590) ~[puppet-server-release.jar:na]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_65]
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.8.0_65]
        at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1728) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:304) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) ~[na:1.8.0_65]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509) ~[na:1.8.0_65]
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker$1.run(Handshaker.java:919) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker$1.run(Handshaker.java:916) ~[na:1.8.0_65]
        at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_65]
        at sun.security.ssl.Handshaker$DelegatedTask.run(Handshaker.java:1369) ~[na:1.8.0_65]
        at org.apache.http.nio.reactor.ssl.SSLIOSession.doRunTask(SSLIOSession.java:281) ~[puppet-server-release.jar:na]
        at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:351) ~[puppet-server-release.jar:na]
        ... 9 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387) ~[na:1.8.0_65]
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) ~[na:1.8.0_65]
        at sun.security.validator.Validator.validate(Validator.java:260) ~[na:1.8.0_65]
        at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324) ~[na:1.8.0_65]
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281) ~[na:1.8.0_65]
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136) ~[na:1.8.0_65]
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496) ~[na:1.8.0_65]
        ... 17 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146) ~[na:1.8.0_65]
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131) ~[na:1.8.0_65]
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) ~[na:1.8.0_65]
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382) ~[na:1.8.0_65]
        ... 23 common frames omitted

我在 jetty.ini 有默认配置:

[jetty]
# IP address or hostname to listen for clear-text HTTP. To avoid resolution
# issues, IP addresses are recommended over hostnames.
# Default is `localhost`.
# host = <host>

# Port to listen on for clear-text HTTP.
port = 8080


# The following are SSL specific settings. They can be configured
# automatically with the tool `puppetdb ssl-setup`, which is normally
# ran during package installation.

# IP address to listen on for HTTPS connections. Hostnames can also be used
# but are not recommended to avoid DNS resolution issues. To listen on all
# interfaces, use `0.0.0.0`.
ssl-host = 0.0.0.0

# The port to listen on for HTTPS connections
ssl-port = 8081

# Private key path
ssl-key = /etc/puppetdb/ssl/private.pem

# Public certificate path
ssl-cert = /etc/puppetdb/ssl/public.pem

# Certificate authority path
ssl-ca-cert = /etc/puppetdb/ssl/ca.pem

这是我第二个主人的 puppetdb.conf :

[main]
server_urls = https://puppetmaster01.domain.com:8081

当我第一次启动 puppetdb ssl-setup 时,它说它从 /etc/puppetlabs/puppet/ssl 复制了 puppetmaster ssl(ca、私有和公共)。所以我尝试从我的 master02 复制这些并将其添加到码头中指定的 3 个文件中,但它不起作用。

谢谢你的帮助!

编辑:我找到了一个文档,告诉我必须使用 CA 证书。所以我用那个命令生成了一个 CA 证书:

puppet cert generate puppetmaster01.domain.com --allow-dns-alt-names  --dns_alt_names=puppetmaster.domain.com,puppetmaster01.domain.com,puppetmaster02.domain.com

在我使用这个为 puppetdb 设置 ssl 之后:

puppetdb ssl-setup -f

第一个问题:我的主人工作,我在 ssl/certs 的节点上复制了 ssl/certs/ca.pem,他们能够生成新的 SSL,但我的主人从未收到它。

第二个问题:我将所有 SSL 目录从我的第一个主人复制到第二个,我用好名字重命名了 SSL 文件,但是当我启动我的 puppet 代理 -t 时,我明白了:

Error: Could not retrieve catalog from remote server: Error 403 on SERVER: Forbidden request: puppetmaster01.domain.com(IP_MASTER_02) access to /puppet/v3/catalog/puppetmaster02.domain.com [find] authenticated  at :68
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: Error 403 on SERVER: Forbidden request: puppetmaster01.domain.com(172.27.15.24) access to /puppet/v3/report/puppetmaster02.domain.com [save] authenticated  at :78

就像它试图获取 master01 而不是 02 的信息......

puppet
  • 1 个回答
  • 659 Views
Martin Hope
Skullone
Asked: 2017-04-28 06:49:50 +0800 CST

RHEL7 snmp/mariaDB 依赖问题

  • 0

我已经在很多服务器上安装了 net-snmp,但我的 mariaDB 服务器出现问题:由于 mysql 依赖关系,我无法安装 net-snmp。

  [root@XXXXXXX:~]# yum install net-snmp
  Loaded plugins: fastestmirror, rhnplugin
  This system is receiving updates from RHN Classic or Red Hat Satellite.
  Determining fastest mirrors
  centos7-x86_64                                                                                                                                                                                                        | 1.3 kB  00:00:00     
  centos7-x86_64/group                                                                                                                                                                                                  | 1.8 kB  00:00:00     
  centos7-x86_64/updateinfo                                                                                                                                                                                             | 1.3 MB  00:00:00     
  centos7-x86_64/primary                                                                                                                                                                                                | 9.3 MB  00:00:00     
  centos7-x86_64                                                                                                                                                                                                                   25981/25981
  epel_centos7                                                                                                                                                                                                          | 1.3 kB  00:00:00     
  epel_centos7/group                                                                                                                                                                                                    | 1.3 MB  00:00:00     
  epel_centos7/updateinfo                                                                                                                                                                                               | 800 kB  00:00:00     
  epel_centos7/primary                                                                                                                                                                                                  | 3.6 MB  00:00:00     
  epel_centos7                                                                                                                                                                                                                     10133/10133
  puppetlabs_centos7                                                                                                                                                                                                    |  871 B  00:00:00     
  puppetlabs_centos7/primary                                                                                                                                                                                            |  45 kB  00:00:00     
  puppetlabs_centos7                                                                                                                                                                                                                   213/213
  spacewalk-client_centos7                                                                                                                                                                                              | 1.0 kB  00:00:00     
  spacewalk-client_centos7/group                                                                                                                                                                                        | 1.8 kB  00:00:00     
  spacewalk-client_centos7/primary                                                                                                                                                                                      | 6.3 kB  00:00:00     
  spacewalk-client_centos7                                                                                                                                                                                                               23/23
  Resolving Dependencies
  --> Running transaction check
  ---> Package net-snmp.x86_64 1:5.7.2-24.el7 will be installed
  --> Processing Dependency: net-snmp-agent-libs = 1:5.7.2-24.el7 for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Processing Dependency: mysql-libs for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Processing Dependency: libnetsnmptrapd.so.31()(64bit) for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Processing Dependency: libnetsnmpmibs.so.31()(64bit) for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Processing Dependency: libnetsnmpagent.so.31()(64bit) for package: 1:net-snmp-5.7.2-24.el7.x86_64
  --> Running transaction check
  ---> Package mysql-community-libs.x86_64 0:5.7.18-1.el7 will be installed
  --> Processing Dependency: mysql-community-common(x86-64) >= 5.7.9 for package: mysql-community-libs-5.7.18-1.el7.x86_64
  ---> Package mysql-community-libs-compat.x86_64 0:5.7.18-1.el7 will be installed
  ---> Package net-snmp-agent-libs.x86_64 1:5.7.2-24.el7 will be installed
  --> Running transaction check
  ---> Package mysql-community-common.x86_64 0:5.7.18-1.el7 will be installed
  --> Finished Dependency Resolution

  Dependencies Resolved

  =============================================================================================================================================================================================================================================
   Package                                                              Arch                                            Version                                                  Repository                                               Size
  =============================================================================================================================================================================================================================================
  Installing:
   net-snmp                                                             x86_64                                          1:5.7.2-24.el7                                           centos7-x86_64                                          321 k
  Installing for dependencies:
   mysql-community-common                                               x86_64                                          5.7.18-1.el7                                             centos7-x86_64                                          271 k
   mysql-community-libs                                                 x86_64                                          5.7.18-1.el7                                             centos7-x86_64                                          2.1 M
   mysql-community-libs-compat                                          x86_64                                          5.7.18-1.el7                                             centos7-x86_64                                          2.0 M
   net-snmp-agent-libs                                                  x86_64                                          1:5.7.2-24.el7                                           centos7-x86_64                                          702 k

  Transaction Summary
  =============================================================================================================================================================================================================================================
  Install  1 Package (+4 Dependent packages)

  Total download size: 5.4 M
  Installed size: 24 M
  Is this ok [y/d/N]: y
  Downloading packages:
  (1/5): mysql-community-common-5.7.18-1.el7.x86_64.rpm                                                                                                                                                                 | 271 kB  00:00:00     
  (2/5): mysql-community-libs-5.7.18-1.el7.x86_64.rpm                                                                                                                                                                   | 2.1 MB  00:00:00     
  (3/5): mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm                                                                                                                                                            | 2.0 MB  00:00:00     
  (4/5): net-snmp-5.7.2-24.el7.x86_64.rpm                                                                                                                                                                               | 321 kB  00:00:00     
  (5/5): net-snmp-agent-libs-5.7.2-24.el7.x86_64.rpm                                                                                                                                                                    | 702 kB  00:00:00     
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Total                                                                                                                                                                                                        5.7 MB/s | 5.4 MB  00:00:00     
  Running transaction check
  Running transaction test


  Transaction check error:
    file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-common-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/french/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/german/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/greek/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/italian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/japanese/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/korean/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/polish/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/romanian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/russian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/serbian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/slovak/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/spanish/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/swedish/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64
    file /usr/share/mysql/errmsg-utf8.txt from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package MariaDB-server-10.1.20-1.el7.centos.x86_64

  Error Summary
  -------------

谢谢

mysql
  • 1 个回答
  • 2009 Views
Martin Hope
Skullone
Asked: 2017-02-07 18:08:52 +0800 CST

Mysql需要以root身份运行(docker)

  • 1

我在运行我的 mysql docker 时遇到了一些麻烦。这是我的错误:

testmysql    | + echo 'Finished mysql_install_db'
testmysql    | Finished mysql_install_db
testmysql    | + pid=59
testmysql    | + mysql=(mysql --protocol=socket -uroot -hlocalhost --socket=/var/run/mysqld/mysqld.sock)
testmysql    | + for i in '{30..0}'
testmysql    | + mysqld --verbose --skip-networking --socket=/var/run/mysqld/mysqld.sock
testmysql    | + echo 'SELECT 1'
testmysql    | + mysql --protocol=socket -uroot -hlocalhost '--socket=/var/run/mysqld/mysqld.sock --verbose'
testmysql    | + echo 'MySQL init process in progress...'
testmysql    | + sleep 1
testmysql    | MySQL init process in progress...
testmysql    | 2017-02-06 21:44:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
testmysql    | 2017-02-06 21:44:19 0 [Note] mysqld (mysqld 5.6.35) starting as process 59 ...
testmysql    | 2017-02-06 21:44:19 59 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
testmysql    | 
testmysql    | 2017-02-06 21:44:19 59 [ERROR] Aborting
testmysql    | 
testmysql    | 2017-02-06 21:44:19 59 [Note] Binlog end
testmysql    | 2017-02-06 21:44:19 59 [Note] mysqld: Shutdown complete

这是我的码头工人撰写:

version: '2'

services:

 testmysql:
  build: 
    context: ./test-centos7-mysql
  image: test-centos7-mysql:latest
  container_name: testmysql
  environment:
    MYSQL_ROOT_PASSWORD: test
    MYSQL_DATABASE: test_db
    MYSQL_USER: usr_test
    MYSQL_PASSWORD: test
    MYSQL_HOST: localhost
  networks:
   test_network:
      ipv4_address: 172.16.250.1

networks:

 test_network:
   driver: bridge
   ipam:
     driver: default
     config:
     - subnet: 172.16.250.0/24
       gateway: 172.16.250.254

还有我的 Dockerfile :

FROM centos:7

#Installation des packages de base
RUN yum install -y gcc \
        epel-release \
        make \
        net-tools 

#Installation Mysql 5.6
RUN wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
RUN rpm -ivh mysql-community-release-el7-5.noarch.rpm
RUN yum install -y mysql-community-server

# Nettoyage Yum
RUN yum clean all && rm -rf /tmp/yum*

#Copie du script de permissions
COPY ./container_files/fix_permissions.sh ./
RUN chmod -v +x /fix_permissions.sh
RUN ./fix_permissions.sh /var/lib/mysql/   && \
    ./fix_permissions.sh /var/run/

#Copie du script de création de DB
COPY ./container_files/docker-entrypoint.sh /
RUN chmod -v +x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]

#On ouvre le port par défaut de mysql
EXPOSE 3306
CMD ["mysqld"]

版本:

[pedegand@localhost:~/docker-test]$ cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 
[pedegand@localhost:~/docker-test]$ docker --version
Docker version 1.13.0, build 49bf474
[pedegand@localhost:~/docker-test]$ docker-compose --version
docker-compose version 1.9.0, build 2585387

我看过几篇有相同错误的帖子(https://github.com/docker-library/mysql/issues/216,https://github.com/docker-library/mysql/issues/45)但是我不认为我有同样的问题(没有挂载并且 MYSQL_HOST 设置为 localhost)。

mysql docker docker-compose
  • 1 个回答
  • 11512 Views
Martin Hope
Skullone
Asked: 2016-11-25 10:05:58 +0800 CST

Puppet/hiera : 从一个模板生成多个文件

  • 0

我正在运行 puppet 4,我想从同一个模板生成几个配置文件,每个配置文件都有不同的配置。

例如 :

# cat /tmp/a.conf 
test1

# cat /tmp/b.conf 
test2

而且我需要将所有这些信息放在 hiera 中,所以我认为是这样的:

test::clusters:
  - 'a.conf'
    text: 'test1'
  - 'b.conf'
    text: 'test2'

谢谢

puppet template puppetmaster hiera
  • 2 个回答
  • 796 Views
Martin Hope
Skullone
Asked: 2016-08-19 10:14:41 +0800 CST

Puppet 和 systemctl 的麻烦

  • 2

我在使用 puppet 和 systemctl 时遇到了一些问题。我曾经为“服务”加载几个参数,但它不再在 centos7 上工作。

这是我的错误:

Error: Could not enable [ntpd ntpdate]: 
Error: /Stage[main]/Ntp::Service/Service[[ntpd ntpdate]]/enable: change from false to true failed: Could not enable [ntpd ntpdate]: 

这是我的代码:

希拉:

ntp::service::ntp_services: 
  - "ntpd"
  - "ntpdate"

服务.pp:

class ntp::service ($ntp_services) {
    service {"$ntp_services":
        hasrestart  => false,
        hasstatus   => true,
        ensure      => running,
        enable      => true,
    }
}

它在 centos 6 上运行良好,并且曾经在 centos 7 上运行。

如果我这样定义参数,它会起作用:

ntp::service::ntp_services: "ntpd"

但我必须为 1 个服务定义 1 个参数...

谢谢

puppet centos7 systemctl hiera
  • 1 个回答
  • 392 Views
Martin Hope
Skullone
Asked: 2016-02-25 13:12:49 +0800 CST

如何在 puppet 上隐藏“失败的依赖项”日志

  • 1

我想避免(或至少隐藏)木偶上的“失败的依赖项”日志。

只有当 exec 要求为真时,我才想部署文件。它正在工作,但 puppet 显示了很多错误/警告日志:

Error: /usr/bin/test -e /home/USER returned 1 instead of one of [0]
Error: /Stage[main]/Users::Config/Exec[/usr/bin/test -e /home/USER]/returns: change from notrun to 0 failed: /usr/bin/test -e /home/USER returned 1 instead of one of [0]
Notice: /Stage[main]/Users::Config/Exec[check_ssh_dir]: Dependency Exec[/usr/bin/test -e /home/USER] has failures: true
Warning: /Stage[main]/Users::Config/Exec[check_ssh_dir]: Skipping because of failed dependencies
Notice: /Stage[main]/Users::Config/File[/home/USER/.ssh]: Dependency Exec[/usr/bin/test -e /home/USER] has failures: true
Warning: /Stage[main]/Users::Config/File[/home/USER/.ssh]: Skipping because of failed dependencies
Notice: /Stage[main]/Users::Config/File[/home/USER/.bashrc]: Dependency Exec[/usr/bin/test -e /home/USER] has failures: true
Warning: /Stage[main]/Users::Config/File[/home/USER/.bashrc]: Skipping because of failed dependencies
Notice: /Stage[main]/Users::Config/File[/home/USER/.bash_profile]: Dependency Exec[/usr/bin/test -e /home/USER] has failures: true
Warning: /Stage[main]/Users::Config/File[/home/USER/.bash_profile]: Skipping because of failed dependencies
Notice: /Stage[main]/Users::Config/File[/home/USER/.ssh/authorized_keys]: Dependency Exec[/usr/bin/test -e /home/USER] has failures: true
Warning: /Stage[main]/Users::Config/File[/home/USER/.ssh/authorized_keys]: Skipping because of failed dependencies

这是我的 config.pp :

class users::config ($user) {

    exec {"/usr/bin/test -e /home/${user}":
    }

    exec {"check_ssh_dir":
        command => '/bin/true',
        onlyif => "/usr/bin/test -e /home/${user}/.ssh",
        require => Exec["/usr/bin/test -e /home/${user}"],
    }

    file {"/home/${user}/.ssh":
        ensure => directory,
        owner   => "${user}",
        group   => "domain users",
        mode    => "700",
        require => Exec['check_ssh_dir'],
    }

    file {"/home/${user}/.bashrc":
        source => [ "puppet:///modules/users/${user}/bashrc", "puppet:///modules/users/basics/bashrc"],
        owner   => "${user}",
        group   => "domain users",
        mode    => "640",
        require => Exec["/usr/bin/test -e /home/${user}"],
    }

    file {"/home/${user}/.bash_profile":
        source => [ "puppet:///modules/users/${user}/bash_profile", "puppet:///modules/users/basics/bash_profile"],
        owner   => "${user}",
        group   => "domain users",
        mode    => "640",
        require => Exec["/usr/bin/test -e /home/${user}"],
    }

    file {"/home/${user}/.ssh/authorized_keys":
        source => [ "puppet:///modules/users/${user}/ssh/authorized_keys", "puppet:///modules/users/basics/ssh/authorized_keys"],
        owner   => "${user}",
        group   => "domain users",
        mode    => "600",
        require => Exec["check_ssh_dir"],
    }
}

我正在使用木偶 4.3。

感谢您的帮助。

puppet
  • 2 个回答
  • 862 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