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

clarkk's questions

Martin Hope
clarkk
Asked: 2021-02-13 01:05:39 +0800 CST

无法从 Percona 备份(从服务器)恢复主/从复制

  • 0

从master使用 Percona xtrabackup 创建的备份恢复从属

在主 binlog 上设置为在 14 天后过期,并且此备份不到 24 小时

my.cnf(主)

expire_logs_days   = 14

恢复脚本(从属)

service mysql stop

rm -r /var/lib/mysql/*

# backup is unzipped into /var/lib/mysql
xtrabackup --prepare --target-dir=/var/lib/mysql
chown -R mysql.mysql /var/lib/mysql

service mysql start

# get gtid
line=$(head -n 1 "/var/lib/mysql/xtrabackup_binlog_info")
gtid=$(echo $line | awk -F '[ ,]' '{print $3}')

mysql -u root -pPASS -e "reset master; SET GLOBAL gtid_purged='$gtid'; CHANGE MASTER TO MASTER_HOST='$master_host', MASTER_USER='repl', MASTER_PASSWORD='$master_pass', MASTER_AUTO_POSITION=1; start slave"

mysql -u root -pPASS -e "show slave status\G;"

地位

*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: server.com
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File:
          Read_Master_Log_Pos: 4
               Relay_Log_File: rep-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File:
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: mydb
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 0
              Relay_Log_Space: 154
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 1236
                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID sets and the missing purged transactions are too long to print in this message. For more information, please see the master's error log or the manual for GTID_SUBTRACT.'
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID: fe51e8df-b7c4-11e9-be21-4061862b8d34
             Master_Info_File: /mnt/HC_Volume_8355755/mysql/master.info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 210211 10:50:32
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set: 3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
94bb04d3-6c4e-11eb-8631-96000080ccbb:1-2
                Auto_Position: 1
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:

/var/lib/mysql/xtrabackup_binlog_info

mysql-bin.000025    217141189   3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
fe51e8df-b7c4-11e9-be21-4061862b8d34:1-25059775

gtid从文件中提取的值:3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477

更新

还尝试/var/lib/mysql/xtrabackup_binlog_info通过执行来获取第二个 uid

gtid=$(tail -n 1 "$mysql_dir/xtrabackup_binlog_info")

没有任何效果..同样的错误

更新 2

show master status在主返回

3ccc2392-45ed-11e7-bc98-4061862b8d34:1-35942477,
fe51e8df-b7c4-11e9-be21-4061862b8d34:1-25203198
mysql debian database-replication percona
  • 1 个回答
  • 229 Views
Martin Hope
clarkk
Asked: 2020-11-27 03:48:42 +0800 CST

DNS MX 记录和 SMTP 服务器

  • 0

我有一个 SMTP 服务器。DKIM 已设置并正常工作,并且还设置了 SPF。

SMTP 主机是smtp.domain.com

在 DNS 上,我有一个smtp指向 IPv4 的 A 记录和一个smtp指向 IPv6 的 AAAA 记录。

关于 MX 记录,我有一个用于 IMAP 服务器的 MX 记录 target mail。我也有一个带有目标的 MX 记录smtp

一切都与 SPF 和 DKIM 完美配合

然后有一天,我认为smtp不需要带有目标的 MX 记录 - 所以我删除了它。但后来我的 SPF 身份验证停止工作

SMTP 真的需要 MX 还是我做错了什么?

smtp             IN A 192.0.2.2
smtp             IN AAAA 2001:DB8::2
@                IN TXT "v=spf1 a mx -all"
@                IN MX 10 mail
@                IN MX 11 smtp <--- If this record is deleted SPF auth fails
domain-name-system smtp spf
  • 2 个回答
  • 751 Views
Martin Hope
clarkk
Asked: 2019-10-17 00:39:33 +0800 CST

Exim - 投递邮件缓慢

  • 0

我刚刚设置了自己的 Exim SMTP 服务器来发送电子邮件

但是当我发送时事通讯时,我遇到了一些奇怪的事情。很多时候,当我通过 Exim 发送邮件时,邮件在实际发送后延迟长达一个小时?

假设我发送邮件09:41。邮件已发送,但收件人在10:25.. 收到,但邮件上的时间戳仍然是09:41

这是为什么??

发送邮件时,它们都在同一个“保持活动”的 SMTP (TCP) 连接中发送(在几分钟内发送了大约 1000 封邮件)

然后很多人将看不到我的邮件,因为它在旧邮件和已读邮件之间结束,因为当邮件到达收件箱时,时间戳已经过了一小时

日志

2019-10-16 09:41:21 1iKdvt-0002cc-8A <= newsletter@example.com H=smtp.example.com (example.com) [2a01:4f8:140:43a1::2] P=esmtpsa X=TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128 CV=no A=plain_server:example S=6921 id=W7EVMeu2x4beoTgU8bfdbVw3B2xdt2sVtEOQEcQb7E@example.com
2019-10-16 09:41:21 1iKdvt-0002cc-8A no immediate delivery: more than 10 messages received in one connection

如何立即发送电子邮件而不是将它们放入队列中?

smtp
  • 2 个回答
  • 798 Views
Martin Hope
clarkk
Asked: 2019-10-01 01:00:38 +0800 CST

检查打开的 SMTP 连接是否关闭/超时

  • 0

是否可以向 SMTP 服务器发送某种 ping 以检查连接是否仍然打开并准备好发送邮件

连接是保持活动状态,并想检查连接是否关闭/超时

或者是否可以发送无操作命令以保持连接处于活动状态?

email
  • 2 个回答
  • 652 Views
Martin Hope
clarkk
Asked: 2019-09-29 13:46:03 +0800 CST

即使创建了反向 DNS,SPF 和 IPv6 也会失败

  • 1

向 Gmail 发送邮件时出现此错误

Received-SPF: 失败(google.com:test@domain.com 的域未指定 2a01:4f8:xxx::2 作为允许的发件人)client-ip=2a01:4f8:xxx::2;

当我测试 IPv62a01:4f8:xxx::2反向 DNS ( https://network-tools.webwiz.net/reverse-dns.htm ) 它映射到正确的主机smtp.domain.com

SPF记录

v=spf1 a mx -all

DNS 记录

  • smtp针对 IPv4的记录88.133.xxx.xxx
  • MX 记录定位smtp
email
  • 1 个回答
  • 701 Views
Martin Hope
clarkk
Asked: 2018-06-10 12:13:31 +0800 CST

gzip 在 nginx 上不起作用

  • 4

会议

gzip  on;
gzip_vary  on;
gzip_min_length  100;
gzip_buffers  16 8k;
gzip_proxied  any;
gzip_types
    text/plain
    text/css
    text/javascript
    application/json
    application/javascript;

在此处输入图像描述

nginx
  • 3 个回答
  • 6795 Views
Martin Hope
clarkk
Asked: 2017-10-30 05:20:07 +0800 CST

DMARC 仅在电子邮件未通过身份验证时才会收到报告

  • 4

我在 DNS 上设置了 DMARC

v=DMARC1; p=none; sp=none; fo=1; ri=3600; rua=mailto:report@domain.com; ruf=mailto:report@domain.com

我已设置fo,1但我仍然收到有关通过身份验证的电子邮件的报告!?为什么?

domain-name-system
  • 1 个回答
  • 1093 Views
Martin Hope
clarkk
Asked: 2017-10-17 08:11:34 +0800 CST

DNS DKIM 设置公钥

  • 0

我正在尝试在 DNS 上设置 DKIM

DNS 记录

robot._domainkey.dynaccount.com       IN TXT     "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu01ErHYuvyzng2KNnd4akmuCdV6nu8oxASIBcORwG8+RpCSdQ+SCcroaj2CwN+sHIayBAodHWIFW4TJzzz26TN+jGXO/P5M2RAgVOOkL0Dz0Cz580f4E+e5fYao4dgYT5FPN+Ny+CJRZRK2/JxpV" "1wY/vE7eb+jzngB1p9vvBKqLgn+9PAUM6dUNOAwYpw7Mg7egWA3N/4J8UDyJ9KV8tHpbiOOOR8lmFUJ88KTZyAKp2Ae9Csv2D3ZbOS12xSDasMf0rlVOua8wQaerEmyN8ssaMTmDUoE8B/HrK2PBma3rek9BMTYy+9yrctaGhuMqAeV6BA8uipQJx3/viTvwAQIDAQAB"

在http://dkimvalidator.com/上测试邮件时,一切似乎都很好,除了我明白了

Public Key DNS Lookup

Building DNS Query for robot._domainkey.dynaccount.com
Retrieved this publickey from DNS: 

Validating Signature

result = invalid
Details: public key: not available

距离我在 DNS 上进行更新已经过去了几个小时。IN TXT由于不可用,记录可能有问题?!

domain-name-system
  • 1 个回答
  • 854 Views
Martin Hope
clarkk
Asked: 2015-12-27 07:57:22 +0800 CST

nginx反向代理在连接关闭之前发送输出

  • 2

我已经用 nginx 为 webmin 设置了一个反向代理。但看起来 nginx 在连接关闭之前没有发送 HTTP 响应?!

如果请求长请求(cronjob),则在请求结束后最终用户将首先收到输出?如何设置 nginx 以便将第一个字节发送回代理(nginx)后立即发送响应?

location / {
    proxy_pass  https://xx.xx.xx.xx:10000/;
}
nginx
  • 1 个回答
  • 648 Views
Martin Hope
clarkk
Asked: 2015-12-05 07:30:33 +0800 CST

webmin 和反向代理

  • 0

我想代理一个webmin端点,例如。https://xx.xx.xx.xx:10000所以它可以从https://webmin.example.com

nginx

server {
    listen  443 ssl http2;
    server_name  webmin.example.com;
    
    ssl_certificate  /var/ini/ssl/example.com/public.crt;
    ssl_certificate_key  /var/ini/ssl/example.com/private.key;
    
    location / {
        proxy_pass  https://xxx.xxx.xxx.xxx:10000/;
    }
}

网民

echo "referers=xxx.xxx.xxx.xxx" >> /etc/webmin/config

当请求https://example.com请求被代理到 webmin,但我得到了这个

If this is a legitimate link, you can allow links from this URL as follows :

Login to Webmin normally.
Go to the Webmin Configuration module.
Click on the Trusted Referrers icon.
...

我已经referers=在 webmin config 中添加了 IP 地址

...并已重新启动 webmin 服务器

nginx
  • 1 个回答
  • 3841 Views
Martin Hope
clarkk
Asked: 2015-11-29 09:30:25 +0800 CST

munin - 关键项目邮件队列

  • 0

我刚刚安装了一个新的 Debian Jessie 服务器..

在 munin 监控中有 1 个关键项目:Mailqueue

那是什么?尚未安装任何邮件服务/服务器

在此处输入图像描述

debian
  • 1 个回答
  • 174 Views
Martin Hope
clarkk
Asked: 2015-11-23 04:16:07 +0800 CST

默认 https 服务器块 - 不工作

  • 0

我想要一个默认服务器来捕获所有未声明的主机请求

server {
    listen 80 default_server;
    listen 43 default_server ssl;
    server_name _;

    return 403;
}

我有这个服务器块,但它不适用于https. 当请求未声明的主机时,会返回带有 ssl 证书的第一个服务器块!?

nginx
  • 1 个回答
  • 103 Views
Martin Hope
clarkk
Asked: 2015-11-22 11:24:28 +0800 CST

将 mod_rewrite 内容从 .htaccess 移动到 apache2.conf

  • 0

将此 mod_rewrite 代码从目录中的 .htaccess 移动到 apache2.conf 后,它不再工作

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^                   index.php [L,NS]

错误

错误的请求

您的浏览器发送了此服务器无法理解的请求。

apache-2.2
  • 1 个回答
  • 32 Views
Martin Hope
clarkk
Asked: 2015-05-22 01:35:07 +0800 CST

缓慢的 SSL Apache 服务器

  • 2

我遇到了带有 SSL 256 位证书的慢速 Apache 服务器的问题

ab -n 500 https://example.com/
Time per request 29 ms

ab -n 500 http://example.com/
Time per request 10 ms

两个请求都发送 52 字节,并且测试是从同一数据中心中的服务器完成的

会议

SSLEngine on
SSLProtocol All -SSLv2
SSLHonorCipherOrder On
SSLCipherSuite ALL:!ADH:!EXP:!LOW:!RC2:!3DES:!SEED:!RC4:+HIGH:+MEDIUM

SSL 比普通 HTTP 请求慢 3 倍是否正常?

apache-2.2
  • 5 个回答
  • 6322 Views
Martin Hope
clarkk
Asked: 2014-08-04 10:38:34 +0800 CST

proFTPD 与 FTPS (openssl)

  • 1

已经proFTPD从 webmin 安装,它可以工作...

那我想支持FTPS

命令行

apt-get install openssl
mkdir /etc/proftpd/ssl
cd /etc/proftpd/ssl
openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout private.key -out public.crt

/etc/proftpd/proftpd.conf

<IfModule mod_tls.c>
TLSEngine                  on
TLSLog                     /var/log/proftpd/tls.log
TLSProtocol                SSLv23
TLSOptions                 NoCertRequest
TLSRSACertificateFile      /etc/proftpd/ssl/public.crt
TLSRSACertificateKeyFile   /etc/proftpd/ssl/private.key
TLSVerifyClient            off
TLSRequired                on
</IfModule>

nmap 本地主机

Starting Nmap 6.46 ( http://nmap.org ) at 2014-08-03 22:50 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000010s latency).
Not shown: 995 closed ports
PORT      STATE SERVICE
21/tcp    open  ftp
22/tcp    open  ssh
80/tcp    open  http
3306/tcp  open  mysql
10000/tcp open  snet-sensor-mgmt

日志文件Zilla(客户端)

Status: Connecting to domain.com...
Response:   fzSftp started
Command:    open "user@domain.com" 22
Command:    Pass: ******
Status: Connected to domain.com
Error:  Connection closed by server with exitcode 1
Error:  Could not connect to server
linux
  • 1 个回答
  • 2400 Views
Martin Hope
clarkk
Asked: 2014-08-04 08:46:00 +0800 CST

proFTPD 无法确定 IP 地址

  • 7

启动服务器时返回此错误

Starting ftp server: proftpd2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: warning: unable to determine IP address of 'web-amd-3700-2gb'
2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: error: no valid servers configured
2014-08-03 18:39:22,045 web-amd-3700-2gb proftpd[22126]: fatal: error processing configuration file '/etc/proftpd/proftpd.conf'
 failed!

/etc/proftpd/proftpd.conf

#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
# 

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6             off
# If set on you can experience a longer connection delay in many cases.
IdentLookups            off

ServerName          "Debian"
ServerType          standalone
DeferWelcome            off

MultilineRFC2228        on
DefaultServer           on
ShowSymlinks            on

TimeoutNoTransfer       600
TimeoutStalled          600
TimeoutIdle         1200

DisplayLogin                    welcome.msg
DisplayChdir                .message true
ListOptions                 "-l"

DenyFilter          \*.*/

