Может запустить окно Oracle Database Vagrant в первый раз, но не может восстановить его - PullRequest
0 голосов
/ 11 июля 2019

Я использую vagrant и virtualbox, пытаюсь установить бродячее окно базы данных oracle 19.3. Когда я впервые поднимаю окно с vagrant up, это занимает некоторое время, но он копирует базу данных (используя существующие данные) и все настраивает. Если мне нужно перезагрузить машину, я возвращаю ее обратно с vagrant up. Я получаю это:

 ==> oracle-19c-vagrant: Forwarding ports...
        oracle-19c-vagrant: 1521 (guest) => 1521 (host) (adapter 1)
        oracle-19c-vagrant: 5500 (guest) => 5500 (host) (adapter 1)
        oracle-19c-vagrant: 22 (guest) => 2222 (host) (adapter 1)
    ==> oracle-19c-vagrant: Running 'pre-boot' VM customizations...
    ==> oracle-19c-vagrant: Booting VM...
    ==> oracle-19c-vagrant: Waiting for machine to boot. This may take a few minutes...
        oracle-19c-vagrant: SSH address: 127.0.0.1:2222
        oracle-19c-vagrant: SSH username: vagrant
        oracle-19c-vagrant: SSH auth method: private key
    ==> oracle-19c-vagrant: Machine booted and ready!
    ==> oracle-19c-vagrant: Checking for guest additions in VM...
    ==> oracle-19c-vagrant: Setting hostname...
    ==> oracle-19c-vagrant: Configuring proxy environment variables...
    ==> oracle-19c-vagrant: Configuring proxy for Yum...
    ==> oracle-19c-vagrant: Mounting shared folders...
        oracle-19c-vagrant: /vagrant => C:/Users/Matt/Documents/vagrant-boxes/OracleDatabase/19.3.0
==> oracle-19c-vagrant: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> oracle-19c-vagrant: flag to force provisioning. Provisioners marked to run always will still run.

Когда я пытаюсь подключиться к базе данных, я получаю эту ошибку:

An existing connection was forcibly closed by the remote host, Authentication lapse 0 ms. 

Единственный способ заставить его работать снова - это бродячее разрушение и снова бродяга, что занимает много времени. Есть идеи? Ниже мой бродячий файл.

#
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
# 
# Since: July, 2018
# Author: gerald.venzl@oracle.com
# Description: Creates an Oracle database Vagrant virtual machine.
# 
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
# 

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

# define hostname
NAME = "oracle-19c-vagrant"

unless Vagrant.has_plugin?("vagrant-proxyconf")
  puts 'Installing vagrant-proxyconf Plugin...'
  system('vagrant plugin install vagrant-proxyconf')
end

# get host time zone for setting VM time zone, if possible
# can override in env section below
offset_sec = Time.now.gmt_offset
if (offset_sec % (60 * 60)) == 0
  offset_hr = ((offset_sec / 60) / 60)
  timezone_suffix = offset_hr >= 0 ? "-#{offset_hr.to_s}" : "+#{(-offset_hr).to_s}"
  SYSTEM_TIMEZONE = 'Etc/GMT' + timezone_suffix
else
  # if host time zone isn't an integer hour offset, fall back to UTC
  SYSTEM_TIMEZONE = 'UTC'
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ol7-latest"
  config.vm.box_url = "https://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box"
  config.vm.define NAME

  config.vm.box_check_update = false

  # change memory size
  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
    v.name = NAME
  end

  # add proxy configuration from host env - optional
  if Vagrant.has_plugin?("vagrant-proxyconf")
    puts "getting Proxy Configuration from Host..."
    if ENV["http_proxy"]
      puts "http_proxy: " + ENV["http_proxy"]
      config.proxy.http     = ENV["http_proxy"]
    end
    if ENV["https_proxy"]
      puts "https_proxy: " + ENV["https_proxy"]
      config.proxy.https    = ENV["https_proxy"]
    end
    if ENV["no_proxy"]
      config.proxy.no_proxy = ENV["no_proxy"]
    end
  end

  # VM hostname
  config.vm.hostname = NAME

  # Oracle port forwarding
  config.vm.network "forwarded_port", guest: 1521, host: 1521
  config.vm.network "forwarded_port", guest: 5500, host: 5500


  # Provision everything on the first run
  config.vm.provision "shell", path: "scripts/install.sh", env:
    {
       "ORACLE_BASE"         => "/opt/oracle",
       "ORACLE_HOME"         => "/opt/oracle/product/19c/dbhome_1",
       "ORACLE_SID"          => "ORCLCDB",
       "ORACLE_PDB"          => "ORCLPDB1",
       "ORACLE_CHARACTERSET" => "AL32UTF8",
       "ORACLE_EDITION"      => "EE",
       "SYSTEM_TIMEZONE"     => SYSTEM_TIMEZONE
    }

end
...