AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

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

Mobile menu

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

问题[alpine](server)

Martin Hope
Mike W
Asked: 2023-08-17 04:17:29 +0800 CST

如何使用apk将Bazel安装到Alpine容器中

  • 5

我想使用 apk 将 Bazel(版本 5.1.1)安装到 Alpine 容器中。

我尝试了这个命令并得到了这个错误:

% apk add bazel=5.1.1
ERROR: unable to select packages:
  bazel (no such package):
    required by: world[bazel=5.1.1]

删除版本没有帮助...

% apk add bazel
ERROR: unable to select packages:
  bazel (no such package):
    required by: world[bazel]

在 apk 命令中添加“--no-cache”也没有帮助。

谁能解释错误的原因以及如何正确安装?

alpine
  • 1 个回答
  • 49 Views
Martin Hope
Vladimir Martsul
Asked: 2022-04-04 06:36:29 +0800 CST

Apline Linux 上 Bacula 的分段错误

  • 1

我正在尝试在 Apline Linux 上运行 Bacula(备份应用程序),并在通过bconsole连接到bacula-dir时出现分段错误。我尝试从另一台非 Alpine 服务器进行工作配置,从 Alpine latest-stable 和 Alpine edge 进行干净配置,但没有成功。

这正是带有回溯的错误输出

# /usr/sbin/bacula-dir -f -d 99 -m -T
bacula-dir: dird.c:219-0 Debug level = 99
Bacula interrupted by signal 11: Segmentation violation
Kaboom! bacula-dir, build-3-15-x86_64-dir got signal 11 - Segmentation violation at 03-Apr-2022 17:26:08. Attempting traceback.
Kaboom! exepath=/usr/sbin/
Calling: /usr/sbin/btraceback /usr/sbin/bacula-dir 2324 /var/lib/bacula
Segmentation fault
The btraceback call returned 139
LockDump: /var/lib/bacula/bacula.2324.traceback

 ==== Traceback output ====

[New LWP 2325]
[New LWP 2326]
[New LWP 2329]
0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
#2  0x00007fe3ebce4b84 in ?? () from /lib/ld-musl-x86_64.so.1
#3  0x0000000000000000 in ?? ()

Thread 4 (LWP 2329 "bacula-dir"):
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
#2  0x00007fe3eb5a6b74 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 3 (LWP 2326 "bacula-dir"):
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
#2  0x00007fe3eb5cdb74 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 2 (LWP 2325 "bacula-dir"):
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
#2  0x00007fe3eb5f0b74 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 1 (LWP 2324 "bacula-dir"):
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
#2  0x00007fe3ebce4b84 in ?? () from /lib/ld-musl-x86_64.so.1
#3  0x0000000000000000 in ?? ()
#0  0x00007fe3ebca3413 in ?? () from /lib/ld-musl-x86_64.so.1
No symbol table info available.
#1  0x00007fe3ebca072d in ?? () from /lib/ld-musl-x86_64.so.1
No symbol table info available.
#2  0x00007fe3ebce4b84 in ?? () from /lib/ld-musl-x86_64.so.1
No symbol table info available.
#3  0x0000000000000000 in ?? ()
No symbol table info available.
[Inferior 1 (process 2324) detached]
Attempt to dump current JCRs. njcrs=1
threadid=0x7fe3ebce4b48 JobId=0 JobStatus=R jcr=0x7fe3eb608318 name=*JobMonitor*.2022-04-03_17.26.05_01
        use_count=1 killable=0
        JobType=I JobLevel=
        sched_time=03-Apr-2022 17:26 start_time=03-Apr-2022 17:26
        end_time=01-Jan-1970 03:00 wait_time=01-Jan-1970 03:00
        db=0 db_batch=0 batch_started=0
        wstore=0x7fe3ebc04c58 rstore=0 wjcr=0 client=0x7fe3ebc04ac8 reschedule_count=0 SD_msg_chan_started=0
List plugins. Hook count=0
 ==== End traceback output ====

Segmentation fault
linux bacula alpine segmentation-fault
  • 1 个回答
  • 44 Views
Martin Hope
henriquehbr
Asked: 2022-03-08 07:45:38 +0800 CST