# Use this to jail all users in their homes 
# DefaultRoot           ~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
# RequireValidShell     off

# Port 21 is the standard FTP port.
Port                21

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                  49152 65534

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress     1.2.3.4

# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances            30

# Set the user and group that the server normally runs at.
User                proftpd
Group               nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask               022  022
# Normally, we want files to be overwriteable.
AllowOverwrite          on

# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd      off

# This is required to use both PAM-based authentication and local passwords
# AuthOrder         mod_auth_pam.c* mod_auth_unix.c

# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile           off

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

# Logging onto /var/log/lastlog is enabled but set to off by default
#UseLastlog on

# In order to keep log file dates consistent after chroot, use timezone info
# from /etc/localtime.  If this is not set, and proftpd is configured to
# chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight
# savings timezone regardless of whether DST is in effect.
#SetEnv TZ :/etc/localtime

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://www.securityfocus.com/bid/11430/discuss
# It is on by default. 
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf

#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.conf

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
#   User                ftp
#   Group               nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias           anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser on ftp
#   DirFakeGroup on ftp
# 
#   RequireValidShell       off
# 
#   # Limit the maximum number of anonymous logins
#   MaxClients          10
# 
#   # We want 'welcome.msg' displayed at login, and '.message' displayed
#   # in each newly chdired directory.
#   DisplayLogin            welcome.msg
#   DisplayChdir        .message
# 
#   # Limit WRITE everywhere in the anonymous chroot
#   <Directory *>
#     <Limit WRITE>
#       DenyAll
#     </Limit>
#   </Directory>
# 
#   # Uncomment this if you're brave.
#   # <Directory incoming>
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask               022  022
#   #            <Limit READ WRITE>
#   #            DenyAll
#   #            </Limit>
#   #            <Limit STOR>
#   #            AllowAll
#   #            </Limit>
#   # </Directory>
# 
# </Anonymous>

