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

    ϋϚ͍ͬͯΔ͜ͱ ‣ ϙέϞϯιʔυ&γʔϧυ ‣ Magic: The Gathering ‣ ࣍ʹ΍Γ͍ͨ͜ͱ ‣ Fall Guys
  2. 15 1. Զ͸ɺݕূ؀ڥΛɺࣺͯΔ ݕূ؀ڥͱຊ൪؀ڥͰ ‣ αʔόͷ਺ ‣ αʔόͷछྨ ‣ ωοτϫʔΫ

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

    ͕ҟͳ͍ͬͯͨ ݕূ؀ڥͷҠߦϊ΢ϋ΢͸ຊ൪Ͱ໾ʹཱͨͳ͍ & Ҡߦʹ͔͚ΒΕΔ͕࣌ؒগͳ͍ ݕূ؀ڥ͸ஔ͍ͱ͍ͯɺຊ൪؀ڥ͔Β΍Δͧ
  4. 23 2. ωοτϫʔΫɺݽཱɺःஅͯ͠ Batch εέδϡʔϦϯάδϣϒ: ͋Δ....͔΋͠Εͳ͍ʁ τϦΨʔ: ͋Δ....͔΋͠Εͳ͍ʁ JP1 ΋͋ͬͨ͠৔߹ɺՔಇதຊ൪DBʹมߋΛՃ͔͑Ͷͳ͍

    Digdag ΍ Jenkins తͳΦʔτϝʔγϣϯπʔϧ Կ͕ಈ͍ͯΔ͔ਖ਼௚Θ͔ΒΜ....... ෳࡶͳδϣϒͨͪ Կ͕͍ͭಈ͍ͯΔ͔Θ͔ΒΜ http://itdoc.hitachi.co.jp/manuals/3020/30203S0933/AJSV0099.HTM
  5. 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 ໊Ͱδϣϒ࣮ߦ
  6. 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 ؀ڥม਺௚ॻ͖
  7. 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 Λୟ͘ͱຊ൪ʹӨڹ͋Δͷ͔Θ͔ΒΜɻ͜Θ͍
  8. 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 ؔ܎αʔόʔΛ͢΂ͯϩʔΧϧϗετΛ޲͚ͯ͠·͏
  9. 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 Λ͝·͔ͯ͠ΔͷͰ ϩʔΧϧϗετΛݟʹߦ͘
  10. 39 3. ͑ʂʁ /etc/hosts Λ͍ͬͯ͡ʂʁ Batch 2 ໊دͤ 2 JP1

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

    JP1 2 DB 2 DB 127.0.0.1ͷน ωοτϫʔΫ੾Γ཭͠
  12. 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
  13. 46 4. ੾Γସ͑౰೔ ֎஫ઌ Batch ໊دͤ JP1 ΦϑΟε Batch ໊دͤ

    JP1 ֎஫ઌͷΦϯϓϨαʔόʔ͔Β ࣗࣾͷΦϯϓϨαʔόʔʹ੾Γସ͑ΒΕͨ
  14. 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 ଆͷόάɻύονΛ౰ͯΔͱ௚ͬͨɻ͔ͦ͜Α
  15. 51 ৼΓฦΓ ‣ ຊ൪ͱΠϯϑϥߏ੒Λἧ͑ͨݕূ؀ڥΛ༻ҙ͢Δ ‣ ࣗಈςετΛ࡞Δ ‣ JP1 Λ΍ΊΔ ‣

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

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