SSH 服务器拒绝来自同一个客户端的多个连接

  • 0

我有一个在 Alpine Linux 3.15 Docker 容器中运行的简单 openssh 服务器和一个客户端,它也运行在另一个 Docker 容器(服务器的 Alpine 版本相同)上,该容器运行带有 dwm 的 X 服务器

客户端能够通过从服务器到客户端显示的 X11 转发打开图形应用程序( ),问题是在收到以下错误之前st我只能打开单个实例:st

ssh: connect to host 172.17.0.2 port 22: Connection refused

服务器端日志:

Starting session: command on pts/1 for client from 172.17.0.3 port 34060 id 0
debug1: Setting controlling tty using TIOCSCTTY.
debug1: X11 connection requested.
debug1: channel 3: new [X11 connection from 172.17.0.2 port 35028]
debug1: Received SIGCHLD.
debug1: session_by_pid: pid 9
debug1: session_exit_message: session 0 channel 0 pid 9
debug1: session_exit_message: release channel 0
debug1: session_by_tty: session 0 tty /dev/pts/1
debug1: session_pty_cleanup2: session 0 release /dev/pts/1
debug1: channel 3: free: X11 connection from 172.17.0.2 port 35028, nchannels 4
debug1: session_by_channel: session 0 channel 0
debug1: session_close_by_channel: channel 0 child 0
debug1: session_close_x11: detach x11 channel 1
debug1: session_close_x11: detach x11 channel 2
Close session: user client from 172.17.0.3 port 34060 id 0
debug1: channel 0: free: server-session, nchannels 3
debug1: channel 1: free: X11 inet listener, nchannels 2
debug1: channel 2: free: X11 inet listener, nchannels 1
Received disconnect from 172.17.0.3 port 34060:11: disconnected by user
Disconnected from user client 172.17.0.3 port 34060
debug1: do_cleanup
debug1: do_cleanup

客户端日志:

Running /usr/bin/xauth remove ssh:10.0
/usr/bin/xauth add ssh:10.0 MIT-MAGIC-COOKIE-1 49907415ff518044198f6f0075f270fe
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 172.17.0.2 35028
debug1: channel 1: new [x11]
debug1: confirm x11
OpenSSH_8.8p1, OpenSSL 1.1.1l  24 Aug 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to 172.17.0.2 [172.17.0.2] port 22.
debug1: connect to address 172.17.0.2 port 22: Connection refused
ssh: connect to host 172.17.0.2 port 22: Connection refused
xinit: connection to X server lost

waiting for X server to shut down debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 1: free: x11, nchannels 2
X connection to ssh:10.0 broken (explicit kill or server shutdown).
debug1: channel 0: free: client-session, nchannels 1
Connection to 172.17.0.2 closed.
Transferred: sent 91292, received 92728 bytes, in 3.1 seconds
Bytes per second: sent 29350.8, received 29812.5
debug1: Exit status 1
(II) Server terminated successfully (0). Closing log file.

deallocvt: can't open console
linux ssh x11 docker alpine
  • 1 个回答
  • 132 Views
Martin Hope
cyanat
Asked: 2021-11-30 15:16:37 +0800 CST

Alpine 上的 Wireguard:启动后自动挂载 wg0

  • 2

我在 Alpine 服务器上安装了一个wireguard。它正在工作,但是当我重新启动服务器时,我必须手动执行 wg-quick up wg0

