我们的部门完全基于 *nix,但不幸的是,我们所在的公司在 Windows 环境中运行,在我获得我们自己的服务器的预算之前,我必须在 Hyper-V 环境中运行我们的服务器。
我的 Wheezy VM 上的网络存在大量问题。从初始安装开始,在执行apt-get update
或时会出现解析主机名的随机问题apt-get install <package>
,我必须重复该过程几次才能成功完成。
root@gitlab:/home/git/gitlab# apt-get update
Err http://debian.mirror.ac.za wheezy Release.gpg
Something wicked happened resolving 'debian.mirror.ac.za:http' (-5 - No address associated with hostname)
Hit http://security.debian.org wheezy/updates Release.gpg
Hit http://packages.dotdeb.org wheezy Release.gpg
Hit http://security.debian.org wheezy/updates Release
Hit http://packages.dotdeb.org wheezy Release
Hit http://security.debian.org wheezy/updates/main Sources
Err http://debian.mirror.ac.za wheezy-updates Release.gpg
Something wicked happened resolving 'debian.mirror.ac.za:http' (-5 - No address associated with hostname)
Hit http://packages.dotdeb.org wheezy/all Sources
Hit http://security.debian.org wheezy/updates/main amd64 Packages
Hit http://packages.dotdeb.org wheezy/all amd64 Packages
Hit http://security.debian.org wheezy/updates/main Translation-en
Ign http://debian.mirror.ac.za wheezy Release
Ign http://debian.mirror.ac.za wheezy-updates Release
Ign http://debian.mirror.ac.za wheezy/main Sources/DiffIndex
Ign http://packages.dotdeb.org wheezy/all Translation-en
Ign http://debian.mirror.ac.za wheezy/main amd64 Packages/DiffIndex
Ign http://debian.mirror.ac.za wheezy-updates/main Sources/DiffIndex
Ign http://debian.mirror.ac.za wheezy-updates/main amd64 Packages/DiffIndex
Hit http://debian.mirror.ac.za wheezy-updates/main Translation-en
Hit http://debian.mirror.ac.za wheezy/main Sources
Hit http://debian.mirror.ac.za wheezy/main amd64 Packages
Hit http://debian.mirror.ac.za wheezy-updates/main Sources
Get:1 http://debian.mirror.ac.za wheezy-updates/main amd64 Packages [2905 B]
Ign http://debian.mirror.ac.za wheezy/main Translation-en
Fetched 2905 B in 4s (639 B/s)
W: Failed to fetch http://debian.mirror.ac.za/debian/dists/wheezy/Release.gpg Something wicked happened resolving 'debian.mirror.ac.za:http' (-5 - No address associated with hostname)
W: Failed to fetch http://debian.mirror.ac.za/debian/dists/wheezy-updates/Release.gpg Something wicked happened resolving 'debian.mirror.ac.za:http' (-5 - No address associated with hostname)
E: Some index files failed to download. They have been ignored, or old ones used instead.
不幸的是,今天我正在执行系统管理员操作并更新在此 VM 上运行的 Gitlab 实例,并且我无法bundle install
完成该过程,除非它在列表中的某个随机位置失败。
Fetching source index from https://rubygems.org/
Using rake (10.1.0)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using actionpack-action_caching (1.1.0)
Using actionpack-page_caching (1.0.2)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.2)
Using bundler (1.3.5)
Using thor (0.18.1)
Using railties (4.0.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.10.1)
Using sprockets-rails (2.0.1)
Using rails (4.0.2)
Using acts-as-taggable-on (2.4.1)
Using asciidoctor (0.1.4)
Using descendants_tracker (0.0.3)
Using ice_nine (0.10.0)
Using axiom-types (0.0.5)
Using bcrypt-ruby (3.1.2)
Using sass (3.2.12)
Using bootstrap-sass (3.0.3.0)
Using json (1.8.1)
Using carrierwave (0.9.0)
Using timers (1.1.0)
Using celluloid (0.15.2)
Using charlock_holmes (0.6.9.4)
Using coercible (1.0.0)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using coffee-rails (4.0.1)
Using colored (1.2)
Using connection_pool (1.2.0)
Using d3_rails (3.1.10)
Using orm_adapter (0.5.0)
Using warden (1.2.3)
Using devise (3.0.4)
Using devise-async (0.8.0)
Using diff-lcs (1.2.5)
Using dotenv (0.9.0)
Using email_validator (1.4.0)
Bundler::HTTPError: Network error while fetching https://s3.amazonaws.com/production.s3.rubygems.org/quick/Marshal.4.8/enumerize-0.7.0.gemspec.rz
An error occurred while installing enumerize (0.7.0), and Bundler cannot continue.
Make sure that `gem install enumerize -v '0.7.0'` succeeds before bundling.
需要指出的一点是,该问题仅限于此apt-get
之前,我已经设法升级了 Gitlab 实例几次。
我已经尝试使用旧式网络适配器和普通网络适配器,并检查 Hyper-V IC 模块是否已加载:
root@gitlab:/home/git/gitlab# lsmod | grep hv
hv_utils 12986 0
hv_storvsc 17423 2
hv_netvsc 18304 0
hv_vmbus 32029 4 hv_netvsc,hv_storvsc,hid_hyperv,hv_utils
scsi_mod 162269 5 libata,sr_mod,sg,hv_storvsc,sd_mod
我也将其设置/etc/resolve.conf
为我们的内部 DNS 服务器和 8.8.8.8/8.8.4.4,没有区别。
还有什么原因导致这种情况?我现在真的开始束手无策了。