apt-cacher-ng を通じて elastic.co から Debian パッケージを入手してください。

apt-cacher-ng を通じて elastic.co から Debian パッケージを入手してください。

apt-cacher-ngを使用してElasticsearch、Kibana、およびLogstash用のパッケージをインポートしようとしましたが、成功しませんでした。このキャッシュサーバーは汎用プロキシとして機能しないので、PassThroughPattern: .*私にとっては良い考えではないようです。

書き換えルールを実行してみました/etc/apt-cacher-ng/acng.conf(httpからhttpsへの書き換えを参照)。

Remap-elastic: http://artifacts.elastic.co ; https://artifacts.elastic.co

クライアントの `/etc/apt/apt.conf.d/02proxy に次の行があります。

Acquire::http::Proxy "http://192.168.140.18:3142";

私が/etc/apt/sources.list.d/elastic-7.x.list持っている

deb http://artifacts.elastic.co/packages/7.x/apt stable main

apt updateクライアント側で結果を実行するとき

Err:4 http://artifacts.elastic.co/packages/7.x/apt stable InRelease
  Connection failed [IP: 192.168.140.18 3142]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease  Connection failed [IP: 192.168.140.18 3142]
W: Some index files failed to download. They have been ignored, or old ones used instead.

サーバーで、デバッグオプションが7に設定され、詳細が2に設定されている状態で、次のように入力します。/var/log/apt-cacher-ng/apt-cacher.err

Thu Jul  1 12:22:44 2021|Returning to last state, 6
Thu Jul  1 12:23:10 2021|fileitem::DoDelayedUnregAndCheck, nextRunTime now: 1625134998
Thu Jul  1 12:23:13 2021|Detected incoming connection from the TCP socket
Thu Jul  1 12:23:13 2021|Client name: 192.168.140.5
Thu Jul  1 12:23:13 2021|Decoded request URI: http://artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease
Thu Jul  1 12:23:13 2021|Processing new job, GET http://artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease HTTP/1.1
Thu Jul  1 12:23:15 2021|Outgoing connection for Connection timed outartifacts.elastic.co, Port: 443
Thu Jul  1 12:23:15 2021|Outgoing connection for Network is unreachableartifacts.elastic.co, Port: 443
Thu Jul  1 12:23:16 2021|tcpconnect::ExpireCache, nextRunTime now: 1625135005
Thu Jul  1 12:23:18 2021|fileitem::DoDelayedUnregAndCheck, nextRunTime now: 9223372036854775805
Thu Jul  1 12:23:25 2021|tcpconnect::ExpireCache, nextRunTime now: 9223372036854775805
Thu Jul  1 12:23:45 2021|Outgoing connection for Connection timed outartifacts.elastic.co, Port: 443
Thu Jul  1 12:23:45 2021|Outgoing connection for Network is unreachableartifacts.elastic.co, Port: 443

だから私はapt-cacher-ngの作者が好む方法を試しました。今回は、サーバーのelastic.coに対して特定の/etc/apt/sources.list.d/elastic-7.x.list書き換えを行わずにクライアントのファイルに書き直しました。

deb http://192.168.140.18:3142/HTTPS///artifacts.elastic.co/packages/7.x/apt stable main

apt updateクライアントで結果を実行する

Err:4 http://192.168.140.18:3142/HTTPS///artifacts.elastic.co/packages/7.x/apt stable InRelease
  Connection failed [IP: 192.168.140.18 3142]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://192.168.140.18:3142/HTTPS///artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease  Connection failed [IP: 192.168.140.18 3142]
W: Some index files failed to download. They have been ignored, or old ones used instead.

サーバーで/var/log/apt-cacher-ng/apt-cacher.errデバッグオプションを7に設定し、詳細を2に設定すると、次のような結果が得られます。

Thu Jul  1 11:40:39 2021|Returning to last state, 6
Thu Jul  1 11:40:39 2021|Decoded request URI: /HTTPS///artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease
Thu Jul  1 11:40:39 2021|Processing new job, GET /HTTPS///artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease HTTP/1.1
Thu Jul  1 11:41:09 2021|Detected incoming connection from the TCP socket
Thu Jul  1 11:41:09 2021|Client name: 192.168.140.5
Thu Jul  1 11:41:09 2021|Decoded request URI: /HTTPS///artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease
Thu Jul  1 11:41:09 2021|Processing new job, GET /HTTPS///artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease HTTP/1.1
Thu Jul  1 11:41:10 2021|Outgoing connection for Connection timed outartifacts.elastic.co, Port: 443
Thu Jul  1 11:41:10 2021|Outgoing connection for Network is unreachableartifacts.elastic.co, Port: 443
Thu Jul  1 11:41:40 2021|Outgoing connection for Connection timed outartifacts.elastic.co, Port: 443
Thu Jul  1 11:41:40 2021|Outgoing connection for Network is unreachableartifacts.elastic.co, Port: 443

DebugやVerbosityを除くファイルの他のすべてのオプションはデフォルトでacng.confあり、debianなどの一般的なリポジトリではうまく機能しますが、elasticまたはproxmoxでは機能しません。

すべてのアイデアを歓迎します。

ベストアンサー1

これは私にとってとても愚かなことです。

(起動しなければならない)コマンドラインを介してelastic.coサーバーからInReleaseファイルをダウンロードしようとしましたが、ブロックされていることがわかりました。

Proxmoxレベルでファイアウォールルールを調べると、ポート443が許可されていないことがわかります(デフォルトルールはブロックされています)。ポート 443 からのトラフィックを許可し、試みた最初のバージョンが正常に動作しました。

DNSでなければファイアウォールでしょうか?

おすすめ記事