vagrantで複数台の仮想ゲストOSを立ち上げた時の話

まえがき

とりあえず、複数立ち上げたらどうなるかみてみた。

参考文献

Vagrantで複数の仮想マシンを立ち上げる マルチマシン(Malti-Machine)設定  

Vagrantfile

コード表示

[oracle@centos vx]$ cat V*e
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  
  config.vm.define "node1" do |centos_on_kvm|
    centos_on_kvm.vm.hostname = "node1"
    centos_on_kvm.vm.provider "libvirt" do |spec|
      spec.memory = 2048
      spec.cpus = 2
    end
  end
  config.vm.define "node2" do |centos_on_kvm|
    centos_on_kvm.vm.hostname = "node2"
    centos_on_kvm.vm.provider "libvirt" do |spec|
      spec.memory = 2048
      spec.cpus = 2
    end
  end
  config.vm.define "node3" do |centos_on_kvm|
    centos_on_kvm.vm.hostname = "node3"
    centos_on_kvm.vm.provider "libvirt" do |spec|
      spec.memory = 2048
      spec.cpus = 2
    end
  end
end

実行ログ

コード表示

[oracle@centos vx]$ vagrant up
Bringing machine 'node1' up with 'libvirt' provider...
Bringing machine 'node2' up with 'libvirt' provider...
Bringing machine 'node3' up with 'libvirt' provider...
==> node1: Creating image (snapshot of base box volume).
==> node1: Creating domain with the following settings...
==> node1:  -- Name:              vx_node1
==> node1:  -- Domain type:       kvm
==> node3: Creating image (snapshot of base box volume).
==> node2: Creating image (snapshot of base box volume).
==> node1:  -- Cpus:              2
==> node2: Creating domain with the following settings...
==> node1:  -- Feature:           acpi
==> node3: Creating domain with the following settings...
==> node2:  -- Name:              vx_node2
==> node3:  -- Name:              vx_node3
==> node1:  -- Feature:           apic
==> node3:  -- Domain type:       kvm
==> node2:  -- Domain type:       kvm
==> node3:  -- Cpus:              2
==> node1:  -- Feature:           pae
==> node3:  -- Feature:           acpi
==> node2:  -- Cpus:              2
==> node3:  -- Feature:           apic
==> node1:  -- Memory:            2048M
==> node2:  -- Feature:           acpi
==> node3:  -- Feature:           pae
==> node1:  -- Management MAC:    
==> node2:  -- Feature:           apic
==> node3:  -- Memory:            2048M
==> node1:  -- Loader:            
==> node2:  -- Feature:           pae
==> node3:  -- Management MAC:    
==> node2:  -- Memory:            2048M
==> node1:  -- Nvram:             
==> node3:  -- Loader:            
==> node2:  -- Management MAC:    
==> node1:  -- Base box:          centos/7
==> node3:  -- Nvram:             
==> node1:  -- Storage pool:      default
==> node2:  -- Loader:            
==> node3:  -- Base box:          centos/7
==> node1:  -- Image:             /var/lib/libvirt/images/vx_node1.img (41G)
==> node3:  -- Storage pool:      default
==> node2:  -- Nvram:             
==> node1:  -- Volume Cache:      default
==> node2:  -- Base box:          centos/7
==> node3:  -- Image:             /var/lib/libvirt/images/vx_node3.img (41G)
==> node1:  -- Kernel:            
==> node2:  -- Storage pool:      default
==> node1:  -- Initrd:            
==> node3:  -- Volume Cache:      default
==> node2:  -- Image:             /var/lib/libvirt/images/vx_node2.img (41G)
==> node1:  -- Graphics Type:     vnc
==> node3:  -- Kernel:            
==> node2:  -- Volume Cache:      default
==> node3:  -- Initrd:            
==> node1:  -- Graphics Port:     -1
==> node3:  -- Graphics Type:     vnc
==> node2:  -- Kernel:            
==> node1:  -- Graphics IP:       127.0.0.1
==> node3:  -- Graphics Port:     -1
==> node1:  -- Graphics Password: Not defined
==> node2:  -- Initrd:            
==> node3:  -- Graphics IP:       127.0.0.1
==> node1:  -- Video Type:        cirrus
==> node3:  -- Graphics Password: Not defined
==> node2:  -- Graphics Type:     vnc
==> node1:  -- Video VRAM:        9216
==> node3:  -- Video Type:        cirrus
==> node1:  -- Sound Type:	
==> node2:  -- Graphics Port:     -1
==> node3:  -- Video VRAM:        9216
==> node1:  -- Keymap:            en-us
==> node2:  -- Graphics IP:       127.0.0.1
==> node3:  -- Sound Type:	
==> node1:  -- TPM Path:          
==> node2:  -- Graphics Password: Not defined
==> node3:  -- Keymap:            en-us
==> node1:  -- INPUT:             type=mouse, bus=ps2
==> node2:  -- Video Type:        cirrus
==> node3:  -- TPM Path:          
==> node3:  -- INPUT:             type=mouse, bus=ps2
==> node2:  -- Video VRAM:        9216
==> node2:  -- Sound Type:	
==> node2:  -- Keymap:            en-us
==> node2:  -- TPM Path:          
==> node2:  -- INPUT:             type=mouse, bus=ps2
==> node1: Creating shared folders metadata...
==> node3: Creating shared folders metadata...
==> node3: Starting domain.
==> node1: Starting domain.
==> node3: Waiting for domain to get an IP address...
==> node1: Waiting for domain to get an IP address...
==> node2: Creating shared folders metadata...
==> node2: Starting domain.
==> node2: Waiting for domain to get an IP address...
==> node3: Waiting for SSH to become available...
==> node1: Waiting for SSH to become available...
==> node2: Waiting for SSH to become available...
    node1: 
    node1: Vagrant insecure key detected. Vagrant will automatically replace
    node1: this with a newly generated keypair for better security.
    node3: 
    node3: Vagrant insecure key detected. Vagrant will automatically replace
    node3: this with a newly generated keypair for better security.
    node2: 
    node2: Vagrant insecure key detected. Vagrant will automatically replace
    node2: this with a newly generated keypair for better security.
    node3: 
    node3: Inserting generated public key within guest...
    node1: 
    node1: Inserting generated public key within guest...
    node2: 
    node2: Inserting generated public key within guest...
    node3: Removing insecure key from the guest if it's present...
    node1: Removing insecure key from the guest if it's present...
    node2: Removing insecure key from the guest if it's present...
    node3: Key inserted! Disconnecting and reconnecting using new SSH key...
    node1: Key inserted! Disconnecting and reconnecting using new SSH key...
    node2: Key inserted! Disconnecting and reconnecting using new SSH key...
==> node3: Setting hostname...
==> node1: Setting hostname...
==> node2: Setting hostname...
==> node3: Configuring and enabling network interfaces...
==> node1: Configuring and enabling network interfaces...
==> node2: Configuring and enabling network interfaces...
    node3: SSH address: 192.168.121.209:22
    node3: SSH username: vagrant
    node3: SSH auth method: private key
    node1: SSH address: 192.168.121.32:22
    node1: SSH username: vagrant
    node1: SSH auth method: private key
    node2: SSH address: 192.168.121.99:22
    node2: SSH username: vagrant
    node2: SSH auth method: private key
==> node3: Rsyncing folder: /home/oracle/vx/ => /vagrant
==> node1: Rsyncing folder: /home/oracle/vx/ => /vagrant
==> node2: Rsyncing folder: /home/oracle/vx/ => /vagrant

起動確認

コード表示

[oracle@centos vx]$ vagrant status
Current machine states:

node1                     running (libvirt)
node2                     running (libvirt)
node3                     running (libvirt)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

ネットワーク確認

コード表示

[oracle@centos vx]$ sudo virsh net-list
[sudo] oracle のパスワード:
 名前               状態     自動起動  永続
----------------------------------------------------------
 default              動作中  はい (yes)  はい (yes)
 vagrant-libvirt      動作中  いいえ (no) はい (yes)

ブリッチ設定確認

コード表示

[root@centos networks]# brctl show
bridge name	bridge id		STP enabled	interfaces
docker0		8000.0242b22c2a85	no		
virbr0		8000.525400bad5c4	yes		virbr0-nic
virbr1		8000.52540042696d	yes		virbr1-nic
							vnet0
							vnet1
							vnet2

仮想ホストOS側のNIC設定確認

コード表示

[oracle@centos vx]$ ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:d8:61:2c:f1:5b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.109/24 brd 192.168.1.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::865a:b7c8:6a76:1722/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:b2:2c:2a:85 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:b2ff:fe2c:2a85/64 scope link 
       valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:ba:d5:c4 brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:ba:d5:c4 brd ff:ff:ff:ff:ff:ff
90: virbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:42:69:6d brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.1/24 brd 192.168.121.255 scope global virbr1
       valid_lft forever preferred_lft forever
91: virbr1-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr1 state DOWN group default qlen 1000
    link/ether 52:54:00:42:69:6d brd ff:ff:ff:ff:ff:ff
96: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master virbr1 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:14:54:0f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe14:540f/64 scope link 
       valid_lft forever preferred_lft forever
97: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master virbr1 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:4f:71:b5 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe4f:71b5/64 scope link 
       valid_lft forever preferred_lft forever
98: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master virbr1 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:82:1d:03 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe82:1d03/64 scope link 
       valid_lft forever preferred_lft forever

仮想ホストOSと仮想ゲストOSのマスカレ設定確認

コード表示

[root@centos networks]# sudo iptables -t nat -L -n | grep -A 16 "Chain POSTROUTING (policy ACCEPT)"
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
RETURN     all  --  192.168.121.0/24     224.0.0.0/24        
RETURN     all  --  192.168.121.0/24     255.255.255.255     
MASQUERADE  tcp  --  192.168.121.0/24    !192.168.121.0/24     masq ports: 1024-65535
MASQUERADE  udp  --  192.168.121.0/24    !192.168.121.0/24     masq ports: 1024-65535
MASQUERADE  all  --  192.168.121.0/24    !192.168.121.0/24    
RETURN     all  --  192.168.122.0/24     224.0.0.0/24        
RETURN     all  --  192.168.122.0/24     255.255.255.255     
MASQUERADE  tcp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  udp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  all  --  192.168.122.0/24    !192.168.122.0/24    
MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0           
POSTROUTING_direct  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES  all  --  0.0.0.0/0            0.0.0.0/0           

libvirt管理のネットワーク確認

コード表示

[root@centos vx]# cd /etc/libvirt/qemu/networks
[root@centos networks]# ll
合計 12
drwx------. 2 root root 4096  5月 15 06:08 autostart
-rw-------. 1 root root  576  5月 12 16:11 default.xml
-rw-------. 1 root root  603  5月 24 06:45 vagrant-libvirt.xml
[root@centos networks]# cat default.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh net-edit default
or other application using the libvirt API.
-->

<network>
  <name>default</name>
  <uuid>431ebd86-8c41-4a77-91be-9dc7e8cb097e</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:ba:d5:c4'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>
[root@centos networks]# cat vagrant-libvirt.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh net-edit vagrant-libvirt
or other application using the libvirt API.
-->

<network ipv6='yes'>
  <name>vagrant-libvirt</name>
  <uuid>a86854f5-a240-42c6-b7da-ecd457aea19e</uuid>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:42:69:6d'/>
  <ip address='192.168.121.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.121.1' end='192.168.121.254'/>
    </dhcp>
  </ip>
</network>

仮想ゲストOSノード1にssh接続

コード表示

[oracle@centos vx]$ vagrant ssh node1
[vagrant@node1 ~]$ ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:4f:71:b5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.32/24 brd 192.168.121.255 scope global noprefixroute dynamic eth0
       valid_lft 3384sec preferred_lft 3384sec
    inet6 fe80::5054:ff:fe4f:71b5/64 scope link 
       valid_lft forever preferred_lft forever
