scalingexcellence / scrapybook

Scrapy Book Code
http://scrapybook.com/
480 stars 208 forks source link

Windows10 and vbox or vagrant #26

Closed johnscrapetest87 closed 7 years ago

johnscrapetest87 commented 7 years ago

Hello, Read the first part of the book, but chapters 3-5 are tough without running Vagrant. I have windows 10 on a lenovo laptop, all downlloads went ok but vagrant up still not working....was the windows 10 problem ever fixed ? Is there an easier method to run the book examples on my local machine without vagrant ?....thanks -John

lookfwd commented 7 years ago

Hello, yes - in general it works fine in Win 10. Let's do a TeamViewer session - it usually takes little time to fix. Contact me via e-mail to arrange a suitable time. Cheers!

johnscrapetest87 commented 7 years ago

Sorry, cannot, but would prefer tomorrow maybe 5 pm or 6 pm EST or later if that suits you. I really would like to get vagrant working so I can finish chapters 3,4,5,6.....I think the book is really great......I have intermediate Python skills but no vagrant or VM experience, big oracle,/ MySQL user as well.....

Machine, Lenovo laptop, 6GB ram bios updated, 64bit works on latest virtual box install....

Thanks, John

Sent from my iPhone

On Mar 27, 2017, at 8:03 PM, Dimitrios Kouzis-Loukas notifications@github.com wrote:

Nice! Would you like to connect now? If yes - send me session numbers etc in lookfwd@gmail.com

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

lookfwd commented 7 years ago

The laptop has a 2-core processor, so very good idea to use the 32-bit image. Everything worked well but just before it starts the VM it was giving the following error:

vagrant/util/is_port_open.rb:21:in `initialize': The requested
    address is not valid in its context. - connect(2) for
    "0.0.0.0" port 9312 (Errno::EADDRNOTAVAIL)
  from C:/HashiCorp/Vagrant/embedded/gems/gems/
    vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:21:in `new'
  ...
  from C:/HashiCorp/Vagrant/embedded/gems/gems/
    vagrant-1.9.3/lib/vagrant/util/is_port_open.rb:19:in `is_port_open?'

After some googling, it appears to be this. So all I had to do is to add the host_ip: "127.0.0.1", while starting the port-forwarding, as suggested in that thread.

The computer was also running MySQL on 3306 thus there was a conflict causing another error at VM load. I disabled port forwarding for MySQL. Here are the updated settings on Vagrantfile.32:

# Setting up ports
(
    [9200] +                      # ES
    #[6379] +                      # Redis
    #[3306] +                      # MySQL
    [9312] +                      # Web
    [6800] +                      # Scrapyd
[]).each do |port|
    config.vm.network "forwarded_port", host_ip: "127.0.0.1", guest: port, host: port
end

It all worked fine after that.