下記サイトを参考に進めております。
現在Ansibleの学習を進めており、環境構築の導入の部分でつまづいています。
長文でもうしわけないでエラー内容とVagrantfileを記載いたします。
質問としては、下記Vagrantfile
の内容でupするとport8000は使用中といったエラーを返されてしまいます。
一応VirtualBoxを立ち上げて他に立ち上がっているのがないか確認もしました。
この場合のport8000エラーはどうすればいいでしょうか?
随時試したことは追記していくつもりです。
よろしくお願いします。
bash
1$ vagrant up 2 3#エラー内容 4Vagrant cannot forward the specified ports on this VM, since they 5would collide with some other application that is already listening 6on these ports. The forwarded port to 8000 is already in use 7on the host machine. 8 9To fix this, modify your current project's Vagrantfile to use another 10port. Example, where '1234' would be replaced by a unique host port: 11 12 config.vm.network :forwarded_port, guest: 80, host: 1234 13 14Sometimes, Vagrant will attempt to auto-correct this for you. In this 15case, Vagrant was unable to. This is usually because the guest machine 16is in a state which doesn't allow modifying port forwarding. You could 17try 'vagrant reload' (equivalent of running a halt followed by an up) 18so vagrant can attempt to auto-correct this upon booting. Be warned 19that any unsaved work might be lost. 20~/Google ドライブ/FELICA/Owlcamp/Ansible/
Vagrantfile
bash
1# -*- mode: ruby -*- 2# vi: set ft=ruby : 3 4# All Vagrant configuration is done below. The "2" in Vagrant.configure 5# configures the configuration version (we support older styles for 6# backwards compatibility). Please don't change it unless you know what 7# you're doing. 8Vagrant.configure("2") do |config| 9 10 config.vm.define :node1 do |node| 11 node.vm.box = "bento/centos-7.3" 12 node.vm.network :forwarded_port, guest: 22, host: 2001, id: "ssh" 13 node.vm.network :private_network, ip: "192.168.33.11" 14 end 15 16 config.vm.define :node2 do |node| 17 node.vm.box = "bento/centos-7.3" 18 node.vm.network :forwarded_port, guest: 22, host: 2002, id: "ssh" 19 node.vm.network :forwarded_port, guest: 80, host: 8000, id: "http" 20 node.vm.network :private_network, ip: "192.168.33.12" 21 end 22 # The most common configuration options are documented and commented below. 23 # For a complete reference, please see the online documentation at 24 # https://docs.vagrantup.com. 25 26 # Every Vagrant development environment requires a box. You can search for 27 # boxes at https://vagrantcloud.com/search. 28 config.vm.box = "bento/centos-7.3" 29 30 # Disable automatic box update checking. If you disable this, then 31 # boxes will only be checked for updates when the user runs 32 # `vagrant box outdated`. This is not recommended. 33 # config.vm.box_check_update = false 34 35 # Create a forwarded port mapping which allows access to a specific port 36 # within the machine from a port on the host machine. In the example below, 37 # accessing "localhost:8080" will access port 80 on the guest machine. 38 # NOTE: This will enable public access to the opened port 39 # config.vm.network "forwarded_port", guest: 80, host: 8080 40 41 # Create a forwarded port mapping which allows access to a specific port 42 # within the machine from a port on the host machine and only allow access 43 # via 127.0.0.1 to disable public access 44 # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" 45 46 # Create a private network, which allows host-only access to the machine 47 # using a specific IP. 48 config.vm.network "private_network", ip: "192.168.33.10" 49 50 # Create a public network, which generally matched to bridged network. 51 # Bridged networks make the machine appear as another physical device on 52 # your network. 53 # config.vm.network "public_network" 54 55 # Share an additional folder to the guest VM. The first argument is 56 # the path on the host to the actual folder. The second argument is 57 # the path on the guest to mount the folder. And the optional third 58 # argument is a set of non-required options. 59 # config.vm.synced_folder "../data", "/vagrant_data" 60 61 # Provider-specific configuration so you can fine-tune various 62 # backing providers for Vagrant. These expose provider-specific options. 63 # Example for VirtualBox: 64 # 65 # config.vm.provider "virtualbox" do |vb| 66 # # Display the VirtualBox GUI when booting the machine 67 # vb.gui = true 68 # 69 # # Customize the amount of memory on the VM: 70 # vb.memory = "1024" 71 # end 72 # 73 # View the documentation for the provider you are using for more 74 # information on available options. 75 76 # Enable provisioning with a shell script. Additional provisioners such as 77 # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 78 # documentation for more information about their specific syntax and use. 79 # config.vm.provision "shell", inline: <<-SHELL 80 # apt-get update 81 # apt-get install -y apache2 82 # SHELL 83end 84
8/15追記
bash
1$ sudo netstat -an | grep LISTEN 2 3tcp4 0 0 *.2001 *.* LISTEN 4tcp46 0 0 *.1110 *.* LISTEN 5tcp4 0 0 *.1110 *.* LISTEN 6tcp4 0 0 127.0.0.1.9999 *.* LISTEN 7tcp4 0 0 127.0.0.1.17603 *.* LISTEN 8tcp4 0 0 127.0.0.1.17600 *.* LISTEN 9tcp4 0 0 *.17500 *.* LISTEN 10tcp6 0 0 *.17500 *.* LISTEN 11tcp4 0 0 127.0.0.1.15292 *.* LISTEN 12 13$ ps -ef | grep vagrant 14501 42324 41619 0 9:55PM ttys000 0:00.00 grep vagrant
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/15 11:58
2017/08/15 12:41
2017/08/15 12:57
2017/08/15 13:20
2017/08/15 13:38