[vagrant@node1 ~]$ su root
Password: vagrant
[root@node1 vagrant]# yum install -y net-tools
[root@node1 vagrant]# netstat -anp | grep -E "Active|Proto|ssh"
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2633/sshd           
tcp        0      0 192.168.121.32:22       192.168.121.1:38226     ESTABLISHED 5422/sshd: vagrant  
tcp6       0      0 :::22                   :::*                    LISTEN      2633/sshd           
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
unix  2      [ ]         DGRAM                    31193    5422/sshd: vagrant   
unix  3      [ ]         STREAM     CONNECTED     31196    5425/sshd: vagrant@  
unix  3      [ ]         STREAM     CONNECTED     31197    5422/sshd: vagrant   
unix  3      [ ]         STREAM     CONNECTED     21321    2633/sshd            
[root@node1 vagrant]# yum install -y lsof
[root@node1 vagrant]# lsof -i -nP | grep -E "COMMAND|ssh"
COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd     2633    root    3u  IPv4  21394      0t0  TCP *:22 (LISTEN)
sshd     2633    root    4u  IPv6  21403      0t0  TCP *:22 (LISTEN)
sshd     5422    root    3u  IPv4  31111      0t0  TCP 192.168.121.32:22->192.168.121.1:38226 (ESTABLISHED)
sshd     5425 vagrant    3u  IPv4  31111      0t0  TCP 192.168.121.32:22->192.168.121.1:38226 (ESTABLISHED)
[root@node1 vagrant]# yum install -y psmisc
[root@node1 vagrant]# pstree -p
systemd(1)-+-NetworkManager(4841)-+-dhclient(4861)
           |                      |-{NetworkManager}(4842)
           |                      `-{NetworkManager}(4844)
           |-agetty(1762)
           |-agetty(1932)
           |-auditd(1203)---{auditd}(1205)
           |-chronyd(1511)
           |-crond(1761)
           |-dbus-daemon(1471)---{dbus-daemon}(1587)
           |-gssproxy(1464)-+-{gssproxy}(1490)
           |                |-{gssproxy}(1491)
           |                |-{gssproxy}(1492)
           |                |-{gssproxy}(1493)
           |                `-{gssproxy}(1494)
           |-irqbalance(1437)
           |-master(2877)-+-pickup(2878)
           |              `-qmgr(2879)
           |-polkitd(1439)-+-{polkitd}(1538)
           |               |-{polkitd}(1619)
           |               |-{polkitd}(1632)
           |               |-{polkitd}(1643)
           |               |-{polkitd}(1645)
           |               `-{polkitd}(1648)
           |-rpcbind(1674)
           |-rsyslogd(2634)-+-{rsyslogd}(2639)
           |                `-{rsyslogd}(2641)
           |-sshd(2633)---sshd(5422)---sshd(5425)---bash(5426)---su(5448)---bash(5452)---pstree(5554)
           |-systemd-journal(1146)
           |-systemd-logind(1449)
           |-systemd-udevd(1179)
           `-tuned(2632)-+-{tuned}(2822)
                         |-{tuned}(2823)
                         |-{tuned}(2824)
                         `-{tuned}(2876)
[root@node1 vagrant]# yum install -y traceroute
[root@node1 vagrant]# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  gateway (192.168.121.1)  0.095 ms  0.074 ms  0.053 ms
 2  192.168.1.1 (192.168.1.1)  1.838 ms  1.820 ms  1.814 ms
 3  nas827.p-kanagawa.nttpc.ne.jp (210.153.251.235)  4.495 ms  5.015 ms  5.003 ms
 4  210.139.125.169 (210.139.125.169)  4.990 ms  5.083 ms  5.542 ms
 5  210.165.249.177 (210.165.249.177)  6.561 ms  5.832 ms  6.640 ms
 6  0-0-0-18.tky-no-acr01.sphere.ad.jp (210.153.241.89)  8.476 ms  8.465 ms  8.428 ms
 7  0-0-1-0--2025.tky-t4-bdr01.sphere.ad.jp (202.239.117.14)  9.317 ms  7.725 ms  7.701 ms
 8  72.14.202.229 (72.14.202.229)  7.327 ms  7.319 ms  7.663 ms
 9  * * *
10  google-public-dns-a.google.com (8.8.8.8)  7.740 ms  7.879 ms  7.931 ms
[root@node1 vagrant]# exit
[vagrant@node1 ~]$ logout
Connection to 192.168.121.32 closed.

仮想ゲストOSノード2にssh接続

コード表示

[oracle@centos vx]$ vagrant ssh node2
[vagrant@node2 ~]$ ip a show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:82:1d:03 brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.99/24 brd 192.168.121.255 scope global noprefixroute dynamic eth0
       valid_lft 2468sec preferred_lft 2468sec
    inet6 fe80::5054:ff:fe82:1d03/64 scope link 
       valid_lft forever preferred_lft forever
[vagrant@node2 ~]$ su root
Password: vagrant
[root@node2 vagrant]# yum install -y net-tools
[root@node2 vagrant]# netstat -anp | grep -E "Active|Proto|ssh"
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2630/sshd           
tcp        0      0 192.168.121.99:22       192.168.121.1:37726     ESTABLISHED 5421/sshd: vagrant  
tcp6       0      0 :::22                   :::*                    LISTEN      2630/sshd           
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
unix  3      [ ]         STREAM     CONNECTED     20384    2630/sshd            
unix  3      [ ]         STREAM     CONNECTED     31362    5424/sshd: vagrant@  
unix  2      [ ]         DGRAM                    31359    5421/sshd: vagrant   
unix  3      [ ]         STREAM     CONNECTED     31363    5421/sshd: vagrant   


[root@node2 vagrant]# yum install -y lsof
[root@node2 vagrant]# lsof -i -nP | grep -E "COMMAND|ssh"
COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd     2630    root    3u  IPv4  20470      0t0  TCP *:22 (LISTEN)
sshd     2630    root    4u  IPv6  20479      0t0  TCP *:22 (LISTEN)
sshd     5421    root    3u  IPv4  30566      0t0  TCP 192.168.121.99:22->192.168.121.1:37726 (ESTABLISHED)
sshd     5424 vagrant    3u  IPv4  30566      0t0  TCP 192.168.121.99:22->192.168.121.1:37726 (ESTABLISHED)
[root@node2 vagrant]# yum install -y psmisc
[root@node2 vagrant]# pstree -p
systemd(1)-+-NetworkManager(4838)-+-dhclient(4863)
           |                      |-{NetworkManager}(4839)
           |                      `-{NetworkManager}(4841)
           |-agetty(1844)
           |-agetty(1938)
           |-auditd(1203)---{auditd}(1205)
           |-chronyd(1556)
           |-crond(1862)
           |-dbus-daemon(1428)---{dbus-daemon}(1491)
           |-gssproxy(1550)-+-{gssproxy}(1577)
           |                |-{gssproxy}(1578)
           |                |-{gssproxy}(1579)
           |                |-{gssproxy}(1580)
           |                `-{gssproxy}(1581)
           |-irqbalance(1422)
           |-master(2873)-+-pickup(2875)
           |              `-qmgr(2876)
           |-polkitd(1499)-+-{polkitd}(1560)
           |               |-{polkitd}(1573)
           |               |-{polkitd}(1585)
           |               |-{polkitd}(1593)
           |               |-{polkitd}(1596)
           |               `-{polkitd}(1607)
           |-rpcbind(1430)
           |-rsyslogd(2633)-+-{rsyslogd}(2637)
           |                `-{rsyslogd}(2638)
           |-sshd(2630)---sshd(5421)---sshd(5424)---bash(5425)---su(5447)---bash(5451)---pstree(5520)
           |-systemd-journal(1145)
           |-systemd-logind(1528)
           |-systemd-udevd(1176)
           `-tuned(2629)-+-{tuned}(2826)
                         |-{tuned}(2827)
                         |-{tuned}(2831)
                         `-{tuned}(2877)
[root@node2 vagrant]# yum install -y traceroute
[root@node2 vagrant]# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  gateway (192.168.121.1)  0.095 ms  0.074 ms  0.053 ms
 2  192.168.1.1 (192.168.1.1)  1.838 ms  1.820 ms  1.814 ms
 3  nas827.p-kanagawa.nttpc.ne.jp (210.153.251.235)  4.495 ms  5.015 ms  5.003 ms
 4  210.139.125.169 (210.139.125.169)  4.990 ms  5.083 ms  5.542 ms
 5  210.165.249.177 (210.165.249.177)  6.561 ms  5.832 ms  6.640 ms
 6  0-0-0-18.tky-no-acr01.sphere.ad.jp (210.153.241.89)  8.476 ms  8.465 ms  8.428 ms
 7  0-0-1-0--2025.tky-t4-bdr01.sphere.ad.jp (202.239.117.14)  9.317 ms  7.725 ms  7.701 ms
 8  72.14.202.229 (72.14.202.229)  7.327 ms  7.319 ms  7.663 ms
 9  * * *
10  google-public-dns-a.google.com (8.8.8.8)  7.740 ms  7.879 ms  7.931 ms
[root@node2 vagrant]# exit
[vagrant@node2 ~]$ logout
Connection to 192.168.121.99 closed.

仮想ゲストOSノード3にssh接続

コード表示

[oracle@centos vx]$ vagrant ssh node3
[vagrant@node3 ~]$ ip a show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:14:54:0f brd ff:ff:ff:ff:ff:ff
    inet 192.168.121.209/24 brd 192.168.121.255 scope global noprefixroute dynamic eth0
       valid_lft 2261sec preferred_lft 2261sec
    inet6 fe80::5054:ff:fe14:540f/64 scope link 
       valid_lft forever preferred_lft forever
[vagrant@node3 ~]$ su root
Password: 
[root@node3 vagrant]# yum install -y net-tools