# Include other custom configuration files
Include /etc/proftpd/conf.d/

如果配置

eth0      Link encap:Ethernet  HWaddr 00:11:6b:3c:61:b9
          inet addr:88.198.61.237  Bcast:88.198.61.255  Mask:255.255.255.224
          inet6 addr: fe80::211:6bff:fe3c:61b9/64 Scope:Link
          inet6 addr: 2a01:4f8:131:2a::2/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44239400 errors:375 dropped:391 overruns:375 frame:0
          TX packets:41717433 errors:0 dropped:0 overruns:1 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12419358975 (11.5 GiB)  TX bytes:16170232918 (15.0 GiB)
          Interrupt:17 Base address:0x6000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:19799205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19799205 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3252682909 (3.0 GiB)  TX bytes:3252682909 (3.0 GiB)

主机名

web-amd-3700-2gb

猫 /etc/hosts

### Hetzner Online AG installimage
# nameserver config
# IPv4
127.0.0.1 localhost
88.198.61.237  Debian-70-wheezy-64-minimal
#
# IPv6
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2a01:4f8:131:2a::2  Debian-70-wheezy-64-minimal
linux
  • 3 个回答
  • 38953 Views
Martin Hope
clarkk
Asked: 2014-08-02 02:16:22 +0800 CST

