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

Tim Stoop's questions

Martin Hope
Tim Stoop
Asked: 2021-01-18 23:16:05 +0800 CST

Systemd 计时器不会触发

  • 0

我在 Debian Buster 上有一个非常奇怪的问题。我已经在服务器上启用了无人值守升级,因为这是一个非常简单的服务器,它应该会自动更新。但是,似乎为此的 apt 计时器永远不会启动。

当我检查所有计时器时,我得到以下信息:

# systemctl list-timers
NEXT                         LEFT          LAST                         PASSED               UNIT                         ACTIVATES
Fri 2021-01-15 20:00:00 UTC  58min left    Fri 2021-01-15 19:00:00 UTC  1min 13s ago         logrotate.timer              logrotate.service
Sat 2021-01-16 00:00:00 UTC  4h 58min left Fri 2021-01-15 00:00:00 UTC  19h ago              man-db.timer                 man-db.service
Sat 2021-01-16 18:03:26 UTC  23h left      Fri 2021-01-15 18:03:26 UTC  57min ago            systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
n/a                          n/a           Thu 2020-11-26 06:15:45 UTC  1 months 20 days ago apt-daily-upgrade.timer      apt-daily-upgrade.service
n/a                          n/a           Wed 2020-11-25 20:32:27 UTC  1 months 20 days ago apt-daily.timer              apt-daily.service

当我检查计时器的定义时,它似乎很好:

# systemctl cat apt-daily.timer
# /lib/systemd/system/apt-daily.timer
[Unit]
Description=Daily apt download activities