[root@node3 vagrant]# netstat -anp | grep -E "Active|Proto|ssh"
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2614/sshd           
tcp        0      0 192.168.121.209:22      192.168.121.1:58210     ESTABLISHED 5404/sshd: vagrant  
tcp6       0      0 :::22                   :::*                    LISTEN      2614/sshd           
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
unix  3      [ ]         STREAM     CONNECTED     22553    2614/sshd            
unix  3      [ ]         STREAM     CONNECTED     31015    5407/sshd: vagrant@  
unix  3      [ ]         STREAM     CONNECTED     31016    5404/sshd: vagrant   
unix  2      [ ]         DGRAM                    31012    5404/sshd: vagrant   
[root@node3 vagrant]# yum install -y lsof
[root@node3 vagrant]# lsof -i -nP | grep -E "COMMAND|ssh"
COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd     2614    root    3u  IPv4  21823      0t0  TCP *:22 (LISTEN)
sshd     2614    root    4u  IPv6  21835      0t0  TCP *:22 (LISTEN)
sshd     5404    root    3u  IPv4  31849      0t0  TCP 192.168.121.209:22->192.168.121.1:58210 (ESTABLISHED)
sshd     5407 vagrant    3u  IPv4  31849      0t0  TCP 192.168.121.209:22->192.168.121.1:58210 (ESTABLISHED)
[root@node3 vagrant]# yum install -y psmisc
[root@node3 vagrant]# pstree -p
systemd(1)-+-NetworkManager(4821)-+-dhclient(4844)
           |                      |-{NetworkManager}(4822)
           |                      `-{NetworkManager}(4824)
           |-agetty(1799)
           |-agetty(1987)
           |-auditd(1201)---{auditd}(1202)
           |-chronyd(1459)
           |-crond(1793)
           |-dbus-daemon(1413)---{dbus-daemon}(1472)
           |-gssproxy(1422)-+-{gssproxy}(1442)
           |                |-{gssproxy}(1443)
           |                |-{gssproxy}(1444)
           |                |-{gssproxy}(1445)
           |                `-{gssproxy}(1446)
           |-irqbalance(1375)
           |-master(2857)-+-pickup(2858)
           |              `-qmgr(2859)
           |-polkitd(1391)-+-{polkitd}(1470)
           |               |-{polkitd}(1491)
           |               |-{polkitd}(1501)
           |               |-{polkitd}(1514)
           |               |-{polkitd}(1515)
           |               `-{polkitd}(1532)
           |-rpcbind(1381)
           |-rsyslogd(2617)-+-{rsyslogd}(2621)
           |                `-{rsyslogd}(2622)
           |-sshd(2614)---sshd(5404)---sshd(5407)---bash(5408)---su(5431)---bash(5435)---pstree(5503)
           |-systemd-journal(1144)
           |-systemd-logind(1488)
           |-systemd-udevd(1175)
           `-tuned(2612)-+-{tuned}(2802)
                         |-{tuned}(2803)
                         |-{tuned}(2804)
                         `-{tuned}(2817)
[root@node3 vagrant]# yum install -y traceroute
[root@node3 vagrant]# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  gateway (192.168.121.1)  0.095 ms  0.074 ms  0.053 ms
 2  192.168.1.1 (192.168.1.1)  1.838 ms  1.820 ms  1.814 ms
 3  nas827.p-kanagawa.nttpc.ne.jp (210.153.251.235)  4.495 ms  5.015 ms  5.003 ms
 4  210.139.125.169 (210.139.125.169)  4.990 ms  5.083 ms  5.542 ms
 5  210.165.249.177 (210.165.249.177)  6.561 ms  5.832 ms  6.640 ms
 6  0-0-0-18.tky-no-acr01.sphere.ad.jp (210.153.241.89)  8.476 ms  8.465 ms  8.428 ms
 7  0-0-1-0--2025.tky-t4-bdr01.sphere.ad.jp (202.239.117.14)  9.317 ms  7.725 ms  7.701 ms
 8  72.14.202.229 (72.14.202.229)  7.327 ms  7.319 ms  7.663 ms
 9  * * *
10  google-public-dns-a.google.com (8.8.8.8)  7.740 ms  7.879 ms  7.931 ms
[root@node3 vagrant]# exit
[vagrant@node3 ~]$ logout
Connection to 192.168.121.209 closed.

あとがき

おもしろくなってきた!!

centos7 sqldeveloper19.1 インストール

参考文献

公式サイトLinux RPM手順

RPM for Linux Installation Notes  
SQL Developer Downloads  

ダウンロード

2つのrpmをダウンロード

コード表示

[oracle@centos ~]$ cd jj
[oracle@centos jj]$ ll
合計 536116
-rw-r--r--. 1 oracle docker 179439263  5月  4 20:14 jdk-8u211-linux-x64.rpm
-rw-r--r--. 1 oracle docker 369526372  5月  4 19:20 sqldeveloper-19.1.0.094.2042.noarch.rpm
[oracle@centos jj]$ pwd
/home/oracle/jj

rpmインストール

コード表示

[oracle@centos jj]$ ll
合計 360876
-rw-r--r--. 1 oracle docker 369526372  5月  4 19:20 sqldeveloper-19.1.0.094.2042.noarch.rpm
[oracle@centos jj]$ sudo rpm -ivh sqldeveloper-19.1.0.094.2042.noarch.rpm
[sudo] oracle のパスワード:
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:sqldeveloper-19.1.0-094.2042     ################################# [100%]
[oracle@centos jj]$ ll
合計 536116
-rw-r--r--. 1 oracle docker 179439263  5月  4 20:14 jdk-8u211-linux-x64.rpm
-rw-r--r--. 1 oracle docker 369526372  5月  4 19:20 sqldeveloper-19.1.0.094.2042.noarch.rpm
[oracle@centos jj]$ sudo rpm -ivh jdk-8u211-linux-x64.rpm
[sudo] oracle のパスワード:
警告: jdk-8u211-linux-x64.rpm: ヘッダー V3 RSA/SHA256 Signature、鍵 ID ec551f03: NOKEY
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:jdk1.8-2000:1.8.0_211-fcs        ################################# [100%]
Unpacking JAR files...
	tools.jar...
	plugin.jar...
	javaws.jar...
	deploy.jar...
	rt.jar...
	jsse.jar...
	charsets.jar...
	localedata.jar...

パス通すまえにあえて怒られに行く

コード表示

[oracle@centos sqldeveloper]$ pwd
/opt/sqldeveloper
[oracle@centos sqldeveloper]$ ll | grep *sh
-rwxr-xr-x.  1 root root    71  4月  5 05:42 sqldeveloper.sh
[oracle@centos sqldeveloper]$ ./sqldeveloper.sh

 Oracle SQL Developer
 Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.

Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/oracle/.sqldeveloper/19.1.0/product.conf
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin
Error: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/bin/java not found or not a valid JDK
Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/oracle/.sqldeveloper/19.1.0/product.conf
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre 
Error: Java home /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre is not a JDK,
either jre/bin/java OR lib/tools.jar OR lib/dt.jar is missing.
Running SQL Developer under a JRE is not supported.

If this Java VM is actually a full JDK installation, add
'SetSkipJ2SDKCheck true' to one of the following files.
Otherwise specify a different Java JDK location with a
SetJavaHome directive in one of the following files:
  /home/oracle/.sqldeveloper/19.1.0/product.conf
  /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf

ダウンロードしたjdkの場所探す

/usr/java/jdk1.8.0_211-amd64/をJAVA_HOMEにすればよさげ。というよりパス入力されるように求めてくるから、自分で入れなくても大丈夫。

コード表示

[oracle@centos jdk1.8.0_211-amd64]$ find / -name "*rt.jar*" 2>/dev/null
/opt/sqldeveloper/external/oracle.external.jfxrt.jar
/opt/sqldeveloper/external/oracle.javamodel-rt.jar
/opt/sqldeveloper/external/oracle.external.sqlj-rt.jar
/opt/sqldeveloper/ide/extensions/oracle.ide.importexport.jar
/opt/sqldeveloper/ide/lib/webupdate-rt.jar
/opt/sqldeveloper/ide/lib/idert.jar
/opt/sqldeveloper/modules/oracle.javatools/javamodel-rt.jar
/opt/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.dbcart.jar
/opt/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.report.jar
/opt/sqldeveloper/sqldeveloper/lib/osdt_cert.jar
/opt/sqldeveloper/sqldeveloper/lib/oracle.sqldeveloper.homesupport.jar
/opt/sqldeveloper/jdev/lib/jdev-rt.jar
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.211-2.6.17.1.el7_6.x86_64/jre/lib/rt.jar
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/lib/rt.jar
/usr/java/jdk1.8.0_211-amd64/lib/visualvm/visualvm/modules/com-sun-tools-visualvm-uisupport.jar
/usr/java/jdk1.8.0_211-amd64/jre/lib/rt.jar
/usr/java/jdk1.8.0_211-amd64/jre/lib/ext/jfxrt.jar
[oracle@centos jdk1.8.0_211-amd64]$ cd -
/usr/java/jdk1.8.0_211-amd64/bin

再チャレンジ

コード表示

[oracle@centos sqldeveloper]$ pwd
/opt/sqldeveloper
[oracle@centos sqldeveloper]$ ./sqldeveloper.sh

 Oracle SQL Developer
 Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.

Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/oracle/.sqldeveloper/19.1.0/product.conf
/usr/java/jdk1.8.0_211-amd64/

アプリケーション→プログラミング→SQLDEVELOPERのアイコンあるからそれクリック2回目以降。

1回目は動くこと確認したら、プロセス切ってOK。

動作確認



市松模様はおすすめ

peeコマンドをinstallしたかった話

参考文献

丁寧だよなー。

今さらですがyum(^^;)

ローカルマシンに登録しているレポジトリを確認

コード表示

[root@61eff46d2318 mnt]# yum repolist
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
repo id                                                                                              repo name                                                                                               status
base/7/x86_64                                                                                        CentOS-7 - Base                                                                                         10019
extras/7/x86_64                                                                                      CentOS-7 - Extras                                                                                         387
updates/7/x86_64                                                                                     CentOS-7 - Updates                                                                                       1840
repolist: 12246

コマンドがどのレポジトリのパッケージに含まれているか確認

コード表示

[root@61eff46d2318 mnt]# yum provides cp
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
coreutils-8.22-23.el7.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo        : base
Matched from:
Filename    : /bin/cp



coreutils-8.22-23.el7.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo        : base
Matched from:
Filename    : /usr/bin/cp



coreutils-8.22-23.el7.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo        : @CentOS
Matched from:
Filename    : /bin/cp



coreutils-8.22-23.el7.x86_64 : A set of basic GNU tools commonly used in shell scripts
Repo        : @CentOS
Matched from:
Filename    : /usr/bin/cp

コマンドの所在を確認

コード表示

[root@61eff46d2318 mnt]# which cp
alias cp='cp -i'
	/usr/bin/cp
[root@61eff46d2318 mnt]# rpm -qf $(which cp)
rpm: -i': unknown option
[root@61eff46d2318 mnt]# rpm -qf $(which cp | tail -n 1)
coreutils-8.22-23.el7.x86_64

peeコマンドは登録しているレポジトリにない

コード表示

[root@61eff46d2318 mnt]# yum provides pee
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
base/7/x86_64/filelists_db                                                                                                                                                                  | 7.1 MB  00:00:03     
extras/7/x86_64/filelists_db                                                                                                                                                                | 236 kB  00:00:00     
updates/7/x86_64/filelists_db                                                                                                                                                               | 3.4 MB  00:00:01     
No matches found

peeコマンドは登録しているレポジトリにないので、該当するパッケージもあるわけなく。。

コード表示

[root@61eff46d2318 mnt]# rpm -qf $(which pee)
/usr/bin/which: no pee in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
rpm: no arguments given for query

peeコマンドを含むパッケージが管理されているレポジトリを探す旅に出る。

でた

ローカルに登録されているレポジトリを確認

コード表示

[root@61eff46d2318 mnt]# cd /etc/yum.repos.d
[root@61eff46d2318 yum.repos.d]# ll
total 32
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  630 Nov 23 22:16 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root  314 Nov 23 22:16 CentOS-fasttrack.repo
らいい

enablerepo=*のオプションで全レポジトリに大して当該のコマンドの提供元をぎゃくびきする。

CentOS-Media.repoのせいでfailする

コード表示

[root@61eff46d2318 yum.repos.d]# yum --enablerepo=* provides pee
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * c7-media: 
 * centosplus: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * fasttrack: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
C7.0.1406-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.0.1406-centosplus                                                                                                                                                                        | 2.9 kB  00:00:00     
C7.0.1406-extras                                                                                                                                                                            | 2.9 kB  00:00:00     
C7.0.1406-fasttrack                                                                                                                                                                         | 2.9 kB  00:00:00     
C7.0.1406-updates                                                                                                                                                                           | 2.9 kB  00:00:00     
C7.1.1503-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.1.1503-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.1.1503-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.1.1503-fasttrack                                                                                                                                                                         | 3.4 kB  00:00:00     
C7.1.1503-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.2.1511-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.2.1511-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.2.1511-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.2.1511-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.2.1511-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.3.1611-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.3.1611-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.3.1611-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.3.1611-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.3.1611-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.4.1708-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.4.1708-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.4.1708-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.4.1708-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.4.1708-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.5.1804-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.5.1804-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.5.1804-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.5.1804-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.5.1804-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
base-debuginfo                                                                                                                                                                              | 2.5 kB  00:00:00     
base-source                                                                                                                                                                                 | 2.9 kB  00:00:00     
file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/CentOS/repodata/repomd.xml"
Trying other mirror.
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrecorder/repodata/repomd.xml"
Trying other mirror.
file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrom/repodata/repomd.xml"
Trying other mirror.


 One of the configured repositories failed (CentOS-7 - Media),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=c7-media ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable c7-media
        or
            subscription-manager repos --disable=c7-media

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=c7-media.skip_if_unavailable=true

failure: repodata/repomd.xml from c7-media: [Errno 256] No more mirrors to try.
file:///media/CentOS/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/CentOS/repodata/repomd.xml"
file:///media/cdrecorder/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrecorder/repodata/repomd.xml"
file:///media/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/cdrom/repodata/repomd.xml"

CentOS-Media.repoを削除する

コード表示

[root@61eff46d2318 yum.repos.d]# pwd
/etc/yum.repos.d
[root@61eff46d2318 yum.repos.d]# ll
total 32
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  630 Nov 23 22:16 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root  314 Nov 23 22:16 CentOS-fasttrack.repo
[root@61eff46d2318 yum.repos.d]# rm CentOS-Media.repo
rm: remove regular file 'CentOS-Media.repo'? y
[root@61eff46d2318 yum.repos.d]# ll
total 28
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root  314 Nov 23 22:16 CentOS-fasttrack.repo

enablerepo=*のオプションで全レポジトリに大して当該のコマンドの提供元をぎゃくびきする。

コード表示

[root@61eff46d2318 yum.repos.d]# yum --enablerepo=* provides pee
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * centosplus: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * fasttrack: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
C7.0.1406-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.0.1406-centosplus                                                                                                                                                                        | 2.9 kB  00:00:00     
C7.0.1406-extras                                                                                                                                                                            | 2.9 kB  00:00:00     
C7.0.1406-fasttrack                                                                                                                                                                         | 2.9 kB  00:00:00     
C7.0.1406-updates                                                                                                                                                                           | 2.9 kB  00:00:00     
C7.1.1503-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.1.1503-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.1.1503-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.1.1503-fasttrack                                                                                                                                                                         | 3.4 kB  00:00:00     
C7.1.1503-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.2.1511-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.2.1511-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.2.1511-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.2.1511-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.2.1511-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.3.1611-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.3.1611-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.3.1611-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.3.1611-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.3.1611-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.4.1708-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.4.1708-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.4.1708-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.4.1708-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.4.1708-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
C7.5.1804-base                                                                                                                                                                              | 3.6 kB  00:00:00     
C7.5.1804-centosplus                                                                                                                                                                        | 3.4 kB  00:00:00     
C7.5.1804-extras                                                                                                                                                                            | 3.4 kB  00:00:00     
C7.5.1804-fasttrack                                                                                                                                                                         | 3.3 kB  00:00:00     
C7.5.1804-updates                                                                                                                                                                           | 3.4 kB  00:00:00     
base                                                                                                                                                                                        | 3.6 kB  00:00:00     
base-debuginfo                                                                                                                                                                              | 2.5 kB  00:00:00     
base-source                                                                                                                                                                                 | 2.9 kB  00:00:00     
centosplus                                                                                                                                                                                  | 3.4 kB  00:00:00     
centosplus-source                                                                                                                                                                           | 2.9 kB  00:00:00     
cr                                                                                                                                                                                          | 3.3 kB  00:00:00     
extras                                                                                                                                                                                      | 3.4 kB  00:00:00     
extras-source                                                                                                                                                                               | 2.9 kB  00:00:00     
fasttrack                                                                                                                                                                                   | 3.4 kB  00:00:00     
updates                                                                                                                                                                                     | 3.4 kB  00:00:00     
updates-source                                                                                                                                                                              | 2.9 kB  00:00:00     
(1/44): C7.0.1406-extras/x86_64/primary_db                                                                                                                                                  |  43 kB  00:00:00     
(2/44): C7.0.1406-fasttrack/x86_64/primary_db                                                                                                                                               | 124 kB  00:00:00     
(3/44): C7.0.1406-base/x86_64/group_gz                                                                                                                                                      | 157 kB  00:00:00     
(4/44): C7.1.1503-base/x86_64/group_gz                                                                                                                                                      | 154 kB  00:00:00     
(5/44): C7.0.1406-centosplus/x86_64/primary_db                                                                                                                                              | 3.5 MB  00:00:03     
(6/44): C7.1.1503-extras/x86_64/primary_db                                                                                                                                                  | 120 kB  00:00:00     
(7/44): C7.1.1503-fasttrack/x86_64/primary_db                                                                                                                                               |  71 kB  00:00:00     
(8/44): C7.1.1503-centosplus/x86_64/primary_db                                                                                                                                              | 2.2 MB  00:00:03     
(9/44): C7.0.1406-base/x86_64/primary_db                                                                                                                                                    | 4.9 MB  00:00:04     
(10/44): C7.2.1511-base/x86_64/group_gz                                                                                                                                                     | 155 kB  00:00:00     
(11/44): C7.1.1503-base/x86_64/primary_db                                                                                                                                                   | 5.1 MB  00:00:12     
(12/44): C7.2.1511-extras/x86_64/primary_db                                                                                                                                                 | 166 kB  00:00:01     
(13/44): C7.2.1511-fasttrack/x86_64/primary_db                                                                                                                                              | 1.2 kB  00:00:00     
(14/44): C7.2.1511-centosplus/x86_64/primary_db                                                                                                                                             | 4.1 MB  00:00:19     
(15/44): C7.3.1611-base/x86_64/group_gz                                                                                                                                                     | 155 kB  00:00:00     
(16/44): C7.1.1503-updates/x86_64/primary_db                                                                                                                                                | 4.7 MB  00:00:23     
(17/44): C7.2.1511-base/x86_64/primary_db                                                                                                                                                   | 5.3 MB  00:00:22     
(18/44): C7.3.1611-extras/x86_64/primary_db                                                                                                                                                 | 191 kB  00:00:01     
(19/44): C7.3.1611-fasttrack/x86_64/primary_db                                                                                                                                              | 1.2 kB  00:00:00     
(20/44): C7.0.1406-updates/x86_64/primary_db                                                                                                                                                | 7.2 MB  00:00:29     
(21/44): C7.4.1708-base/x86_64/group_gz                                                                                                                                                     | 156 kB  00:00:00     
(22/44): C7.3.1611-centosplus/x86_64/primary_db                                                                                                                                             | 3.2 MB  00:00:11     
(23/44): C7.2.1511-updates/x86_64/primary_db                                                                                                                                                | 9.1 MB  00:00:26     
(24/44): C7.4.1708-extras/x86_64/primary_db                                                                                                                                                 | 185 kB  00:00:00     
(25/44): C7.4.1708-fasttrack/x86_64/primary_db                                                                                                                                              | 1.2 kB  00:00:00     
(26/44): C7.3.1611-base/x86_64/primary_db                                                                                                                                                   | 5.6 MB  00:00:18     
(27/44): C7.5.1804-base/x86_64/group_gz                                                                                                                                                     | 166 kB  00:00:00     
(28/44): C7.4.1708-base/x86_64/primary_db                                                                                                                                                   | 5.7 MB  00:00:23     
(29/44): C7.4.1708-centosplus/x86_64/primary_db                                                                                                                                             | 3.1 MB  00:00:17     
(30/44): C7.3.1611-updates/x86_64/primary_db                                                                                                                                                | 7.8 MB  00:00:27     
(31/44): C7.5.1804-fasttrack/x86_64/primary_db                                                                                                                                              | 1.1 kB  00:00:00     
(32/44): C7.5.1804-extras/x86_64/primary_db                                                                                                                                                 | 205 kB  00:00:00     
(33/44): base-debuginfo/x86_64/primary_db                                                                                                                                                   | 2.5 MB  00:00:03     
(34/44): base-source/7/primary_db                                                                                                                                                           | 966 kB  00:00:03     
(35/44): C7.5.1804-centosplus/x86_64/primary_db                                                                                                                                             | 3.3 MB  00:00:10     
(36/44): centosplus-source/7/primary_db                                                                                                                                                     | 5.9 kB  00:00:00     
(37/44): centosplus/7/x86_64/primary_db                                                                                                                                                     | 2.0 MB  00:00:00     
(38/44): extras-source/7/primary_db                                                                                                                                                         |  25 kB  00:00:00     
(39/44): fasttrack/7/x86_64/primary_db                                                                                                                                                      |  76 kB  00:00:00     
(40/44): cr/7/x86_64/primary_db                                                                                                                                                             | 1.1 kB  00:00:00     
(41/44): updates-source/7/primary_db                                                                                                                                                        | 113 kB  00:00:00     
(42/44): C7.5.1804-updates/x86_64/primary_db                                                                                                                                                | 6.0 MB  00:00:14     
(43/44): C7.5.1804-base/x86_64/primary_db                                                                                                                                                   | 5.9 MB  00:00:32     
(44/44): C7.4.1708-updates/x86_64/primary_db                                                                                                                                                | 6.9 MB  00:00:39     
C7.0.1406-base/x86_64/filelists_db                                                                                                                                                          | 5.8 MB  00:00:37     
C7.0.1406-centosplus/x86_64/filelists_db                                                                                                                                                    | 2.2 MB  00:00:17     
C7.0.1406-extras/x86_64/filelists_db                                                                                                                                                        | 121 kB  00:00:00     
C7.0.1406-fasttrack/x86_64/filelists_db                                                                                                                                                     |  93 kB  00:00:00     
C7.0.1406-updates/x86_64/filelists_db                                                                                                                                                       | 5.3 MB  00:00:19     
C7.1.1503-base/x86_64/filelists_db                                                                                                                                                          | 6.0 MB  00:00:20     
C7.1.1503-centosplus/x86_64/filelists_db                                                                                                                                                    | 1.1 MB  00:00:06     
C7.1.1503-extras/x86_64/filelists_db                                                                                                                                                        | 392 kB  00:00:02     
C7.1.1503-fasttrack/x86_64/filelists_db                                                                                                                                                     |  76 kB  00:00:00     
C7.1.1503-updates/x86_64/filelists_db                                                                                                                                                       | 3.0 MB  00:00:15     
C7.2.1511-base/x86_64/filelists_db                                                                                                                                                          | 6.2 MB  00:00:34     
C7.2.1511-centosplus/x86_64/filelists_db                                                                                                                                                    | 2.0 MB  00:00:10     
C7.2.1511-extras/x86_64/filelists_db                                                                                                                                                        | 468 kB  00:00:02     
C7.2.1511-fasttrack/x86_64/filelists_db                                                                                                                                                     |  586 B  00:00:00     
C7.2.1511-updates/x86_64/filelists_db                                                                                                                                                       | 5.3 MB  00:00:23     
C7.3.1611-base/x86_64/filelists_db                                                                                                                                                          | 6.6 MB  00:00:30     
C7.3.1611-centosplus/x86_64/filelists_db                                                                                                                                                    | 1.5 MB  00:00:06     
C7.3.1611-extras/x86_64/filelists_db                                                                                                                                                        | 1.1 MB  00:00:06     
C7.3.1611-fasttrack/x86_64/filelists_db                                                                                                                                                     |  586 B  00:00:00     
C7.3.1611-updates/x86_64/filelists_db                                                                                                                                                       | 4.4 MB  00:00:27     
C7.4.1708-base/x86_64/filelists_db                                                                                                                                                          | 6.7 MB  00:00:36     
C7.4.1708-centosplus/x86_64/filelists_db                                                                                                                                                    | 1.4 MB  00:00:06     
C7.4.1708-extras/x86_64/filelists_db                                                                                                                                                        | 709 kB  00:00:02     
C7.4.1708-fasttrack/x86_64/filelists_db                                                                                                                                                     |  586 B  00:00:00     
C7.4.1708-updates/x86_64/filelists_db                                                                                                                                                       | 4.2 MB  00:00:26     
C7.5.1804-base/x86_64/filelists_db                                                                                                                                                          | 6.9 MB  00:01:02     
C7.5.1804-centosplus/x86_64/filelists_db                                                                                                                                                    | 1.5 MB  00:00:11     
C7.5.1804-extras/x86_64/filelists_db                                                                                                                                                        | 603 kB  00:00:02     
C7.5.1804-fasttrack/x86_64/filelists_db                                                                                                                                                     |  586 B  00:00:00     
C7.5.1804-updates/x86_64/filelists_db                                                                                                                                                       | 3.4 MB  00:00:18     
base-debuginfo/x86_64/filelists_db                                                                                                                                                          |  66 MB  00:05:35     
centosplus/7/x86_64/filelists_db                                                                                                                                                            | 926 kB  00:00:00     
cr/7/x86_64/filelists_db                                                                                                                                                                    |  586 B  00:00:00     
fasttrack/7/x86_64/filelists_db                                                                                                                                                             |  39 kB  00:00:00     
No matches found

見つからなかったので、epelレポ登録する。結局。

調査力がすごい。すごすぎ。どんな検索の仕方したんだろ。

EPELリポジトリの簡単な追加方法
コード表示

[root@61eff46d2318 yum.repos.d]# yum --disablerepo=* --enablerepo=extra* --showduplicates list epel*
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * extras: ty1.mirror.newmediaexpress.com
Available Packages
epel-release.noarch                                                                                           7-11                                                                                           extras

epelいんすこ

コード表示

[root@61eff46d2318 yum.repos.d]# ll
total 28
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root  314 Nov 23 22:16 CentOS-fasttrack.repo
[root@61eff46d2318 yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                 Arch                                              Version                                         Repository                                         Size
===================================================================================================================================================================================================================
Installing:
 epel-release                                            noarch                                            7-11                                            extras                                             15 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                                                                |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                                                                        1/1 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                                        1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                                                                                                       

Complete!
[root@61eff46d2318 yum.repos.d]# ll
total 36
-rw-r--r--. 1 root root 1664 Nov 23 22:16 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Nov 23 22:16 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Nov 23 22:16 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1331 Nov 23 22:16 CentOS-Sources.repo
-rw-r--r--. 1 root root 5701 Nov 23 22:16 CentOS-Vault.repo
-rw-r--r--. 1 root root  314 Nov 23 22:16 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 1050 Oct  3  2017 epel-testing.repo
-rw-r--r--. 1 root root  951 Oct  3  2017 epel.repo
[root@61eff46d2318 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
repo id                                                                                repo name                                                                                                             status
base/7/x86_64                                                                          CentOS-7 - Base                                                                                                       10019
epel/x86_64                                                                            Extra Packages for Enterprise Linux 7 - x86_64                                                                        13125
extras/7/x86_64                                                                        CentOS-7 - Extras                                                                                                       387
updates/7/x86_64                                                                       CentOS-7 - Updates                                                                                                     1840
repolist: 25371

peeは何処

コード表示

[root@61eff46d2318 yum.repos.d]# yum provides pee
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
moreutils-0.49-2.el7.x86_64 : Additional unix utilities
Repo        : epel
Matched from:
Filename    : /usr/bin/pee

[root@61eff46d2318 yum.repos.d]# which pee
/usr/bin/which: no pee in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
[root@61eff46d2318 yum.repos.d]# rpm -qf $(which pee)
/usr/bin/which: no pee in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
rpm: no arguments given for query



moreutils-0.49-2.el7.x86_64いんすこ

コード表示

[root@61eff46d2318 yum.repos.d]# yum install -y moreutils-0.49-2.el7.x86_64
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package moreutils.x86_64 0:0.49-2.el7 will be installed
--> Processing Dependency: perl(IPC::Run) for package: moreutils-0.49-2.el7.x86_64
--> Processing Dependency: perl-Time-Duration for package: moreutils-0.49-2.el7.x86_64
--> Processing Dependency: perl-TimeDate for package: moreutils-0.49-2.el7.x86_64
--> Running transaction check
---> Package perl-IPC-Run.noarch 0:0.92-2.el7 will be installed
--> Processing Dependency: perl(IO::Pty) >= 1.08 for package: perl-IPC-Run-0.92-2.el7.noarch
---> Package perl-Time-Duration.noarch 0:1.06-17.el7 will be installed
---> Package perl-TimeDate.noarch 1:2.30-2.el7 will be installed
--> Running transaction check
---> Package perl-IO-Tty.x86_64 0:1.10-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                    Arch                                           Version                                              Repository                                    Size
===================================================================================================================================================================================================================
Installing:
 moreutils                                                  x86_64                                         0.49-2.el7                                           epel                                          76 k
Installing for dependencies:
 perl-IO-Tty                                                x86_64                                         1.10-11.el7                                          base                                          42 k
 perl-IPC-Run                                               noarch                                         0.92-2.el7                                           base                                         122 k
 perl-Time-Duration                                         noarch                                         1.06-17.el7                                          epel                                          17 k
 perl-TimeDate                                              noarch                                         1:2.30-2.el7                                         base                                          52 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 308 k
Installed size: 674 k
Downloading packages:
(1/5): perl-IO-Tty-1.10-11.el7.x86_64.rpm                                                                                                                                                   |  42 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/epel/packages/moreutils-0.49-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for moreutils-0.49-2.el7.x86_64.rpm is not installed
(2/5): moreutils-0.49-2.el7.x86_64.rpm                                                                                                                                                      |  76 kB  00:00:00     
(3/5): perl-IPC-Run-0.92-2.el7.noarch.rpm                                                                                                                                                   | 122 kB  00:00:00     
(4/5): perl-Time-Duration-1.06-17.el7.noarch.rpm                                                                                                                                            |  17 kB  00:00:00     
(5/5): perl-TimeDate-2.30-2.el7.noarch.rpm                                                                                                                                                  |  52 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              505 kB/s | 308 kB  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) "
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-TimeDate-2.30-2.el7.noarch                                                                                                                                                               1/5 
  Installing : perl-Time-Duration-1.06-17.el7.noarch                                                                                                                                                           2/5 
  Installing : perl-IO-Tty-1.10-11.el7.x86_64                                                                                                                                                                  3/5 
  Installing : perl-IPC-Run-0.92-2.el7.noarch                                                                                                                                                                  4/5 
  Installing : moreutils-0.49-2.el7.x86_64                                                                                                                                                                     5/5 
  Verifying  : perl-IPC-Run-0.92-2.el7.noarch                                                                                                                                                                  1/5 
  Verifying  : moreutils-0.49-2.el7.x86_64                                                                                                                                                                     2/5 
  Verifying  : perl-IO-Tty-1.10-11.el7.x86_64                                                                                                                                                                  3/5 
  Verifying  : perl-Time-Duration-1.06-17.el7.noarch                                                                                                                                                           4/5 
  Verifying  : 1:perl-TimeDate-2.30-2.el7.noarch                                                                                                                                                               5/5 

Installed:
  moreutils.x86_64 0:0.49-2.el7                                                                                                                                                                                    

Dependency Installed:
  perl-IO-Tty.x86_64 0:1.10-11.el7                  perl-IPC-Run.noarch 0:0.92-2.el7                  perl-Time-Duration.noarch 0:1.06-17.el7                  perl-TimeDate.noarch 1:2.30-2.el7                 

Complete!

peeみつけた

コード表示

[root@61eff46d2318 yum.repos.d]# which pee
/usr/bin/pee
[root@61eff46d2318 yum.repos.d]# rpm -qf $(which pee)
moreutils-0.49-2.el7.x86_64

man peeはみれない

dockerhostのほうはみれるからな。ここらへんはおいおいりかいしていけたらいいかな

コード表示


[root@61eff46d2318 yum.repos.d]# rpm -qf $(which man)
man-db-2.6.3-11.el7.x86_64
[root@61eff46d2318 yum.repos.d]# man bash
[root@61eff46d2318 yum.repos.d]# 
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee
[root@61eff46d2318 yum.repos.d]# rpm -qf $(which pee)
moreutils-0.49-2.el7.x86_64
[root@61eff46d2318 yum.repos.d]# yum reinstall -y moreutils-0.49-2.el7.x86_64
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package moreutils.x86_64 0:0.49-2.el7 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                             Arch                                             Version                                                 Repository                                      Size
===================================================================================================================================================================================================================
Reinstalling:
 moreutils                                           x86_64                                           0.49-2.el7                                              epel                                            76 k

Transaction Summary
===================================================================================================================================================================================================================
Reinstall  1 Package

Total download size: 76 k
Installed size: 152 k
Downloading packages:
moreutils-0.49-2.el7.x86_64.rpm                                                                                                                                                             |  76 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : moreutils-0.49-2.el7.x86_64                                                                                                                                                                     1/1 
  Verifying  : moreutils-0.49-2.el7.x86_64                                                                                                                                                                     1/1 

Installed:
  moreutils.x86_64 0:0.49-2.el7                                                                                                                                                                                    

Complete!
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee
[root@61eff46d2318 yum.repos.d]# yum reinstall -y man-pages
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package man-pages.noarch 0:3.53-5.el7 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                             Arch                                             Version                                                 Repository                                      Size
===================================================================================================================================================================================================================
Reinstalling:
 man-pages                                           noarch                                           3.53-5.el7                                              base                                           5.0 M

Transaction Summary
===================================================================================================================================================================================================================
Reinstall  1 Package

Total download size: 5.0 M
Installed size: 4.6 M
Downloading packages:
man-pages-3.53-5.el7.noarch.rpm                                                                                                                                                             | 5.0 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : man-pages-3.53-5.el7.noarch                                                                                                                                                                     1/1 
  Verifying  : man-pages-3.53-5.el7.noarch                                                                                                                                                                     1/1 

Installed:
  man-pages.noarch 0:3.53-5.el7                                                                                                                                                                                    

Complete!
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee

man peeはみれない

いれたレポからとればいいんじゃね。とかおもったけどみれなかった。dockerホストと同じパッケージみてるんだけどな。

コード表示

[root@61eff46d2318 yum.repos.d]# yum install -y man-pages-de.noarch
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: ftp.riken.jp
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package man-pages-de.noarch 0:1.8-4.g7c4902d.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                              Arch                                           Version                                                    Repository                                    Size
===================================================================================================================================================================================================================
Installing:
 man-pages-de                                         noarch                                         1.8-4.g7c4902d.el7                                         epel                                         1.5 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 1.5 M
Installed size: 1.4 M
Downloading packages:
man-pages-de-1.8-4.g7c4902d.el7.noarch.rpm                                                                                                                                                  | 1.5 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : man-pages-de-1.8-4.g7c4902d.el7.noarch                                                                                                                                                          1/1 
  Verifying  : man-pages-de-1.8-4.g7c4902d.el7.noarch                                                                                                                                                          1/1 

Installed:
  man-pages-de.noarch 0:1.8-4.g7c4902d.el7                                                                                                                                                                         

Complete!
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee
[root@61eff46d2318 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, ovl
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 1.7 G of disk space (use --verbose for details)
[root@61eff46d2318 yum.repos.d]# yum update
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
epel/x86_64/metalink                                                                                                                                                                        | 6.8 kB  00:00:00     
 * base: ftp.iij.ad.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                                                                                                                                                        | 3.6 kB  00:00:00     
epel                                                                                                                                                                                        | 4.7 kB  00:00:00     
extras                                                                                                                                                                                      | 3.4 kB  00:00:00     
updates                                                                                                                                                                                     | 3.4 kB  00:00:00     
(1/7): epel/x86_64/group_gz                                                                                                                                                                 |  88 kB  00:00:00     
(2/7): base/7/x86_64/group_gz                                                                                                                                                               | 166 kB  00:00:00     
(3/7): epel/x86_64/updateinfo                                                                                                                                                               | 995 kB  00:00:00     
(4/7): extras/7/x86_64/primary_db                                                                                                                                                           | 188 kB  00:00:00     
(5/7): base/7/x86_64/primary_db                                                                                                                                                             | 6.0 MB  00:00:02     
(6/7): epel/x86_64/primary_db                                                                                                                                                               | 6.7 MB  00:00:02     
(7/7): updates/7/x86_64/primary_db                                                                                                                                                          | 4.2 MB  00:00:02     
No packages marked for update
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee
[root@61eff46d2318 yum.repos.d]# yum reinstall -y man-pages.noarch
[root@61eff46d2318 yum.repos.d]# yum reinstall -y moreutils-0.49-2.el7.x86_64
[root@61eff46d2318 yum.repos.d]# man pee
No manual entry for pee

あとがき

とりあえずepelレポいれておこう。peeでこんなに時間とってしまったぜ。

コード表示

[root@61eff46d2318 yum.repos.d]# echo ainekurainenahatomujiku | pee 'cat -' 'rev'
ainekurainenahatomujiku
ukijumotahaneniarukenia
[root@61eff46d2318 yum.repos.d]# echo ainekurainenahatomujiku | pee 'cat -' 'rev' | pee 'cat -' 'rev'
ainekurainenahatomujiku
ukijumotahaneniarukenia
ukijumotahaneniarukenia
ainekurainenahatomujiku

apacheとtomcatをdockerコンテナで作って,ajp連携できるようにした話。

参考文献

なんとなくわかる。なんかのアイディアにつかえそう。

Dockerfileを並列に結ぶコマンドを作りたい(作った?)  

Docker ARGコマンドすげぇつかえそう

Dockerfile ARG入門  
Docker Compose - docker-compose.yml リファレンス  
DockerでTomcatとNginxの構築をやってみた  
Proxy Support HOW-TO  
Apache モジュール mod_proxy  
よく見るHTTPステータスコード一覧とその意味を理解する  
Apache のリバースプロキシの設定方法  
Apache httpd と Tomcat を連携させる方法  
Apache 2.4 で リバースプロキシの設定  

ディレクトリ構成

コード表示

[oracle@centos tmp]$ tree
.
├── app
│   ├── ap
│   │   ├── Dockerfile
│   │   ├── kick.sh
│   │   └── mig
│   │       ├── cfg
│   │       │   ├── env.sh
│   │       │   └── inst.sh
│   │       ├── exe
│   │       │   └── pre.sh
│   │       └── src
│   │           └── index.html
│   ├── db
│   └── web
│       ├── Dockerfile
│       ├── kick.sh
│       └── mig
│           ├── cfg
│           │   ├── env.sh
│           │   └── inst.sh
│           ├── exe
│           │   └── pre.sh
│           └── src
│               └── index.html
└── docker-compose.yml

12 directories, 13 files

Dockerfile

ap側

コード表示

[oracle@centos tmp]$ cat $(find ./app/ap -name "D*")
FROM centos:latest

ENV TZ='Asia/Tokyo'

ENV MNT_DIR=/mnt
ENV MIG_DIR=./mig
ENV CFG_DIR=${MNT_DIR}/cfg
ENV EXE_DIR=${MNT_DIR}/exe
ENV TAR_DIR=/mnt

COPY ${MIG_DIR}/ ${MNT_DIR}/

RUN source ${CFG_DIR}/*.sh

RUN find ${TAR_DIR} -name "*.sh"
RUN chmod u+x ${CFG_DIR}/*.sh && find ${CFG_DIR} -name "*.sh" | while read line;do bash -c ${line};done
RUN chmod u+x ${EXE_DIR}/*.sh && find ${EXE_DIR} -name "*.sh" | while read line;do bash -c ${line};done

RUN sed -i -e 's/.*<role rolename="admin-gui"\/>.*/<role rolename="admin-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml
RUN sed -i -e 's/.*<role rolename="manager-gui"\/>.*/<role rolename="manager-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml
RUN sed -i -e 's/.*<user name="admin".*/<user name="admin" password="tomcat" roles="admin-gui,manager-gui"\/>/' /usr/share/tomcat/conf/tomcat-users.xml

EXPOSE 8080
CMD ["/sbin/init"]

web側

コード表示

[oracle@centos tmp]$ cat $(find ./app/web -name "D*")
FROM centos:latest

ENV TZ='Asia/Tokyo'

ENV MNT_DIR=/mnt
ENV MIG_DIR=./mig
ENV CFG_DIR=${MNT_DIR}/cfg
ENV EXE_DIR=${MNT_DIR}/exe
ENV WEB_SRC_DIR=${MIG_DIR}/src
ENV AP_SRC_DIR=${MNT_DIR}/src/ap
ENV TAR_DIR=/mnt

COPY ${MIG_DIR}/ ${MNT_DIR}/

RUN source ${CFG_DIR}/*.sh

COPY ${WEB_SRC_DIR}/*.html ${WEB_TAR_DIR}/
 
RUN find ${TAR_DIR} -name "*.sh"

RUN chmod u+x ${CFG_DIR}/*.sh && find ${CFG_DIR} -name "*.sh" | while read line;do bash -c ${line};done
RUN chmod u+x ${EXE_DIR}/*.sh && find ${EXE_DIR} -name "*.sh" | while read line;do bash -c ${line};done

EXPOSE 80
CMD ["/sbin/init"]

kick.sh

apとwebで差はない。コレ一つにまとめるスクリプトつくれそうだけど、、まだできていない。

コード表示

[oracle@centos tmp]$ diff $(echo $(find ./app/ -name "kic*"))
[oracle@centos tmp]$ cat $(find ./app/web -name "kic*")
WK_PATH=$0
EXE_PATH=$(pwd)${WK_PATH#.}
IMAGE_NAME=$1

if [ -z "${IMAGE_NAME}" ]; then
cat <<EOF
_________________________________________________________________________________
please enter build image name.

EOF
  exit 1
fi

echo "Building image '${IMAGE_NAME}' ..."

BUILD_START=$(date '+%s')
( cd ${EXE_PATH%/*};docker build --force-rm=true --no-cache=true -t ${IMAGE_NAME} -f Dockerfile . || {
  echo 'there was an error building the image.'
  exit 1
} )
BUILD_END=$(date '+%s')
BUILD_ELAPSED=$((${BUILD_END}-${BUILD_START}))

echo ''

if [ $? -eq 0 ]; then
cat <<EOF
_________________________________________________________________________________

-->${IMAGE_NAME} was built

Build completed in ${BUILD_ELAPSED} seconds.

EOF

else
  echo 'docker image was NOT successfully created'
fi

env.sh

空っぽ。ちなみに試したけど、外部ファイルの環境変数ENVコマンド以外で指定できないぽいから、除外対象ファイルとか除外文言とか定義したりして活用する見込み。

コード表示

[oracle@centos tmp]$ diff $(echo $(find ./app/ -name "env*"))
[oracle@centos tmp]$ cat $(find ./app/web -name "env*")
#!/bin/bash

inst.sh

ap側

コード表示

[oracle@centos tmp]$ cat $(find ./app/ap -name "inst*")
#!/bin/bash
yum install -y tar \ 
yum install -y curl \ 
yum install -y iputils \
yum install -y net-tools \
yum install -y iproute \
yum install -y vim \
yum install -y tree \
yum install -y lsof \
yum install -y tomcat \
yum install -y tomcat-webapps \
yum install -y tomcat-admin-webapps \
yum install -y tomcat-docs-webapp

web側

コード表示

[oracle@centos tmp]$ cat $(find ./app/web -name "inst*")
#!/bin/bash
yum install -y httpd \ 
yum install -y iputils \
yum install -y net-tools \
yum install -y iproute \
yum install -y vim \
yum install -y tree \
yum install -y lsof

pre.sh

このスクリプトいいよな。サブシェルでディレクトリ変えずに、マッチしないやつは消していく発想。ハンドリングも綺麗。

コード表示

[oracle@centos tmp]$ diff $(echo $(find ./app/ -name "pre*"))
[oracle@centos tmp]$ cat $(find ./app/ap -name "pre*")
#!/bin/bash
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;\
yum update -y;yum clean all;

index.html

コード表示

[oracle@centos tmp]$ diff $(echo $(find ./app/ -name "inde*"))
[oracle@centos tmp]$ cat $(find ./app/ap -name "inde*")
<html>
    <head>
        <title>Test Page</title>
    </head>
    <body>
        <p>This is a test.</p>
    </body>
</html>

docker-compose.yml

bashかけるんだったら、うまいことやってやろうとしたけど。そう簡単に甘くない。上書きされたりされなかったりがめんどくさいんだよな。8009ポートは外部からアクセスする必要ないので、portsではなく、expose。

コード表示

[oracle@centos tmp]$ cat $(find ./ -name "*com*")
version: '3'
services:
  apache:
    image: apache
    container_name: apa
    #command: bash -c "echo hoge"
    privileged: true
    ports:
      - '8080:80'
  tomcat:
    image: tomcat
    container_name: tom
    #command: bash -c "echo hoge"
    privileged: true
    ports:
      - '8081:8080'
    expose:
      - '8009'

dockerイメージ作成

コード表示

[oracle@centos tmp]$ bash $(find ./app/ap -name "kic*") tomcat
[oracle@centos tmp]$ bash $(find ./app/web -name "kic*") apache
[oracle@centos tmp]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
apache              latest              31ede815a512        2 minutes ago       503MB
tomcat              latest              6f8507eb4e71        4 minutes ago       681MB
centos              latest              9f38484d220f        6 weeks ago         202MB

コンテナ起動前、ブリッジ接続ルータ確認

コード表示

[oracle@centos tmp]$ brctl show
bridge name	bridge id		STP enabled	interfaces
docker0		8000.0242bccfb016	no		
virbr0		8000.5254006a2171	yes		virbr0-nic

コンテナ起動前、ip確認

コード表示

[oracle@centos tmp]$ ip a show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:d8:61:2c:f1:5b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.109/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ccc0:20d4:3aed:ca75/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: virbr0:  mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:6a:21:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic:  mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:6a:21:71 brd ff:ff:ff:ff:ff:ff
5: docker0:  mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:bc:cf:b0:16 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:bcff:fecf:b016/64 scope link 
       valid_lft forever preferred_lft forever

コンテナ起動前、ipマスカレ確認

POSTROUTING確認。一部抜粋。

コード表示

[oracle@centos tmp]$ sudo iptables -t nat -L -n
[sudo] oracle のパスワード:
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0           
RETURN     all  --  192.168.122.0/24     224.0.0.0/24        
RETURN     all  --  192.168.122.0/24     255.255.255.255     
MASQUERADE  tcp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  udp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  all  --  192.168.122.0/24    !192.168.122.0/24    
POSTROUTING_direct  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES  all  --  0.0.0.0/0            0.0.0.0/0           

dockerコンテナ起動

コード表示

[oracle@centos tmp]$ docker-compose down
Stopping tom ... done
Stopping apa ... done
Removing tom ... done
Removing apa ... done
Removing network tmp_default
[oracle@centos tmp]$ docker-compose up -d
Creating network "tmp_default" with the default driver
Creating apa ... done
Creating tom ... done
[oracle@centos tmp]$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                              NAMES
c2b460acbc07        tomcat              "/sbin/init"        54 seconds ago      Up 53 seconds       8009/tcp, 0.0.0.0:8081->8080/tcp   tom
61eff46d2318        apache              "/sbin/init"        54 seconds ago      Up 53 seconds       0.0.0.0:8080->80/tcp               apa

コンテナ起動後、ブリッジ確認

コード表示

[oracle@centos tmp]$ brctl show
bridge name	bridge id		STP enabled	interfaces
br-e1cb1ad75561		8000.02424a058b14	no		veth027f014
							veth2c1ba96
docker0		8000.0242bccfb016	no		
virbr0		8000.5254006a2171	yes		virbr0-nic

コンテナ起動後、ip確認

docker-composeだとデフォルトでbridge接続のルータできるんだな。出来たルータにコンテナのケーブルが刺さっている。

コード表示

[oracle@centos tmp]$ ip a show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:d8:61:2c:f1:5b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.109/24 brd 192.168.1.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ccc0:20d4:3aed:ca75/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: virbr0:  mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:6a:21:71 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic:  mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:6a:21:71 brd ff:ff:ff:ff:ff:ff
5: docker0:  mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:bc:cf:b0:16 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:bcff:fecf:b016/64 scope link 
       valid_lft forever preferred_lft forever
556: br-e1cb1ad75561:  mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:4a:05:8b:14 brd ff:ff:ff:ff:ff:ff
    inet 172.28.0.1/16 brd 172.28.255.255 scope global br-e1cb1ad75561
       valid_lft forever preferred_lft forever
    inet6 fe80::42:4aff:fe05:8b14/64 scope link 
       valid_lft forever preferred_lft forever
558: veth2c1ba96@if557:  mtu 1500 qdisc noqueue master br-e1cb1ad75561 state UP group default 
    link/ether fa:07:e3:4e:8e:3a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::f807:e3ff:fe4e:8e3a/64 scope link 
       valid_lft forever preferred_lft forever
560: veth027f014@if559:  mtu 1500 qdisc noqueue master br-e1cb1ad75561 state UP group default 
    link/ether d6:cf:3d:b9:7e:73 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet6 fe80::d4cf:3dff:feb9:7e73/64 scope link 
       valid_lft forever preferred_lft forever

docker network確認

tmp_default以外はデフぉである。composeでできたということ。

コード表示

[oracle@centos tmp]$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
73a8404b71c6        bridge              bridge              local
ad2f99e1e398        host                host                local
4d1d8a2fc9da        none                null                local
e1cb1ad75561        tmp_default         bridge              local

コンテナに割り当てられたip確認

コード表示

[oracle@centos tmp]$ docker network inspect $(docker network ls -q) | grep -E "Subnet|Name|IPv4|G"
        "Name": "bridge",
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
        "Name": "host",
        "Name": "none",
        "Name": "tmp_default",
                    "Subnet": "172.28.0.0/16",
                    "Gateway": "172.28.0.1"
                "Name": "apa",
                "IPv4Address": "172.28.0.2/16",
                "Name": "tom",
                "IPv4Address": "172.28.0.3/16",

コンテナ起動後、ipマスカレ確認

一部抜粋。POSTROUTINGにブリッジルータの奴が登録されている。

コード表示

[oracle@centos tmp]$ sudo iptables -t nat -L -n
[sudo] oracle のパスワード:
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  172.28.0.0/16        0.0.0.0/0           
MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0           
RETURN     all  --  192.168.122.0/24     224.0.0.0/24        
RETURN     all  --  192.168.122.0/24     255.255.255.255     
MASQUERADE  tcp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  udp  --  192.168.122.0/24    !192.168.122.0/24     masq ports: 1024-65535
MASQUERADE  all  --  192.168.122.0/24    !192.168.122.0/24    
POSTROUTING_direct  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0           
POSTROUTING_ZONES  all  --  0.0.0.0/0            0.0.0.0/0           
MASQUERADE  tcp  --  172.28.0.2           172.28.0.2           tcp dpt:80
MASQUERADE  tcp  --  172.28.0.3           172.28.0.3           tcp dpt:8080

tomcatコンテナに潜る

server.xmlのポート確認。未使用ポートになりうる、8080はクローズしておく本来は。今回は開けっぱで。

コード表示

[root@c2b460acbc07 /]# cp /etc/tomcat/{,org_}server.xml
cp: overwrite '/etc/tomcat/org_server.xml'? y
[root@c2b460acbc07 /]# diff /etc/tomcat/{,org_}server.xml
[root@c2b460acbc07 /]# cat ./etc/tomcat/server.xml | grep -A 10 "Connector port="
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">

webappsでググる。ここらのフォルダは削除してあらたに作っていってもいいんだよな。そっちの方がすっきりする。参考程度のコンテナきってもいいし。何かモノ作る時には削除しよう。web.xmlも大事だ。

コード表示

[root@c2b460acbc07 /]# find . -name "*webapps*"
./usr/share/tomcat/webapps
./var/lib/yum/yumdb/t/6343923fac93857eecb0cd7fd4ff8015ec401c66-tomcat-admin-webapps-7.0.76-9.el7_6-noarch
./var/lib/yum/yumdb/t/47c2512fc616bb948c785d40da7093e19239019d-tomcat-webapps-7.0.76-9.el7_6-noarch
./var/lib/tomcat/webapps
[root@c2b460acbc07 /]# diff -r /usr/share/tomcat/webapps /var/lib/tomcat/webapps
[root@c2b460acbc07 /]# ll /usr/share/tomcat/webapps
lrwxrwxrwx. 1 root tomcat 23 Apr 30 22:17 /usr/share/tomcat/webapps -> /var/lib/tomcat/webapps
[root@c2b460acbc07 /]# ll /var/lib/tomcat/webapps
total 24
drwxr-xr-x.  3 tomcat tomcat 4096 Apr 30 22:17 ROOT
drwxr-xr-x. 14 root   root   4096 Apr 30 22:17 docs
drwxr-xr-x.  8 tomcat tomcat 4096 Apr 30 22:17 examples
drwxr-xr-x.  5 root   tomcat 4096 Apr 30 22:17 host-manager
drwxr-xr-x.  5 root   tomcat 4096 Apr 30 22:17 manager
drwxr-xr-x.  5 tomcat tomcat 4096 Apr 30 22:17 sample
[root@c2b460acbc07 /]# find . -name "*web.xml*"
./usr/share/mime/application/vnd.oasis.opendocument.text-web.xml
./var/lib/tomcat/webapps/ROOT/WEB-INF/web.xml
./var/lib/tomcat/webapps/sample/WEB-INF/web.xml
./var/lib/tomcat/webapps/host-manager/WEB-INF/web.xml
./var/lib/tomcat/webapps/manager/WEB-INF/web.xml
./var/lib/tomcat/webapps/examples/WEB-INF/web.xml
./var/lib/tomcat/webapps/docs/appdev/web.xml.txt
./var/lib/tomcat/webapps/docs/appdev/sample/web/WEB-INF/web.xml
./var/lib/tomcat/webapps/docs/WEB-INF/web.xml
./etc/tomcat/web.xml

サービス起動

コード表示

[root@c2b460acbc07 /]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@c2b460acbc07 /]# systemctl start tomcat
[root@c2b460acbc07 /]# systemctl status tomcat
● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-05-01 15:16:50 JST; 1s ago
 Main PID: 5725 (java)
   CGroup: /docker/c2b460acbc0728e00a4443375d97e70d4caebdb487aa3a54538f78fc06f4932f/system.slice/tomcat.service
           └─5725 /usr/lib/jvm/jre/bin/java -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina...
           ‣ 5725 /usr/lib/jvm/jre/bin/java -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina...

May 01 15:16:51 c2b460acbc07 server[5725]: May 01, 2019 6:16:51 AM org.apache.catalina.startup.TldConfig execute
May 01 15:16:51 c2b460acbc07 server[5725]: INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned b...pilation time.
May 01 15:16:51 c2b460acbc07 server[5725]: May 01, 2019 6:16:51 AM org.apache.catalina.startup.HostConfig deployDirectory
May 01 15:16:51 c2b460acbc07 server[5725]: INFO: Deployment of web application directory /var/lib/tomcat/webapps/docs has finished in 114 ms
May 01 15:16:51 c2b460acbc07 server[5725]: May 01, 2019 6:16:51 AM org.apache.coyote.AbstractProtocol start
May 01 15:16:51 c2b460acbc07 server[5725]: INFO: Starting ProtocolHandler ["http-bio-8080"]
May 01 15:16:51 c2b460acbc07 server[5725]: May 01, 2019 6:16:51 AM org.apache.coyote.AbstractProtocol start
May 01 15:16:51 c2b460acbc07 server[5725]: INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 01 15:16:51 c2b460acbc07 server[5725]: May 01, 2019 6:16:51 AM org.apache.catalina.startup.Catalina start
May 01 15:16:51 c2b460acbc07 server[5725]: INFO: Server startup in 955 ms
Hint: Some lines were ellipsized, use -l to show in full.
[root@c2b460acbc07 /]# lsof -i:8009 -i:8080 -P
COMMAND  PID   USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
java    5725 tomcat   49u  IPv4 670144588      0t0  TCP *:8080 (LISTEN)
java    5725 tomcat   50u  IPv4 670144589      0t0  TCP *:8009 (LISTEN)

apacheにもぐる

noindexでぐぐると、デフぉ頁のふぁいるでてくる。ちなみに/var/www/htmlにファイル置いているとtomcatのデフォルトページがでないんだね。

コード表示

[oracle@centos ~]$ docker exec -it apa /bin/bash
[root@61eff46d2318 /]# find / -name "*noindex*"
/usr/share/httpd/noindex
[root@61eff46d2318 /]# cd /usr/share/httpd/noindex
[root@61eff46d2318 noindex]# ll
total 16
drwxr-xr-x. 3 root root 4096 Apr 30 22:19 css
drwxr-xr-x. 2 root root 4096 Apr 30 22:19 images
-rw-r--r--. 1 root root 4897 Oct 16  2014 index.html
[root@61eff46d2318 noindex]# cd ..
[root@61eff46d2318 httpd]# ll
total 12
drwxr-xr-x. 3 root root 4096 Apr 30 22:19 error
drwxr-xr-x. 3 root root 4096 Apr 30 22:19 icons
drwxr-xr-x. 4 root root 4096 Apr 30 22:19 noindex

asobu。起動したりすれば、staticなページをcurlで標準出力したりできる。

コード表示

[root@61eff46d2318 httpd]# cd /var/www/html
[root@61eff46d2318 html]# ll 
total 0
[oracle@centos ~]$ docker exec -it apa /bin/bash
[root@61eff46d2318 /]# cd /var/www/html
[root@61eff46d2318 html]# cat <<ROD >index.html
> <html>
>     <head>
>         <title>Test Page</title>
>     </head>
>     <body>
>         <p>ainekurainenahatomujiku</p>
>     </body>
> </html>
> ROD
[root@61eff46d2318 html]# cat ind*
<html>
    <head>
        <title>Test Page</title>
    </head>
    <body>
        <p>ainekurainenahatomujiku</p>
    </body>
</html>
[root@61eff46d2318 html]# ll
total 4
-rw-r--r--. 1 root root 133 May  1 15:21 index.html
[root@61eff46d2318 html]# mkdir -p {aine,kuraine,nahato,mujiku}
[root@61eff46d2318 html]# tree
.
|-- aine
|-- index.html
|-- kuraine
|-- mujiku
`-- nahato