sshdOpenSSL 版本不匹配 - 从救援模式更新 sshd

  • 2

apt-get upgrade使用then升级后sshd不会在启动时启动

升级

apt-get update && apt-get upgrade

开机出错

在此处输入图像描述

已尝试以救援模式启动并运行以下命令进行更新sshd,但它不起作用。重新启动后sshd仍然无法在启动时加载并返回有关版本不匹配的相同错误

apt-get update && apt-get install openssh-server openssh-client

如何sshd从救援模式更新 openssl 版本以使版本匹配?

linux
  • 1 个回答
  • 1286 Views
Martin Hope
clarkk
Asked: 2014-01-31 07:15:42 +0800 CST

top(CPU使用率)的解释[重复]

  • 0
这个问题在这里已经有了答案:
谁能准确解释IOWait是什么? (7 个回答)
8年前关闭。

我的服务器一直稳定在 2-3% 左右,但今天 CPU 使用率已经上升到 25% 左右

当我top在命令行中运行时,这就是我所看到的......用户仍然很低,大约 1.3%,与系统相同,大约 1.2%,但后来我看到wa...... 16.1% !?

是什么wa,为什么突然这么高?!

在此处输入图像描述

linux
  • 1 个回答
  • 240 Views
Martin Hope
clarkk
Asked: 2013-06-20 04:28:46 +0800 CST

