2016-04-05 6 views
-1

Ich habe PSequel installiert und möchte damit meine PG-Datenbank in einer GUI meiner Vagrant-VM für meine Rails-App anzeigen.Zugriff auf die Postgres-Datenbank auf der Vagrant-Box mit der GUI

Ich habe es wie im Bild unten konfiguriert, kann aber nicht, es zu verbinden.

enter image description here

Der Fehler PSequel gibt mir sind:

OpenSSH_6.9p1, LibreSSL 2.1.8 
debug1: Reading configuration data /Users/neil/.ssh/config 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug1: Connecting to localhost [127.0.0.1] port 22. 
debug1: connect to address 127.0.0.1 port 22: Connection refused 
debug1: Connecting to localhost [::1] port 22. 
debug1: connect to address ::1 port 22: Connection refused 
ssh: connect to host localhost port 22: Connection refused 

Wer weiß, wo ich falsch gehe?

Mein Vagrantfile:

VAGRANTFILE_API_VERSION = "2" 

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    # Every Vagrant virtual environment requires a box to build off of. 
    config.vm.box = "precise64" 

    # Set the hostname to the project here for easy identification 
    config.vm.hostname = "ntsite" 

    # The url from where the 'config.vm.box' box will be fetched if it 
    # doesn't already exist on the user's system. 
    config.vm.box_url = "http://files.vagrantup.com/precise64.box" 

    # Create a forwarded port mapping which allows access to a specific port 
    # within the machine from a port on the host machine. In the example below, 
    # accessing "localhost:8080" will access port 80 on the guest machine. 
    config.vm.network :forwarded_port, guest: 80, host: 8080 

    # Forward rails server port 3000 
    config.vm.network :forwarded_port, guest: 3000, host: 3000 

    # Forward elasticsearch server port 9200 
    config.vm.network :forwarded_port, guest: 9200, host: 9200 

    # If true, then any SSH connections made will enable agent forwarding. 
    config.ssh.forward_agent = true 

    config.ssh.keep_alive = true 

    config.vm.provider :virtualbox do |vb| 
    vb.memory = 512 
    vb.cpus = 1 
    end 

    # config.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" 

    config.vm.synced_folder "./src", "/vagrant/src", type: "rsync", mount_options: ["dmode=777","fmode=766"], rsync__auto: true, disabled: false 

    # Required for NFS to work, pick any local IP 
    # config.vm.network :private_network, ip: '192.168.50.50' 

    # Use NFS for shared folders for better performance 
    # config.vm.synced_folder "./src", "/vagrant/src", nfs: true 


    # Enable provisioning with Ansible, specifying the location of the playbook. 
    config.vm.provision "ansible" do |ansible| 
     ansible.playbook = "devbox/vagrant.yml" 
     # ansible.verbose = 'vv' 
    end 
end 

Der Ausgang des laufenden vagrant up:

Bringing machine 'default' up with 'virtualbox' provider... 
==> default: Clearing any previously set forwarded ports... 
==> default: Clearing any previously set network interfaces... 
==> default: Preparing network interfaces based on configuration... 
    default: Adapter 1: nat 
==> default: Forwarding ports... 
    default: 80 => 8080 (adapter 1) 
    default: 3000 => 3000 (adapter 1) 
    default: 9200 => 9200 (adapter 1) 
    default: 22 => 2222 (adapter 1) 
==> default: Running 'pre-boot' VM customizations... 
==> default: Booting VM... 
==> default: Waiting for machine to boot. This may take a few minutes... 
    default: SSH address: 127.0.0.1:2222 
    default: SSH username: vagrant 
    default: SSH auth method: private key 
    default: Warning: Connection timeout. Retrying... 
==> default: Machine booted and ready! 
GuestAdditions 5.0.16 running --- OK. 
==> default: Checking for guest additions in VM... 
==> default: Setting hostname... 
==> default: Rsyncing folder: /Volumes/Storage1/Code/ntsite/src/ => /vagrant/src 
==> default: Mounting shared folders... 
    default: /vagrant => /Volumes/Storage1/Code/ntsite 
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` 
==> default: flag to force provisioning. Provisioners marked to run always will still run. 
+0

Ihre vagabundierende Box ist wahrscheinlich nicht 'localhost'. Wenn der SSH-Port an localhost weitergeleitet wird, sicherlich an anderen Port. Wie verbinden Sie sich mit Landstreicher? – Jakuje

+0

Normalerweise navigiere ich einfach zu dem Verzeichnis, in dem meine Vagrant-Datei ist und führe Vagrant Up gefolgt von Vagrant SSH und es meldet mich an. Ich greife dann auf meine Rails-App zu, indem ich in meinem Browser zu localhost: 3000 gehe? – rctneil

+0

Bitte posten Sie die Ausgabe des 'vagrant up' Befehls sowie den Inhalt Ihrer' Vagrantfile' –

Antwort

0

Sie müssen möglicherweise Postgresql sagen, an externe Adressen (Link auf, wie diese here zu tun) zu hören.

Verwandte Themen