Upgrade to Pro — share decks privately, control downloads, hide ads and more …

オンプレ to オンプレした話/on-premises2on-premises

Taiju Aoki
August 28, 2020

オンプレ to オンプレした話/on-premises2on-premises

Taiju Aoki

August 28, 2020
Tweet

More Decks by Taiju Aoki

Other Decks in Programming

Transcript

  1. ΦϯϓϨ to ΦϯϓϨͨ͠࿩ @blue_1617

  2. ࢲ͸୭ʁ blue (@blue_1617) https://blue0513.github.io/show_room/ 2 ‣ ΨʔϦΟϨίʔυνϟϯωϧ ‣ ࠷ۙ΍ͬͯΔ͜ͱ /

    ϋϚ͍ͬͯΔ͜ͱ ‣ ϙέϞϯιʔυ&γʔϧυ ‣ Magic: The Gathering ‣ ࣍ʹ΍Γ͍ͨ͜ͱ ‣ Fall Guys
  3. ͜ͷൃද͸ʁ 3 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ AWS GCP Terraform Cloud Azure Ansible Digdag

    MicroService ʢM3ͷάϧʔϓձࣾʣ
  4. ͜ͷൃද͸ʁ 4 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ AWS GCP Terraform Cloud Azure Ansible Digdag

    MicroService ग़͖ͯ·ͤΜɻѱ͔͠Βͣ ʢM3ͷάϧʔϓձࣾʣ
  5. ͜ͷൃද͸ʁ 5 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ ֎஫ઌ ΦϯϓϨ ֤छΞϓϦ ๭ࣾ ෺ཧ

  6. ͜ͷൃද͸ʁ 6 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ ֎஫ઌ ΦϯϓϨ ΦϯϓϨ ๭ࣾ VM

  7. 7 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ Batchॲཧαʔό ໊دͤॲཧαʔό Database ΞϓϦέʔγϣϯ Windows αʔό Oracle SE

    11g Windows Forms .bat .exe = = = JP1 αʔό ͜ͷൃද͸ʁ
  8. 8 ๭ࣾ๭ϓϩδΣΫτͷαʔόΛҠߦ͢Δ࿩ ͜ͷൃද͸ʁ ֎஫ઌ ΦϯϓϨ ϓϩδΣΫτ։࢝: 4݄ Ϧϛοτ: 9݄ॳ० ओཁϝϯόʔ:

    4ਓ Ϛωʔδϟ * 1 Πϯϑϥ * 1 ΞϓϦ * 2 Ҡߦͷརӹ: Nઍສԁ/೥
  9. 9 ͬ͘͟ΓΠϯϑϥߏ੒ਤ ຊ൪ ݕূ Batch ໊دͤ JP1 ڞ༗σΟϨΫτϦA ڞ༗σΟϨΫτϦB Batch

    ໊دͤ JP1 ΦϑΟε
  10. 10 ͬ͘͟ΓΠϯϑϥߏ੒ਤ ຊ൪ ݕূ Batch ໊دͤ JP1 ڞ༗σΟϨΫτϦA ڞ༗σΟϨΫτϦB Batch

    ໊دͤ JP1 ΦϑΟε
  11. 11 ͬ͘͟ΓΠϯϑϥߏ੒ਤ ຊ൪ ݕূ Batch ໊دͤ JP1 ڞ༗σΟϨΫτϦA Batch/DB ໊دͤ

    ΦϑΟε
  12. ࡞ઓ

  13. 13 ࡞ઓ 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ

    4. ੾Γସ͑౰೔ 5. ݱ࣮
  14. 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ

  15. 15 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ ݕূ؀ڥͱຊ൪؀ڥͰ ‣ αʔόͷ਺ ‣ αʔόͷछྨ ‣ ωοτϫʔΫ

    ͕ҟͳ͍ͬͯͨ 1. ݕূ؀ڥΛҠߦͯ͠ɺϊ΢ϋ΢ΛஷΊͯຊ൪΋Ҡߦ 2. ݕূ؀ڥΛຊ൪؀ڥͱಉ͡ߏ੒ʹ͔ͯ͠ΒҠߦ
  16. 16 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ ݕূ؀ڥͱຊ൪؀ڥͰ ‣ αʔόͷ਺ ‣ αʔόͷछྨ ‣ ωοτϫʔΫ

    ͕ҟͳ͍ͬͯͨ ݕূ؀ڥͷҠߦϊ΢ϋ΢͸ຊ൪Ͱ໾ʹཱͨͳ͍ & Ҡߦʹ͔͚ΒΕΔ͕࣌ؒগͳ͍ ݕূ؀ڥ͸ஔ͍ͱ͍ͯɺຊ൪؀ڥ͔Β΍Δͧ
  17. 17 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ clone ֤ͨ͠αʔόʔΛผ Host ໊ʹͯ͠ಈ࡞ݕূʢޙड़ʣ ͱ͸͍͑ɺຊ൪ҰൃΤΠϠͰ͸ͳ͍ ֎஫ઌ ΦϯϓϨ

    ΦϯϓϨ ๭ࣾ VM P2V ෺ཧ
  18. 2. ωοτϫʔΫɺݽཱɺःஅͯ͠

  19. 19 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ ֎஫ઌ Batch ໊دͤ JP1 ΦϑΟε

  20. 20 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 ΦϑΟε P2V ֎஫ઌ

  21. 21 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 ΦϑΟε Batch ໊دͤ JP1

    ֎஫ઌ
  22. 22 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 ΦϑΟε Batch 2 ໊دͤ

    2 JP1 2 DB 2 DB ϗετ໊Λมߋ ֎஫ઌ
  23. 23 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch εέδϡʔϦϯάδϣϒ: ͋Δ....͔΋͠Εͳ͍ʁ τϦΨʔ: ͋Δ....͔΋͠Εͳ͍ʁ JP1 ΋͋ͬͨ͠৔߹ɺՔಇதຊ൪DBʹมߋΛՃ͔͑Ͷͳ͍

    Digdag ΍ Jenkins తͳΦʔτϝʔγϣϯπʔϧ Կ͕ಈ͍ͯΔ͔ਖ਼௚Θ͔ΒΜ....... ෳࡶͳδϣϒͨͪ Կ͕͍ͭಈ͍ͯΔ͔Θ͔ΒΜ http://itdoc.hitachi.co.jp/manuals/3020/30203S0933/AJSV0099.HTM
  24. 24 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 Batch 2 ֎஫ઌ ΦϑΟε

    JP1 2
  25. 25 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ https://www.rakuten.ne.jp/gold/trycycle/smart/basic06.html

  26. 26 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ https://www.rakuten.ne.jp/gold/trycycle/smart/basic06.html αʔόʔΛਫʹ௜Ίͯ Ͳ͔͜Β௨৴͕࿙ΕͯΔ͔Λ ֬ೝ͢Δ

  27. 27 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 Batch 2 ໊دͤ 2

    JP1 2 DB 2 DB ωοτϫʔΫ͔Βݽཱͤ͞Δ
  28. 28 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ http://www.pc2.jp/tips/err_log.html ֎ʹΞΫηε͠Α͏ͱ͢Δϓϩηε͸ɺΤϥʔϩάʹه࿥͞ΕΔ ด࠯ωοτʹ௜ΊͨΒΤϥʔϩάΛ֬ೝͯ҆͠શΛ֬ೝ ʢΤϥʔͰͯͳ͍͔ΒDBʹ΋ΞΫηε͠ͳ͍ żŢ!!ʣ

  29. 29 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch ໊دͤ JP1 Batch 2 ໊دͤ 2

    JP1 2 DB 2 DB ֬ೝޙɺ੖ΕͯυϝΠϯࢀՃ
  30. 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ

  31. 31 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB
  32. 32 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB https://www.itmedia.co.jp/enterprise/articles/0910/14/news003.html Host ໊Ͱδϣϒ࣮ߦ
  33. 33 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB SET DB_HOST = ຊ൪DB SET SERVER = ຊ൪SERVER DELETE * FROM FOO; # BT01002Batch.exe, .bat etc ؀ڥม਺௚ॻ͖
  34. 34 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB SET DB_HOST = ຊ൪DB SET SERVER = ຊ൪SERVER DELETE * FROM FOO; # BT01002Batch.exe, .bat etc ؀ڥม਺௚ॻ͖ Ͳͷ .exe Λୟ͘ͱຊ൪ʹӨڹ͋Δͷ͔Θ͔ΒΜɻ͜Θ͍
  35. 35 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ C:\Windows\System32\drivers\etc\hosts http://www.obenri.com/_dnsserver/hosts_file.html

  36. 36 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ C:\Windows\System32\drivers\etc\hosts http://www.obenri.com/_dnsserver/hosts_file.html 127.0.0.1 Քಇதຊ൪DB 127.0.0.1

    Քಇதຊ൪Server1 127.0.0.1 Քಇதຊ൪Server2 127.0.0.1 Քಇதຊ൪Server3 ؔ܎αʔόʔΛ͢΂ͯϩʔΧϧϗετΛ޲͚ͯ͠·͏
  37. 37 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB https://www.itmedia.co.jp/enterprise/articles/0910/14/news003.html IP Λ͝·͔ͯ͠ΔͷͰ ϩʔΧϧϗετΛݟʹߦ͘
  38. 38 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch ໊دͤ JP1 Batch 2

    ໊دͤ 2 JP1 2 DB 2 DB 127.0.0.1ͷน
  39. 39 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch 2 ໊دͤ 2 JP1

    2 DB 2 127.0.0.1ͷน ૄ௨֬ೝ Ϣʔβݖݶ ੑೳࢼݧ ֤छ࣮ݧ DB exp/imp
  40. 4. ੾Γସ͑౰೔

  41. 41 4. ੾Γସ͑౰೔ Batch ໊دͤ JP1 Batch 2 ໊دͤ 2

    JP1 2 DB 2 DB 127.0.0.1ͷน ωοτϫʔΫ੾Γ཭͠
  42. 42 4. ੾Γସ͑౰೔ Batch 2 ໊دͤ 2 JP1 2 DB

    2 127.0.0.1ͷน
  43. 43 4. ੾Γସ͑౰೔ Batch ໊دͤ JP1 DB 127.0.0.1ͷน ϗετ໊मਖ਼

  44. 44 4. ੾Γସ͑౰೔ Batch ໊دͤ JP1 DB นͷఫഇ # 127.0.0.1

    Քಇதຊ൪DB # 127.0.0.1 Քಇதຊ൪Server1 # 127.0.0.1 Քಇதຊ൪Server2 # 127.0.0.1 Քಇதຊ൪Server3
  45. 45 4. ੾Γସ͑౰೔ Batch ໊دͤ JP1 DB

  46. 46 4. ੾Γସ͑౰೔ ֎஫ઌ Batch ໊دͤ JP1 ΦϑΟε Batch ໊دͤ

    JP1 ֎஫ઌͷΦϯϓϨαʔόʔ͔Β ࣗࣾͷΦϯϓϨαʔόʔʹ੾Γସ͑ΒΕͨ
  47. 47 4. ੾Γସ͑౰೔ ׬ྃʂʂ

  48. 5. ݱ࣮

  49. 49 5. ݱ࣮ ‣ ݕূதʹຊ൪DBʹରͯ͠δϣϒ࣮ߦͪ͠Όͬͨ ‣ Ҡߦޙॳ೔ɺDBͷҰҙΩʔ੍໿Ͱ Error ‣ Ҡߦޙॳ೔ɺFTPΫϥΠΞϯτͷόάͰग़ྗ

    0 ‣ ݕূ؀ڥ·ͩҠߦͯ͠ͳ͍ and more ..... JP1ͰεέδϡʔϦϯάδϣϒͷର৅αʔό: null ʹઃఆ ର৅αʔό: null == JP1αʔόʔࣗ਎ ͳͷͰɺࣗ෼ʹରͯ͠δϣϒൃߦ ڞ༗αʔόͷ exe Λୟ͍ͯຊ൪DBͷεΩʔϚ Drop ͠Α͏ͱͯͨ͠ʢfail ͨ͠ʣ Oracle ७ਖ਼ͷ export/import πʔϧͰ DB ΛϑϧϦετΞ SequenceObject Λ Overwrite Ͱ͖ͣɺݹ͍ Sequence ͕࢒Δ next val Ͱࢦఆ͞ΕΔ id ʹ͸͢ͰʹϨίʔυ͕ଘࡏͯ͠Δʢखಈ inc ͨ͠ʣ Windows ଆͷόάɻύονΛ౰ͯΔͱ௚ͬͨɻ͔ͦ͜Α
  50. ৼΓฦΓ

  51. 51 ৼΓฦΓ ‣ ຊ൪ͱΠϯϑϥߏ੒Λἧ͑ͨݕূ؀ڥΛ༻ҙ͢Δ ‣ ࣗಈςετΛ࡞Δ ‣ JP1 Λ΍ΊΔ ‣

    ࠷ॳ͔Βผ෦ॺͷਓؒΛר͖ࠐΜͰҠߦΛਐΊΔ ‣ ຊ൪؀ڥͰӨڹൣғʹؾΛ͚ͭͳ͕Β࡞ۀ͢Δͷ͸ຊ౰ʹ͖͍ͭ ‣ υϝΠϯ஌͕ࣝͳ͍ঢ়ଶͰಈ͔͢ͱຊ౰ʹ͙͢ʹো֐ʹͳΔ ‣ ҰݸҰݸख࡞ۀͰ֬ೝ͢Δͷ͸ຊ౰ʹਫ਼ਆతʹͭΒ͍ ‣ ୀ۶ͳ͜ͱ͸ίϯϐϡʔλʹ΍ΒͤΕ͹ΑΖ͍͠ ‣ ͳΜ΋Θ͔ΒΜ ‣ ԿΛීஈͷۀ຿Ͱಈ͔ͯ͠ɺͲ͏֬ೝ͢Ε͹͍͍ͷ͔Θ͔ΒΜ ‣ ౰ࣄऀΛר͖ࠐΜͰQAͳΓܭըͳΓ࿈བྷͳΓऔͬͨํ͕ૣ͍
  52. 52 ৼΓฦΓ ‣ υϝΠϯ஌ࣝΛ͖ͪΜͱ͚ͭΔ ‣ ؔΘͬͯ͘Εͨօ͞Μʹ͸ײँ͔͠ͳ͍ ‣ υϝΠϯ஌͕ࣝͳ͍ঢ়ଶͰಈ͔͢ͱຊ౰ʹ͙͢ʹো֐ʹͳΔ ‣ αʔόʔͷಈ࡞֬ೝ΍ܭըΛϝΠϯͰ୲౰͚ͨ͠ͲɺΠϯϑϥͷ

    ํͷര଎࡞ۀ΍ϚωʔδϟͷํͷυϝΠϯ஌ࣝɺϕςϥϯEngͷ ΞυόΠεʹ͸ຊ౰ʹॿ͚ΒΕ·ͨ͠ ‣ Πϯϑϥ as ίʔυ is ΊͬͪΌ important ‣ ͜ͷαʔόͰԿ͕ಈ͘ͷ͔Βͷௐࠪ͸ຊ౰ʹେม ‣ ख࡞ۀͰ /etc/hosts ॻ͖׵͑ͨΓ tnsnames.ora ॻ͖׵͑ͨΓ config ॻ͖׵͑ͨΓωοτϫʔΫ͍ͬͨ͡Γ͸ຊ౰ʹ͖͍ͭ ‣ ϨϏϡʔͰ͖Δɺঢ়ଶ͕ݟ͑Δঢ়ଶͰ࢒Δɺຊ౰ʹେࣄ
  53. 53 to be continued .....