teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

指摘内容の対応

2020/06/03 08:52

投稿

larachan
larachan

スコア28

title CHANGED
File without changes
body CHANGED
@@ -204,4 +204,8 @@
204
204
 
205
205
  end
206
206
 
207
+ 現状、仮想マシン(DBサーバー)にprivateIpを振って、仮想マシン(APサーバー)と仮想マシン(DBサーバー)間でのpingの疎通確認ができました。
208
+ エラー内容も変更にあったので、仮想マシン間での疎通は出来てそうです。
209
+
210
+
207
211
  ```

2

修正依頼対応

2020/06/03 08:52

投稿

larachan
larachan

スコア28

title CHANGED
File without changes
body CHANGED
@@ -20,4 +20,188 @@
20
20
 
21
21
  virtual box間のネットワークの設定でしょうか?
22
22
 
23
- 分かる方教えて下さい。
23
+ 分かる方教えて下さい。
24
+
25
+ 修正依頼内容
26
+ バージョン
27
+ ```ここに言語を入力
28
+ $ vagrant --version
29
+ Vagrant 2.2.9
30
+ ```
31
+ centOSのVagrantfile
32
+ ```ここに言語を入力
33
+ # -*- mode: ruby -*-
34
+ # vi: set ft=ruby :
35
+
36
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
37
+ # configures the configuration version (we support older styles for
38
+ # backwards compatibility). Please don't change it unless you know what
39
+ # you're doing.
40
+ Vagrant.configure("2") do |config|
41
+ # The most common configuration options are documented and commented below.
42
+ # For a complete reference, please see the online documentation at
43
+ # https://docs.vagrantup.com.
44
+
45
+ # Every Vagrant development environment requires a box. You can search for
46
+ # boxes at https://vagrantcloud.com/search.
47
+ config.vm.box = "centos/7"
48
+ config.vm.network "forwarded_port", guest: 22, host: 2223, id: "ssh"
49
+
50
+ # Disable automatic box update checking. If you disable this, then
51
+ # boxes will only be checked for updates when the user runs
52
+ # `vagrant box outdated`. This is not recommended.
53
+ # config.vm.box_check_update = false
54
+
55
+ # Create a forwarded port mapping which allows access to a specific port
56
+ # within the machine from a port on the host machine. In the example below,
57
+ # accessing "localhost:8080" will access port 80 on the guest machine.
58
+ # NOTE: This will enable public access to the opened port
59
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
60
+
61
+ # Create a forwarded port mapping which allows access to a specific port
62
+ # within the machine from a port on the host machine and only allow access
63
+ # via 127.0.0.1 to disable public access
64
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
65
+
66
+ # Create a private network, which allows host-only access to the machine
67
+ # using a specific IP.
68
+ config.vm.network "private_network", ip: "192.168.33.10"
69
+
70
+ # Create a public network, which generally matched to bridged network.
71
+ # Bridged networks make the machine appear as another physical device on
72
+ # your network.
73
+ # config.vm.network "public_network"
74
+
75
+ # Share an additional folder to the guest VM. The first argument is
76
+ # the path on the host to the actual folder. The second argument is
77
+ # the path on the guest to mount the folder. And the optional third
78
+ # argument is a set of non-required options.
79
+ # config.vm.synced_folder "../data", "/vagrant_data"
80
+
81
+ # Provider-specific configuration so you can fine-tune various
82
+ # backing providers for Vagrant. These expose provider-specific options.
83
+ # Example for VirtualBox:
84
+ #
85
+ # config.vm.provider "virtualbox" do |vb|
86
+ # # Display the VirtualBox GUI when booting the machine
87
+ # vb.gui = true
88
+ #
89
+ # # Customize the amount of memory on the VM:
90
+ # vb.memory = "1024"
91
+ # end
92
+ #
93
+ # View the documentation for the provider you are using for more
94
+ # information on available options.
95
+
96
+ # Enable provisioning with a shell script. Additional provisioners such as
97
+ # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
98
+ # documentation for more information about their specific syntax and use.
99
+ # config.vm.provision "shell", inline: <<-SHELL
100
+ # apt-get update
101
+ # apt-get install -y apache2
102
+ # SHELL
103
+
104
+ end
105
+ ```
106
+ oracleのVagrantfile
107
+ ```ここに言語を入力
108
+ #
109
+ # LICENSE UPL 1.0
110
+ #
111
+ # Copyright (c) 2018, 2020 Oracle and/or its affiliates.
112
+ #
113
+ # Since: July, 2018
114
+ # Author: gerald.venzl@oracle.com
115
+ # Description: Creates an Oracle database Vagrant virtual machine.
116
+ #
117
+ # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
118
+ #
119
+
120
+ # -*- mode: ruby -*-
121
+ # vi: set ft=ruby :
122
+
123
+ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
124
+ VAGRANTFILE_API_VERSION = "2"
125
+
126
+ # Box metadata location and box name
127
+ BOX_URL = "https://oracle.github.io/vagrant-boxes/boxes"
128
+ BOX_NAME = "oraclelinux/7"
129
+
130
+ # define hostname
131
+ NAME = "oracle-19c-vagrant"
132
+
133
+ unless Vagrant.has_plugin?("vagrant-proxyconf")
134
+ puts 'Installing vagrant-proxyconf Plugin...'
135
+ system('vagrant plugin install vagrant-proxyconf')
136
+ end
137
+
138
+ # get host time zone for setting VM time zone, if possible
139
+ # can override in env section below
140
+ offset_sec = Time.now.gmt_offset
141
+ if (offset_sec % (60 * 60)) == 0
142
+ offset_hr = ((offset_sec / 60) / 60)
143
+ timezone_suffix = offset_hr >= 0 ? "-#{offset_hr.to_s}" : "+#{(-offset_hr).to_s}"
144
+ SYSTEM_TIMEZONE = 'Etc/GMT' + timezone_suffix
145
+ else
146
+ # if host time zone isn't an integer hour offset, fall back to UTC
147
+ SYSTEM_TIMEZONE = 'UTC'
148
+ end
149
+
150
+ # define listener and EM Express ports
151
+ LISTENER_PORT = 1522
152
+ EM_EXPRESS_PORT = 5501
153
+
154
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
155
+ config.vm.box = BOX_NAME
156
+ config.vm.box_url = "#{BOX_URL}/#{BOX_NAME}.json"
157
+ config.vm.define NAME
158
+
159
+ # change memory size
160
+ config.vm.provider "virtualbox" do |v|
161
+ v.memory = 2048
162
+ v.name = NAME
163
+ end
164
+ config.vm.provider :libvirt do |v|
165
+ v.memory = 2048
166
+ end
167
+
168
+ # add proxy configuration from host env - optional
169
+ if Vagrant.has_plugin?("vagrant-proxyconf")
170
+ puts "getting Proxy Configuration from Host..."
171
+ if ENV["http_proxy"]
172
+ puts "http_proxy: " + ENV["http_proxy"]
173
+ config.proxy.http = ENV["http_proxy"]
174
+ end
175
+ if ENV["https_proxy"]
176
+ puts "https_proxy: " + ENV["https_proxy"]
177
+ config.proxy.https = ENV["https_proxy"]
178
+ end
179
+ if ENV["no_proxy"]
180
+ config.proxy.no_proxy = ENV["no_proxy"]
181
+ end
182
+ end
183
+
184
+ # VM hostname
185
+ config.vm.hostname = NAME
186
+
187
+ # Oracle port forwarding
188
+ config.vm.network "forwarded_port", guest: LISTENER_PORT, host: LISTENER_PORT
189
+ config.vm.network "forwarded_port", guest: EM_EXPRESS_PORT, host: EM_EXPRESS_PORT
190
+
191
+ # Provision everything on the first run
192
+ config.vm.provision "shell", path: "scripts/install.sh", env:
193
+ {
194
+ "ORACLE_BASE" => "/opt/oracle",
195
+ "ORACLE_HOME" => "/opt/oracle/product/19c/dbhome_1",
196
+ "ORACLE_SID" => "ORCLCDB",
197
+ "ORACLE_PDB" => "ORCLPDB1",
198
+ "ORACLE_CHARACTERSET" => "AL32UTF8",
199
+ "ORACLE_EDITION" => "EE",
200
+ "LISTENER_PORT" => LISTENER_PORT,
201
+ "EM_EXPRESS_PORT" => EM_EXPRESS_PORT,
202
+ "SYSTEM_TIMEZONE" => SYSTEM_TIMEZONE
203
+ }
204
+
205
+ end
206
+
207
+ ```

1

解説追加

2020/06/03 08:09

投稿

larachan
larachan

スコア28

title CHANGED
@@ -1,1 +1,1 @@
1
- vagrant visualbox間でのdb接続が出来ないです。
1
+ vagrant virtualbox間でのdb接続が出来ないです。
body CHANGED
@@ -1,6 +1,6 @@
1
- vagarnt-oracel19でvisualBox上にOracleを作成し、ホストのWindowsからはSQLDeveloperで疎通できるようになりました。
1
+ vagarnt-oracel19でvirtualbox上にOracleを作成し、ホストのWindowsからはSQLDeveloperで疎通できるようになりました。
2
2
 
3
- vagrantcentOS7をvisualBox上に作成し、Laravelの環境構築をし、OracleClientなどOracle接続に必要なものは入れました。
3
+ vagrantcentOS7をvirtualbox上に作成し、Laravelの環境構築をし、OracleClientなどOracle接続に必要なものは入れました。
4
4
 
5
5
  LaravelからDBサーバー間の疎通をしようとしましたが、
6
6
  ```ここに言語を入力