wireguard:~# wg show
wireguard:~# wg-quick up wg0
[#]
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.6.6.1/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] ip -6 route add fd9f:6666::1/128 dev wg0
[#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
wireguard:~# wg show
interface: wg0
  public key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
  private key: (hidden)
  listening port: 51820

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
  preshared key: (hidden)
  endpoint: xx.xx.xx.xx:49323
  allowed ips: fd9f:6666::1/128, 10.6.6.2/32
  latest handshake: 2 seconds ago
  transfer: 7.05 KiB received, 6.31 KiB sent
wireguard:~#

我已经应用了这个文档:https ://wiki.alpinelinux.org/wiki/Configure_a_Wireguard_interface_(wg)#Bringing_up_an_interface_using_wg-tools

wireguard:~# cat /etc/modules
af_packet
ipv6
wireguard
wireguard:~# cat /etc/wireguard/wg0.conf
# Updated: 2021-11-29 22:52:22.801259882 +0000 UTC / Created: 2021-11-29 19:52:59.17510794 +0000 UTC
[Interface]
Address = 10.6.6.1/24
ListenPort = 51820
PrivateKey = xxxxxxxxxxxxx=

PreUp =
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PreDown =
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
...

我的错误在哪里?

wireguard alpine
  • 2 个回答
  • 632 Views
Martin Hope
lepe
Asked: 2021-10-16 02:45:15 +0800 CST

PHP5 到 PHP7 意外增加容器内的内存使用量

  • 0

上周我们更新了几个 wordpress 站点,这些站点通过 LXD 将 Alpine Linux 作为主机(Ubuntu 20.04)中的容器运行。

更新摘要如下:

Alpine Linux v3.8 -> 3.14
PHP 5.3.6 -> 7.4.24
Wordpress 5.0.3 -> 5.7.3

问题

在这些更新之后,我们开始遇到服务器性能问题,我们发现更新后的容器使用的内存(常驻内存)是旧容器的 3 倍或更多(大约 150MB 对 50MB),这导致服务器开始更频繁地交换。

在旧版本中(使用 PHP 5.3),php(进程)使用的内存会随着页面的处理(如预期的那样)增加,但在它完成后,它会恢复正常。换句话说,类似于:10MB---> 95MB---> 10MB。

在更新的容器中,所使用的内存php以相同的方式增加,但不会恢复到“正常”:10MB---> 95MB---> 95MB。每次使用新进程时,都会发生同样的情况,通过可用子进程的数量(在本例中为每个站点 4 个)增加内存使用量。

我试过的

  • 将 PHP 版本降级到7.2.x和7.3.x:同样的事情
  • 更新为php 8.0.11:同样的问题
  • 使用apache2而不是lighttpd(当前 php 作为 fcgi 运行):相同的行为
  • 仅更新 Alpine 和 PHP 以确定 Wordpress 是否可能是原因:wordpress 不是原因
  • 在没有插件的情况下运行 wordpress(以了解某些插件是否可能导致问题):没有变化
  • 执行了一个简单的连接循环(纯 php):同样的事情
  • 在具有不同 wordpress 站点的不同服务器中测试:相同的行为

它没有恢复内存的原因是什么?如何修复?

更新

  • 我设置了一个干净的Alpine 3.14容器并执行了“简单循环”测试。在这种情况下,常驻内存按预期减少了。但是,一旦我使用实际的 wordpress 站点进行测试,问题仍然存在。
  • 我设置了一个干净的Ubuntu 20.04容器并进行了相同的测试。结果与 clean 相同Alpine 3.14。
linux alpine memory-usage php7 garbage-collecting
  • 1 个回答
  • 124 Views
Martin Hope
iomv
Asked: 2021-08-06 06:27:18 +0800 CST

尾命令重试标志不适用于通配符?

  • 2

我想跟踪一堆包含特定不存在文件的未知目录名称,例如:

tail -F /tmp/*/app.log

但是,通配符不能按预期工作:如果我使用该路径创建文件,tail除非我重新启动命令,否则不会开始跟踪。另一方面,如果我运行:

tail -F /tmp/example/app.log

文件一出现,命令就会输出:tail: '/tmp/example/app.log' has appeared; following new file

我已经尝试过-f filename --retry组合而不是-F结果是一样的。

如何解决这个问题,还有其他方法可以实现相同的目标吗?

ubuntu tail alpine
  • 1 个回答
  • 207 Views
Martin Hope
Christian
Asked: 2021-07-29 23:46:40 +0800 CST

带有 Tap 接口的 QEMU VM 可以看到所有包来自管理程序而不是真实源 IP

  • 0

我已经使用 Alpine Linux 设置了一个非常简单的 Hypervisor,我的 VM 看到所有流量都来自 hypervisor 的 IP。

这也意味着如果 fail2ban 试图阻止攻击,它总是会阻止虚拟机管理程序 IP

如何让 VM 看到真实的 IP 地址,而不仅仅是管理程序的 IP?

接口设置

在 HV ( 192.168.5.5) 上,我有一个br0工作正常的桥接接口

# tun1 setup script on Hypervisor
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
iptables -P FORWARD ACCEPT
ip tuntap add dev tap1 mode tap user root
ip link set dev tap1 up
ip link set tap1 master br0

qemu-system-x86_64 [..non related parameters removed ..] \
-device virtio-net-pci,netdev=network0,mac=02:1f:ba:26:d7:56 \
-netdev tap,id=network0,ifname=tap1,script=no,downscript=no

VM 可以访问 Internet,但它看到的所有流量都来自管理程序的 IP。

虚拟机只看到 HV IP

有人甚至试图使用我的服务器进行 DNS 放大攻击(尽管在我的 PFSense 防火墙上阻止了传出) DNS放大攻击

Fail2ban 也阻止了错误的 IP 显示阻塞的 HV ip 的 fail2ban 日志

kvm-virtualization tcpdump alpine qemu tun
  • 1 个回答
  • 379 Views
Martin Hope
Sergio D
Asked: 2021-05-22 12:21:50 +0800 CST

RTNETLINK 回答:高山路由器中存在文件

  • 0

我已经知道这个问题可能已经在这里提出了,但我无法在那里解决这个问题,如果我做得不好或其他什么,我问我自己的情况,对不起,如果我的英语不好,但在这里

这就是我拥有 /etc/network/interfaces 内容的方式

图片

出于某种原因,当我在 eth1 中执行 ifup 时,它会检索 RTNETLINK 答案:文件存在,但奇怪的是:

它只发生在 up ip route add 192.168.1.0 ... 192.168.100.101 ...

但如果我注释 192.168.1.0 行并取消注释 192.168.2.0、192.168.3.0 和下面的任何其他行...

这行得通,一切正常,我的虚拟机与路由器和互联网连接良好,但这不是我需要的,因为我的所有虚拟机都使用 192.168.1.... ip`s,现在无法更改,所以我需要这条路线是 192.168.1,好吧,我有上述错误消息

总而言之,感谢阅读,我还在学习,所以这可能是一个问题,我如何配置任何东西,但无法想象如果有人知道可能是什么或如何解决这个问题会发生什么,我很高兴阅读

router linux routing networking alpine
  • 1 个回答
  • 617 Views
Martin Hope
markson edwardson
Asked: 2021-04-03 21:06:56 +0800 CST

ufw 防火墙在 Alpine Linux 中应该从什么运行级别开始?

  • 1

我ufw在 Alpine linux 上使用。

我已经以非常标准的方式对其进行了配置:

apk add --no-cache ufw
ufw allow ssh
ufw allow http
ufw allow https
ufw limit ssh
ufw enable
rc-update add ufw default

但我不确定我是否应该将它的运行级别设置为,boot所以我确定它在任何其他服务(ssh 和 docker(以及 http/https 服务)都设置为开始于default)之前启动。

有关系吗?我不相信 alpine 的 RC 系统具有像您在systemd.

firewall alpine ufw runlevel
  • 1 个回答
  • 563 Views
Martin Hope
amateur barista
Asked: 2021-03-10 04:16:22 +0800 CST

Git、WSL2、SSH:读取边带数据包时意外断开连接

  • 4

尝试使用 SSH 克隆远程 Git 存储库时,出现以下错误:

git clone user@remote-repo:project.git .
remote: Counting objects: 187444, done.
remote: Compressing objects: 100% (73430/73430), done.
client_loop: send disconnect: Broken pipe.06 MiB | 4.04 MiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed

我的环境具有以下规格:

  • WSL2(Windows 子系统 4 Linux)
  • git --version git version 2.30.1

git 包可以在这里找到https://pkgs.alpinelinux.org/package/edge/main/x86_64/git

uname -a
Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 Linux

2021-03-09-07:11AM wsl@Alpine:~$ more /etc/issue
Welcome to Alpine Linux 3.10
Kernel \r on an \m (\l)

我不知道为什么会这样。是 Alpine 上的突发问题还是内核配置问题?WSL?我怀疑它是远程主机。远程主机适用于 SSH,也适用于每个非 WSL 用户的克隆。

linux ssh git alpine windows-subsystem-for-linux
  • 4 个回答
  • 14722 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