安装Mysql 5.6后服务器无法启动

  • 5

mysql 服务器安装在全新安装的 Debian 7 上

每次都在全新安装的 Debian 上尝试过几次

安装

# apt-get update && apt-get upgrade
# groupadd mysql
# useradd -r -g mysql mysql
# apt-get install libaio1
# wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.12-debian6.0-x86_64.deb
# dpkg -i mysql-5.6.12-debian6.0-x86_64.deb
# cd /usr/local
# ln -s /opt/mysql/server-5.6 mysql
# cd mysql
# scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
# rm /opt/mysql/server-5.6/my.cnf
# ln -s /var/ini/my.cnf /opt/mysql/server-5.6/my.cnf
# cp support-files/mysql.server /etc/init.d/mysql
# service mysql start

错误

root@Debian-70-wheezy-64-minimal /usr/local/mysql # service mysql start
/opt/mysql/server-5.6/bin/my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)
Fatal error in defaults handling. Program aborted
Starting MySQL
.[....] The server quit without updating PID file (/opt/mysql/server-5.6/data/De[FAIL70-wheezy-64-minimal.pid). ... failed!

错误日志(不存在)

root@Debian-70-wheezy-64-minimal ~ # updatedb
root@Debian-70-wheezy-64-minimal ~ # locate .err
/var/log/mail.err
/var/log/news/news.err

我的.cnf

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
#
# * Basic Settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr/local/mysql
datadir     = /var/lib/mysql
tmpdir      = /tmp
lc-messages-dir = /opt/mysql/server-5.6/share/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 127.0.0.1
#
# * Fine Tuning
#
key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit   = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries   = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id      = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M
#binlog_do_db       = include_database_name
#binlog_ignore_db   = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer      = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

更新

现在服务器正在启动,但是无法连接到mysql

root@Debian-70-wheezy-64-minimal ~ # mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
linux
  • 6 个回答
  • 29046 Views
Martin Hope
clarkk
Asked: 2013-06-17 11:15:17 +0800 CST

如何在 Debian 7 wheezy 上安装 Mysql 5.6

  • 5

我正在尝试在 Debian 7 Wheezy 上安装 Mysql 5.6..

安装mysql后数据库/文件夹/var/lib/mysql/mysql为空

# groupadd mysql
# useradd -r -g mysql mysql
# apt-get install libaio1
# wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.12-debian6.0-x86_64.deb
# dpkg -i mysql-5.6.12-debian6.0-x86_64.deb
# cd /usr/local
# ln -s /opt/mysql/server-5.6 mysql
# cd mysql
# scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
# rm /opt/mysql/server-5.6/my.cnf
# rm /etc/mysql/my.cnf
# ln -s /var/ini/my.cnf /opt/mysql/server-5.6/my.cnf
# chown -R root .
# chown -R mysql /var/lib/mysql
# cp support-files/mysql.server /etc/init.d/mysql
# alias mysql=/opt/mysql/server-5.6/bin/mysql
# alias mysqladmin=/opt/mysql/server-5.6/bin/mysqladmin

# service mysql start
# update-rc.d mysql defaults

我的.cnf

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
#
# * Basic Settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr/local/mysql
datadir     = /var/lib/mysql
tmpdir      = /tmp
lc-messages-dir = /opt/mysql/server-5.6/share/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 127.0.0.1
#
# * Fine Tuning
#
key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit   = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries   = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id      = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M
#binlog_do_db       = include_database_name
#binlog_ignore_db   = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer      = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

错误

130619 14:28:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2013-06-19 14:28:14 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-06-19 14:28:14 6582 [Warning] Using pre 5.5 semantics to load error messages from /opt/mysql/server-5.6/share/english/.
2013-06-19 14:28:14 6582 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2013-06-19 14:28:14 6582 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
2013-06-19 14:28:14 6582 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2013-06-19 14:28:14 6582 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-19 14:28:14 6582 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-06-19 14:28:14 6582 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-19 14:28:14 6582 [Note] InnoDB: Using Linux native AIO
2013-06-19 14:28:14 6582 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-19 14:28:14 6582 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-06-19 14:28:14 6582 [Note] InnoDB: Completed initialization of buffer pool
2013-06-19 14:28:14 6582 [Note] InnoDB: Highest supported file format is Barracuda.
2013-06-19 14:28:14 6582 [Note] InnoDB: 128 rollback segment(s) are active.
2013-06-19 14:28:14 6582 [Note] InnoDB: Waiting for purge to start
2013-06-19 14:28:14 6582 [Note] InnoDB: 5.6.12 started; log sequence number 1600637
2013-06-19 14:28:14 6582 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2013-06-19 14:28:14 6582 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2013-06-19 14:28:14 6582 [Note] Server socket created on IP: '127.0.0.1'.
2013-06-19 14:28:14 6582 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
130619 14:28:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
linux
  • 4 个回答
  • 22308 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