[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target

并且分析似乎同意语法很好:

# systemd-analyze calendar "*-*-* 6,18:00"
  Original form: *-*-* 6,18:00
Normalized form: *-*-* 06,18:00:00
    Next elapse: Sat 2021-01-16 06:00:00 UTC
       From now: 10h left

但他们不开火。我尝试运行systemctl start apt-daily.timer,systemctl enable --now apt-daily.timer并且systemctl restart timers.target,没有效果。该命令返回没有错误,但没有任何变化。

我不知道如何进一步调试,任何提示将不胜感激。

编辑根据要求,apt-daily.service 单元的内容:

# /lib/systemd/system/apt-daily.service
[Unit]
Description=Daily apt download activities
Documentation=man:apt(8)
ConditionACPower=true
After=network.target network-online.target systemd-networkd.service NetworkManager.service connman.service

[Service]
Type=oneshot
ExecStartPre=-/usr/lib/apt/apt-helper wait-online
ExecStart=/usr/lib/apt/apt.systemd.daily update

编辑服务本身也没有被禁用,但它是dead:

# systemctl status apt-daily.service
● apt-daily.service - Daily apt download activities
   Loaded: loaded (/lib/systemd/system/apt-daily.service; static; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:apt(8)
debian systemd
  • 1 个回答
  • 256 Views
Martin Hope
Tim Stoop
Asked: 2019-01-22 03:15:22 +0800 CST

在 gcloud beta 计算实例 add-iam-policy-binding 上启用操作系统登录失败

  • 0

我正在尝试为实例启用操作系统登录。我已经设置了元数据os-login: TRUE并使用命令将我的公钥添加到我的帐户中gcloud compute os-login ssh-keys add。现在,我正在尝试将我的角色添加到实例中,如下所述:https ://cloud.google.com/compute/docs/instances/managing-instance-access#configure_users

但是,我遇到了命令问题,并且错误消息并没有让我清楚地知道出了什么问题。这是我的命令和输出:

$ gcloud beta compute instances add-iam-policy-binding tim-test --project='my-project' --zone='europe-west4-a' --member='user:[email protected]' --role=roles/compute.osAdminLogin
ERROR: (gcloud.beta.compute.instances.add-iam-policy-binding) HTTPError 400: Invalid value 'projects/packer-automation/zones/europe-west4-a/instances/tim-test'. Values must match the following regular expression: '[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}'

我究竟做错了什么?

google-compute-engine
  • 1 个回答
  • 374 Views
Martin Hope
Tim Stoop
Asked: 2017-04-13 08:37:27 +0800 CST

nodeAffinity 在 DaemonSets 中是如何工作的?

  • 3

我正在尝试创建一个具有特定亲和力的 DaemonSet,我希望它只在 type=prod 的节点上创建 Pod。我使用以下测试代码:

apiVersion:扩展/v1beta1
种类:守护程序集
元数据:
  名称:test0
  命名空间:kube 系统
规格:
  模板:
    元数据:
      标签:
        应用程序:test0
    规格:
      亲和力:
        节点亲和性:
          requiredDuringSchedulingIgnoredDuringExecution:
            节点选择器条款:
            - 匹配表达式:
              - 键:类型
                运营商:在
                价值观:
                - 产品
      容器:
      - 名称:test0
        图片:gcr.io/google_containers/pause:2.0

但是,kubectl 退出并出现以下错误:

error: error validating "test.yaml": error validating data: found invalid field affinity for v1.PodSpec; if you choose to ignore these errors, turn validation off with --validate=false

我不知道我在这里做错了什么。我也尝试将关联块放在模板块下,同样的错误。

不过,我应该注意到集群仍然是 Kubernetes 1.4.8。自 1.2 以来,Affinity 是 Kubernetes 的一部分,所以我认为这不是问题吗?

kubernetes
  • 2 个回答
  • 3369 Views
Martin Hope
Tim Stoop
Asked: 2015-10-29 03:07:30 +0800 CST

传递变量以在 Debian Jessie 安装的预种子文件中使用

  • 9

是否可以通过引导提示向 Debian 安装程序添加变量,以便可以在预置文件中使用该变量?

特别是,我正在尝试解决以下问题:

我们有一个相当广泛的安装后脚本,通常从服务器下载。但现在我想创建 Packer 映像并将安装后脚本与其他 Packer 文件一起保存在版本控制中。要访问 preseed,我可以在启动命令中执行“preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg”。但现在我希望安装程序从同一位置下载安装后脚本。

目前,安装后挂钩如下所示:

d-i preseed/late_command string wget -q -O /tmp/postinstall.sh http://our.public.server/postinstall.jessie.sh ; sh /tmp/postinstall.sh

理想情况下,我想做类似的事情:

d-i preseed/late_command string wget -q -O /tmp/postinstall.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/postinstall.jessie.sh ; sh /tmp/postinstall.sh

但当然 Debian 安装程序不会用所需的值替换那些。所以我在想有可能将类似环境变量的变量传递给我们可以在预种子文件中使用的安装程序。

任何提示或提示表示赞赏!

编辑:尝试将 late_command 添加到引导命令中,但没有被采纳。

编辑:尝试预置/运行,但它在不允许 in-target 命令的不同环境中运行。

编辑:这可能是一种解决方法:如何在 debian preseed 文件中将命令连接在一起?但我更愿意将脚本放在单独的文件中。但是,如果不可能,那也不可能。

debian
  • 3 个回答
  • 6087 Views
Martin Hope
Tim Stoop
Asked: 2015-07-27 13:45:28 +0800 CST

XtraBackup 还原在从属上提供重复项?

  • 0

我们最近将 MySQL 5.0 master-master setup 升级到 Percona 5.6。由于我们这边的一些故障,Slaving 变得 b0rken,但我们认为我们可以通过使用 xtrabackup 从正在运行的服务器创建备份并将其导入到 slave 来简单地修复它。我整个周末都在尝试这样做(部分原因是它是一个巨大的数据库,其中包含大量的数据库和表),但无济于事。有人可以阐明我在这里可能做错了什么吗?

首先,我在当前的生产主服务器上运行以下命令:

ulimit -n 409600 innobackupex --defaults-file=/etc/mysql/debian.cnf /mnt

完成后,我将生成的目录复制到另一台服务器并运行:

innobackupex --use-memory=4G --apply-log /srv/restore

它最终以 OK 消息退出。现在我将它恢复到数据库:

innobackupex --move-back /srv/restore

一切顺利,我可以再次启动 MySQL(在我 chown /srv/mysql 目录,这是我们的数据目录之后)。数据在那里,数据库运行良好。现在我开始在这个数据库上工作:

/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf -e "CHANGE MASTER TO MASTER_HOST='10.x.x.x', MASTER_USER='replication', MASTER_PASSWORD='verysecret', MASTER_AUTO_POSITION=1; START SLAVE"

从动开始但由于 1062 错误而立即停止。经过调查,我发现它尝试应用的条目是在我开始备份后立即添加到主数据库中的。我可以解决这个问题,但我立即收到一个新错误。

对我来说,备份似乎没有包含所有最新的 GTID,只有在备份开始时可用的那些?我认为这正是 XtraBackup 应该解决的问题?我现在看不到确保在备份期间不对数据库进行任何写入的替代方法。我在这里做错了吗?这应该发生吗?

在带有所有最新补丁的 Debian Wheezy 上运行。

Server version: 5.6.25-73.1-log Percona Server (GPL), Release 73.1, Revision 07b797f $ innobackupex --version InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved. $ xtrabackup --version xtrabackup version 2.2.11 based on MySQL server 5.6.24 Linux (x86_64) (revision id: )

mysql-replication
  • 1 个回答
  • 424 Views
Martin Hope
Tim Stoop
Asked: 2015-02-21 01:21:42 +0800 CST

自动安装 Debian Backports 内核

  • 8

我有以下固定设置:

Package: linux-image-amd64
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

我收到以下错误:

$ sudo apt-get install linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to   be installed
E: Unable to correct problems, you have held broken packages.

这些政策似乎是正确的:

$ apt-cache policy linux-image-amd64
linux-image-amd64:
  Installed: 3.2+46
  Candidate: 3.16+63~bpo70+1
  Package pin: 3.16+63~bpo70+1
  Version table:
     3.16+63~bpo70+1 1001
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages
 *** 3.2+46 1001
        500 http://ftp.nl.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy linux-image-3.16.0-0.bpo.4-amd64
linux-image-3.16.0-0.bpo.4-amd64:
  Installed: (none)
  Candidate: 3.16.7-ckt4-3~bpo70+1
  Version table:
     3.16.7-ckt4-3~bpo70+1 0
        499 http://ftp.nl.debian.org/debian/ wheezy-backports/main amd64 Packages

所以我没有得到错误。我究竟做错了什么?

我正在尝试使用 puppet 将所有 Wheezy 机器升级到 backports 内核(计划重新启动),这就是我想正确解决它的原因。我可以手动登录所有服务器运行:

sudo apt-get install -t wheezy-backports linux-image-amd64

哪个有效,但不那么方便。

更新

按照要求:

/etc/apt/preferences.d$ cat linux-image 
Package: linux-image-*
Pin: release a=wheezy-backports
Pin-Priority: 1001

Package: *
Pin: release a=wheezy-backports
Pin-Priority: 499

/etc/apt/preferences.d$ sudo apt-get update
Hit http://debian.kumina.nl wheezy-kumina Release.gpg
.
.
.
Reading package lists... Done
/etc/apt/preferences.d$ sudo apt-get install linux-image-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-image-amd64 : Depends: linux-image-3.16.0-0.bpo.4-amd64 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
/etc/apt/preferences.d$ aptitude why-not linux-image-3.16.0-0.bpo.4-amd64
Unable to find a reason to remove linux-image-3.16.0-0.bpo.4-amd64.
debian
  • 3 个回答
  • 8736 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