4 directories, 1 file
[root@61eff46d2318 html]# printf '%s\n' {aine,kuraine,nahato,mujiku} | xargs -I@ bash -c 'echo cp index.html @'
cp index.html aine
cp index.html kuraine
cp index.html nahato
cp index.html mujiku
[root@61eff46d2318 html]# printf '%s\n' {aine,kuraine,nahato,mujiku} | xargs -I@ bash -c 'cp index.html @'
[root@61eff46d2318 html]# tree
.
|-- aine
|   `-- index.html
|-- index.html
|-- kuraine
|   `-- index.html
|-- mujiku
|   `-- index.html
`-- nahato
    `-- index.html

4 directories, 5 files
[root@61eff46d2318 html]# ll
total 36
drwxr-xr-x. 2 root root 4096 May  1 15:22 aine
-rw-r--r--. 1 root root  133 May  1 15:21 index.html
drwxr-xr-x. 2 root root 4096 May  1 15:22 kuraine
drwxr-xr-x. 2 root root 4096 May  1 15:22 mujiku
drwxr-xr-x. 2 root root 4096 May  1 15:22 nahato
[root@61eff46d2318 html]# printf '%s\n' 'http://192.168.1.109:8080/'{aine,kuraine,nahato,mujiku}'/index.html'
http://192.168.1.109:8080/aine/index.html
http://192.168.1.109:8080/kuraine/index.html
http://192.168.1.109:8080/nahato/index.html
http://192.168.1.109:8080/mujiku/index.html
[root@61eff46d2318 html]# printf '%s\n' 'curl -v http://192.168.1.109:8080/'{aine,kuraine,nahato,mujiku}'/index.html' | xargs -I@ bash -c '@'
* About to connect() to 192.168.1.109 port 8080 (#0)
*   Trying 192.168.1.109...
* No route to host
* Failed connect to 192.168.1.109:8080; No route to host
* Closing connection 0
curl: (7) Failed connect to 192.168.1.109:8080; No route to host
* About to connect() to 192.168.1.109 port 8080 (#0)
*   Trying 192.168.1.109...
* No route to host
* Failed connect to 192.168.1.109:8080; No route to host
* Closing connection 0
curl: (7) Failed connect to 192.168.1.109:8080; No route to host
* About to connect() to 192.168.1.109 port 8080 (#0)
*   Trying 192.168.1.109...
* No route to host
* Failed connect to 192.168.1.109:8080; No route to host
* Closing connection 0
curl: (7) Failed connect to 192.168.1.109:8080; No route to host
* About to connect() to 192.168.1.109 port 8080 (#0)
*   Trying 192.168.1.109...
* No route to host
* Failed connect to 192.168.1.109:8080; No route to host
* Closing connection 0
curl: (7) Failed connect to 192.168.1.109:8080; No route to host

httpd.confに追加

脱線したけど、これが大切。ipはdockerコンテナのapaにallocateされているip。

コード表示

[root@61eff46d2318 /]# cp /etc/httpd/conf/{,org_}httpd.conf
[root@61eff46d2318 /]# diff /etc/httpd/conf/{,org_}httpd.conf
[root@61eff46d2318 /]# vi /etc/httpd/conf/httpd.conf
[root@61eff46d2318 /]# diff /etc/httpd/conf/{,org_}httpd.conf
354,356d353
< ProxyRequests Off
< ProxyPass / ajp://172.28.0.3/
< ProxyPassReverse / ajp://172.28.0.3/

httpdサービス起動

コード表示

[root@61eff46d2318 /]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:httpd(8)
           man:apachectl(8)
[root@61eff46d2318 /]# systemctl start httpd.service
[root@61eff46d2318 /]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2019-05-01 15:30:03 JST; 1s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 5954 (httpd)
   Status: "Processing requests..."
   CGroup: /docker/61eff46d23187594f7efef2c6d7dee336011a869d9c014c8144a8b2d35290783/system.slice/httpd.service
           ├─5954 /usr/sbin/httpd -DFOREGROUND
           ├─5955 /usr/sbin/httpd -DFOREGROUND
           ├─5956 /usr/sbin/httpd -DFOREGROUND
           ├─5957 /usr/sbin/httpd -DFOREGROUND
           ├─5958 /usr/sbin/httpd -DFOREGROUND
           └─5959 /usr/sbin/httpd -DFOREGROUND
           ‣ 5954 /usr/sbin/httpd -DFOREGROUND

May 01 15:30:03 61eff46d2318 systemd[1]: Starting The Apache HTTP Server...
May 01 15:30:03 61eff46d2318 httpd[5954]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.28.0.2. Set the 'ServerName' directive globally to suppress this message
May 01 15:30:03 61eff46d2318 systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.

ブラウザから確認。それぞれ同じ画面が出ていればOK。

tomcatのほう。managerはユーザー名とパスワードはtomcat/adminかな

コード表示

http://192.168.1.109:8081/docs
http://192.168.1.109:8081/sample
http://192.168.1.109:8081/example
http://192.168.1.109:8081/manager/html

apacheのほう

コード表示

http://192.168.1.109:8080/docs
http://192.168.1.109:8080/sample
http://192.168.1.109:8080/example
http://192.168.1.109:8080/manager/html

ログ確認。apacheにもtomcatにも同じログでているね。

tomcat側

コード表示

[root@c2b460acbc07 /]# find /var -name "*log*"
/var/lib/systemd/catalog
/var/lib/yum/yumdb/a/0be125f712efee4727af884ffa4a21b3d366a71e-avalon-logkit-2.1-14.el7-noarch
/var/lib/yum/yumdb/a/e6cbbc5407023b2bee22d34231a4266b69d0ea4c-apache-commons-logging-1.1.2-7.el7-noarch
/var/lib/yum/yumdb/l/fcb0a245a2d3b4e92b76136762f22caf2e7fe5f7-log4j-1.2.17-16.el7_4-noarch
/var/lib/tomcat/webapps/ROOT/asf-logo-wide.svg
/var/lib/tomcat/webapps/host-manager/images/asf-logo.svg
/var/lib/tomcat/webapps/manager/images/asf-logo.svg
/var/lib/tomcat/webapps/examples/jsp/security/protected/login.jsp
/var/lib/tomcat/webapps/examples/jsp/security/protected/login.jsp.html
/var/lib/tomcat/webapps/examples/jsp/cal/login.html
/var/lib/tomcat/webapps/examples/servlets/chat/login.jsp
/var/lib/tomcat/webapps/examples/servlets/chat/login.jsp.html
/var/lib/tomcat/webapps/docs/images/asf-logo.svg
/var/lib/tomcat/webapps/docs/logging.html
/var/lib/tomcat/webapps/docs/changelog.html
/var/log
/var/log/yum.log
/var/log/lastlog
/var/log/tallylog
/var/log/tomcat/catalina.2019-05-01.log
/var/log/tomcat/localhost.2019-05-01.log
/var/log/tomcat/localhost_access_log.2019-05-01.txt
/var/log/tomcat/manager.2019-05-01.log
/var/log/tomcat/host-manager.2019-05-01.log
[root@c2b460acbc07 /]# tail -f /var/log/tomcat/localhost_access_log.2019-05-01.txt
192.168.1.109 - - [01/May/2019:06:34:19 +0000] "GET / HTTP/1.1" 200 11217
192.168.1.109 - - [01/May/2019:06:37:33 +0000] "GET /docs HTTP/1.1" 302 -
192.168.1.109 - - [01/May/2019:06:37:33 +0000] "GET /docs/ HTTP/1.1" 304 -
192.168.1.109 - - [01/May/2019:06:46:18 +0000] "GET / HTTP/1.1" 200 11197
192.168.1.109 - - [01/May/2019:06:46:32 +0000] "GET /docs HTTP/1.1" 302 -
192.168.1.109 - - [01/May/2019:06:46:39 +0000] "GET /docs/introduction.html HTTP/1.1" 200 15227
192.168.1.109 - - [01/May/2019:06:46:42 +0000] "GET /docs/jndi-resources-howto.html HTTP/1.1" 200 58181
192.168.1.109 - - [01/May/2019:06:46:43 +0000] "GET /docs/manager-howto.html HTTP/1.1" 200 80158
192.168.1.109 - - [01/May/2019:06:46:43 +0000] "GET /docs/jasper-howto.html HTTP/1.1" 200 26829
192.168.1.109 - - [01/May/2019:06:46:44 +0000] "GET /docs/mbeans-descriptors-howto.html HTTP/1.1" 200 10795

apache側

コード表示

[root@61eff46d2318 /]# find /var -name "*log*"
/var/lib/systemd/catalog
/var/lib/yum/yumdb/c/b3f16e3c1bff41f2602b03b90e2f37b26e59400b-centos-logos-70.0.6-3.el7.centos-noarch
/var/log
/var/log/yum.log
/var/log/lastlog
/var/log/tallylog
/var/log/httpd/access_log
/var/log/httpd/error_log
[root@61eff46d2318 /]# tail -f /var/log/httpd/access_log
192.168.1.109 - - [01/May/2019:06:34:18 +0000] "-" 408 - "-" "-"
192.168.1.109 - - [01/May/2019:06:34:19 +0000] "-" 408 - "-" "-"
192.168.1.109 - - [01/May/2019:06:34:34 +0000] "GET /docs HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:35:07 +0000] "GET /docs HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:35:08 +0000] "GET /docs HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:35:09 +0000] "GET /docs HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:36:00 +0000] "-" 408 - "-" "-"
192.168.1.109 - - [01/May/2019:06:37:33 +0000] "GET /docs HTTP/1.1" 302 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:37:33 +0000] "GET /docs/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:38:24 +0000] "-" 408 - "-" "-"
192.168.1.109 - - [01/May/2019:06:46:18 +0000] "GET / HTTP/1.1" 200 11197 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:32 +0000] "GET /docs HTTP/1.1" 302 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:39 +0000] "GET /docs/introduction.html HTTP/1.1" 200 15227 "http://192.168.1.109:8080/docs/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:42 +0000] "GET /docs/jndi-resources-howto.html HTTP/1.1" 200 58181 "http://192.168.1.109:8080/docs/introduction.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:43 +0000] "GET /docs/manager-howto.html HTTP/1.1" 200 80158 "http://192.168.1.109:8080/docs/jndi-resources-howto.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:43 +0000] "GET /docs/jasper-howto.html HTTP/1.1" 200 26829 "http://192.168.1.109:8080/docs/manager-howto.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:46:44 +0000] "GET /docs/mbeans-descriptors-howto.html HTTP/1.1" 200 10795 "http://192.168.1.109:8080/docs/jasper-howto.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"
192.168.1.109 - - [01/May/2019:06:47:30 +0000] "-" 408 - "-" "-"

自作マシンつくった centos7

OSはUSBメモリにWin7から焼いたものを使ってUSBBootでインスト。17万ぐらいかな。。ケースもう少し大きめのにしておけばよかったかも。USB3.0の差込口がケースのケーブルホルダの位置と少しかぶって差しづらかった。ケースとマザボの相性大事ってことが今回で分かった。

初めてにしてはうまく組み立てることができた。。

OS

USBboot用のcentos7(isoイメージファイル)

PCケース

優れた拡張性を備えた強化ガラス採用ATX対応ミドルタワーPCケース P110 Luce
https://www.amazon.co.jp/gp/product/B073XZJ4Z9/ref=oh_aui_detailpage_o08_s00?ie=UTF8&psc=1

CPUクーラー

Thermaltake Floe Riing RGB 240 TT Premium Edition 一体型水冷CPUクーラー [RGB LED 搭載] FN1116 CL-W157-PL12SW-A
https://www.amazon.co.jp/gp/product/B076F78ZP6/ref=ppx_yo_dt_b_detailpage_o08_s01?ie=UTF8&psc=1

メモリ

商品名:CORSAIR DDR4 デスクトップPC用 メモリモジュール VENGEANCE LPX Series 16GB×1枚キット CMK16GX4M1A2666C16、数量:2
https://www.amazon.co.jp/gp/product/B019HVO62A/ref=ppx_yo_dt_b_detailpage_o08_s01?ie=UTF8&psc=1

マザボ

MSI Z390-A PRO ATX マザーボード [Intel Z390チップセット搭載] MB4617
https://www.amazon.co.jp/gp/product/B07J6Q956G/ref=ppx_yo_dt_b_detailpage_o08_s01?ie=UTF8&psc=1

CPU

Intel CPU Core i7-8700K 3.7GHz 12Mキャッシュ 6コア/12スレッド LGA1151 BX80684I78700K 【BOX】
https://www.amazon.co.jp/gp/product/B07598VZR8/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

モニタ

ASUS ディスプレイ モニター 21.5型 ( VA / 178°広視野角 / フルHD / HDMI, DVI-D, D-Sub / 3年保証 ) VS229HA
https://www.amazon.co.jp/gp/product/B01DOWUCG2/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

SSD

Samsung SSD 500GB 970 EVO M.2 Type2280 PCIe3.0×4 NVMe1.3 5年保証 正規代理店保証品 MZ-V7E500B/EC
https://www.amazon.co.jp/gp/product/B07CKX6S7H/ref=ppx_od_dt_b_detailpages01?ie=UTF8&psc=1

電源ユニット

Thermaltake TOUGHPOWER GRAND RGB -850W -NON DPS- 80+GOLD PC電源ユニット PS673 PS-TPG-0850FPCGJP-R
https://www.amazon.co.jp/gp/product/B01MXY5350/ref=ppx_od_dt_b_detailpages01?ie=UTF8&psc=1

備品

Wifiに参加させるために一つ買った。
BUFFALO 11n/a/g/b 300Mbps 簡単無線LAN子機 WLI-UTX-AG300/C
https://www.amazon.co.jp/gp/product/B008MRUINC/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1