之間的連接我有簡單的無業遊民多機配置:流浪多機 - 機
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.provision :shell, path: "vagrant/ubuntu-16.04/provision.sh"
config.vm.synced_folder "ed", "/var/www/html"
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
config.vm.define "node1", primary: true do |node|
node.vm.hostname = 'node1'
node.vm.network :private_network, ip: "192.168.56.101"
node.vm.network :forwarded_port, guest: 22, host: 10122, id: "ssh"
node.vm.provision :hosts, :sync_hosts => true
end
config.vm.define "node2" do |node|
node.vm.hostname = "node2"
node.vm.network :private_network, ip: "192.168.56.102"
node.vm.network :forwarded_port, guest: 22, host: 10123, id: "ssh"
node.vm.provision :hosts, :sync_hosts => true
end
end
在node1
我有PHP和node2
我有elasticsearch。
當我運行curl localhost:9200
從[email protected]
它的工作原理,
但當我嘗試從[email protected]
運行curl 192.168.56.102:9200
它不會工作,我得到錯誤:
curl: (7) Failed to connect to 192.168.56.102 port 9200: Connection refused
是在192.168.56.102的防火牆中打開的端口9200? – NangSaigon
@NangSaigon我怎麼檢查它? –
@NangSaigon我跑了'netstat -anp | grep LISTEN | grep 9200'並收到'tcp6 0 0 127.0.0.1:9200 ::: * LISTEN -' 'tcp6 0 0 :: 1:9200 ::: * LISTEN -' –