<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Idrisaziz on Medium]]></title>
        <description><![CDATA[Stories by Idrisaziz on Medium]]></description>
        <link>https://medium.com/@idrisaziz52?source=rss-e48146f4b2d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cI2pVcjtDClo-x3X</url>
            <title>Stories by Idrisaziz on Medium</title>
            <link>https://medium.com/@idrisaziz52?source=rss-e48146f4b2d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:17:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@idrisaziz52/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[UAS Pendidikan Agama | Idris Abdul Azis]]></title>
            <link>https://idrisaziz52.medium.com/uas-pendidikan-agama-idris-abdul-azis-05ca15625e75?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/05ca15625e75</guid>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Wed, 11 Feb 2026 04:24:14 GMT</pubDate>
            <atom:updated>2026-02-11T04:24:14.116Z</atom:updated>
            <content:encoded><![CDATA[<h3>A. Resensi Penelitian (Dalam Paragraf)</h3><p><strong>Pertama</strong>, penelitian oleh <strong>Ropingi el Ishaq dkk. (2023)</strong> berjudul <em>“Kerukunan Umat Beragama di Kota Kediri Tahun 2022”</em> ini memanfaatkan <strong>metode deskriptif kuantitatif</strong> dengan survei terhadap masyarakat Kota Kediri. Penelitian ini mengukur Indeks Kerukunan Umat Beragama (IKUB) dan menunjukkan hasil bahwa pada tahun 2022 nilai IKUB sangat tinggi, mencapai 4,47. Faktor-faktor yang mendorong kerukunan meliputi kualitas sumber daya manusia, peran tokoh agama, organisasi lintas agama, dan dukungan pemerintah dalam kegiatan sosial dan keagamaan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_hyAKfBr5UBHjUQJ.jpeg" /><figcaption>gambaran kerukunan beragama di kediri (2020)</figcaption></figure><p><strong>Kedua</strong>, artikel oleh <strong>Julio Eleazer Nendissa dkk. (2025)</strong> dengan judul <em>“Pluralisme Agama-Agama: Tantangan, Peluang, dan Perspektif Teologis Dalam Membangun Kerukunan Umat Beragama di Indonesia”</em> menggunakan <strong>metode kajian pustaka kualitatif</strong>. Penelitian ini menilai pluralisme sebagai pendekatan etis dan teologis untuk menjaga keharmonisan antar umat beragama di Indonesia. Hasil penelitian menunjukkan bahwa pluralisme agama membawa tantangan seperti konflik dan intoleransi, namun memiliki peluang besar apabila dikelola melalui dialog antaragama, pendidikan inklusif, serta dukungan lembaga dan pemerintah.</p><p><strong>Ketiga</strong>, penelitian oleh <strong>Qurrota A’yunin &amp; Muhammad Farih (2025)</strong> bertajuk <em>“Model Pembelajaran Pendidikan Agama Islam Untuk Membentuk Toleransi Antar Umat Beragama Berbasis Islam Wasathiyah di SMP Pancasila Krian Sidoarjo”</em> menggunakan <strong>metode kualitatif deskriptif</strong> dengan observasi, wawancara, dan dokumentasi. Penelitian ini menemukan bahwa model pembelajaran Islam Wasathiyah efektif dalam meningkatkan sikap toleransi siswa melalui pendekatan intrakurikuler, kokurikuler, dan ekstrakurikuler yang menghasilkan perkembangan positif dalam aspek spiritual, moral, intelektual, dan sosial.</p><p><strong>Keempat</strong>, meskipun tidak selalu berupa studi empiris lapangan, artikel dalam Jurnal <em>MASALAH KEBEBASAN BERAGAMA DAN BERKEYAKINAN (2023)</em> oleh <strong>Wasisto Raharjo Jati dkk.</strong> mengkaji isu kebebasan beragama di Indonesia dengan pendekatan <strong>kualitatif sosiologi pembangunan</strong>. Artikel ini menunjukkan bagaimana politik identitas, kebijakan negara, dan tekanan kelompok ekstremis berdampak pada dinamika kebebasan beragama dan posisi kelompok minoritas di masyarakat.</p><p><strong>Kelima</strong>, tambahan penelitian relevan dari jurnal lain (misalnya <em>Religi: Jurnal Studi Agama-agama</em>) menyediakan artikel-artikel penelitian terkini tentang studi interaksi agama dan budaya yang memperkaya perspektif penelitian agama-agama di Indonesia. Walau judul spesifik perlu dipilih sesuai akses jurnal, publikasi ini termasuk sumber penelitian terbaru dalam studi agama kontemporer.</p><p><strong>Tabel Resensi Penelitian</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*9cPOIccuGqqbadNmnX2vBw.png" /></figure><h3>B. Kesimpulan</h3><p>Secara keseluruhan, penelitian terbaru tentang umat beragama di Indonesia menunjukkan fokus signifikan pada <strong>kerukunan antar umat beragama, pluralisme agama, peran pendidikan dalam toleransi, serta dinamika kebebasan beragama</strong>. Metode yang dipakai beragam, mulai dari survei kuantitatif hingga kajian pustaka kualitatif yang mendalam. Hasil-hasil ini konsisten menunjukkan bahwa <strong>dialog antaragama, pendidikan inklusif, keterlibatan tokoh agama, serta kebijakan yang mendukung adalah kunci dalam memelihara kerukunan dan toleransi di masyarakat multikultural Indonesia.</strong></p><h3>C. Rekomendasi</h3><ol><li><strong>Perlu penelitian longitudinal</strong> untuk melihat tren kerukunan umat beragama dalam periode waktu yang lebih panjang.</li><li><strong>Pendekatan mixed-method</strong> (gabungan kuantitatif-kuantitatif) dapat memperkaya analisis fenomena agama.</li><li>Penelitian lebih eksploratif terhadap <strong>peran media sosial dalam dinamika agama</strong> dan potensi konflik/toleransi digital.</li></ol><h3>D. Link Publikasi</h3><p>Berikut link publikasi yang bisa Anda akses:</p><ul><li><strong>Kerukunan Umat Beragama di Kota Kediri Tahun 2022</strong> (pdf/jurnal Realita IAIN Kediri) <a href="https://jurnallppm.iainkediri.ac.id/index.php/realita/article/view/166?utm_source=chatgpt.com">https://jurnallppm.iainkediri.ac.id/index.php/realita/article/view/166</a></li><li><strong>Pluralisme Agama-Agama…</strong> (SAMI Journal) | <a href="https://ejournal.uksw.edu/sami/article/view/14644/3002?utm_source=chatgpt.com">https://ejournal.uksw.edu/sami/article/view/14644/3002</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05ca15625e75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HA Cluster PostgreSQL Cluster using Patroni and HAProxy]]></title>
            <link>https://idrisaziz52.medium.com/ha-cluster-postgresql-cluster-using-patroni-and-haproxy-6bf248f6dc89?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bf248f6dc89</guid>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 04:37:24 GMT</pubDate>
            <atom:updated>2025-07-31T02:21:12.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*8Eh0CU-ecdkYJK_x8ml_Tg.avif" /></figure><p><em>High Availability</em> merupakan bagian penting dari arsitektur dan sistem modern saat ini. Postingan blog ini menjelaskan pendekatan yang bisa digunakan untuk membuat <em>cluster</em> PostgreSQL dengan <em>High Availability </em>menggunakan Patroni dan HAProxy. <em>High Availability</em> memungkinkan sebuah node database PostgreSQL untuk secara otomatis mengalihkan pekerjaan ke node PostgreSQL lain yang masih tersedia jika terjadi kegagalan.</p><h3>Description:</h3><p>Artikel ini adalah panduan langkah demi langkah tentang cara membuat arsitektur <em>cluster</em> PostgreSQL dengan <em>High Availibity</em> menggunakan Patroni dan HAProxy.</p><p>Patroni adalah paket Python <em>open-source</em> yang mengelola konfigurasi Postgres. Patroni dapat dikonfigurasi untuk menangani tugas-tugas seperti replikasi, <em>backup</em>, dan pemulihan.</p><p>Etcd adalah penyimpanan key-value terdistribusi dan tahan terhadap kegagalan yang digunakan untuk menyimpan status <em>cluster</em> Postgres. Dengan menggunakan Patroni, semua node Postgres memanfaatkan etcd untuk menjaga agar <em>cluster</em> Postgres tetap berjalan.</p><p>Dalam lingkungan production, disarankan menggunakan <em>cluster</em> etcd yang lebih besar, sehingga jika satu node etcd mengalami kegagalan, hal tersebut tidak memengaruhi server Postgres.</p><p>Setelah <em>cluster</em> Postgres dikonfigurasi, kita memerlukan metode untuk terhubung ke node master, terlepas dari server mana yang saat ini menjadi master dalam <em>cluster</em>. Di sinilah peran HAProxy. Semua klien/aplikasi Postgres akan terhubung ke HAProxy, yang akan meneruskan koneksi ke node master dalam klaster.</p><p>HAProxy adalah <em>load balancer</em> dan <em>reverse proxy open-source</em> dengan performa tinggi untuk aplikasi TCP dan HTTP. HAProxy dapat digunakan untuk mendistribusikan beban dan meningkatkan performa situs web maupun aplikasi.</p><h3>Architecture:</h3><p>OS: Ubuntu 20.04</p><p>Postgres version: 16</p><p><strong>Machine: db-master | IP:192.168.150.140 | Role: Postgresql, Patroni, etcd, HAProxy</strong></p><p><strong>Machine: db-slave | IP: 192.168.150.141 | Role: Postgresql, Patroni</strong></p><h3>Step 1 — Add PostgreSQL Repository</h3><p>Pertama, update the package index and install required packages:</p><pre>sudo apt update<br>sudo apt install gnupg2 wget nano</pre><p>Add the PostgreSQL 16 repository:</p><pre>sudo sh -c &#39;echo &quot;deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main&quot; &gt; /etc/apt/sources.list.d/pgdg.list&#39;</pre><p>Import the repository signing key:</p><pre>curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg</pre><p>Update the package list:</p><pre>sudo apt update</pre><h3>Step 2 — Install PostgreSQL 16</h3><p>Install PostgreSQL 16 and contrib modules:</p><pre>sudo apt install postgresql-16 postgresql-contrib-16<br>sudo systemctl stop postgresql</pre><h3>Step 3—<strong>Setup db-master and db-slave:</strong></h3><pre>sudo hostnamectl set-hostname &lt;node-db&gt;<br>sudo apt install net-tools<br>sudo ln -s /usr/lib/postgresql/16/bin/* /usr/sbin/<br>sudo apt -y install python python3-pip<br>sudo apt install python3-testresources   <br>sudo pip3 install --upgrade setuptools <br>sudo pip3 install psycopg2-binary<br>sudo pip3 install patroni<br>sudo pip3 install python-etcd</pre><h3>Step 4— Setup etcd di node db-master:</h3><pre>sudo apt -y install etcd</pre><h3>Step 5— Setup Haproxy di node db-master:</h3><pre>sudo apt -y install haproxy</pre><h3>Step 6— <strong>Configure etcd on the etcdnode:</strong></h3><p>konfigurasi etcd akan seperti ini:</p><pre>nano /etc/default/etcd</pre><pre>ETCD_LISTEN_PEER_URLS=&quot;http://&lt;etcdnode_ip&gt;:2380&quot;<br>ETCD_LISTEN_CLIENT_URLS=&quot;http://localhost:2379,http://&lt;etcdnode_ip&gt;:2379&quot;<br>ETCD_INITIAL_ADVERTISE_PEER_URLS=&quot;http://&lt;etcdnode_ip&gt;:2380&quot;<br>ETCD_INITIAL_CLUSTER=&quot;default=http://&lt;etcdnode_ip&gt;:2380,&quot;<br>ETCD_ADVERTISE_CLIENT_URLS=&quot;http://&lt;etcdnode_ip&gt;:2379&quot;<br>ETCD_INITIAL_CLUSTER_TOKEN=&quot;etcd-cluster&quot;<br>ETCD_INITIAL_CLUSTER_STATE=&quot;new&quot;</pre><p>contoh pada node db-master:</p><pre>ETCD_LISTEN_PEER_URLS=&quot;http://192.168.150.140:2380&quot;<br>ETCD_LISTEN_CLIENT_URLS=&quot;http://localhost:2379,http://192.168.150.140:2379&quot;<br>ETCD_INITIAL_ADVERTISE_PEER_URLS=&quot;http://192.168.150.140:2380&quot;<br>ETCD_INITIAL_CLUSTER=&quot;default=http://192.168.150.140:2380,&quot;<br>ETCD_ADVERTISE_CLIENT_URLS=&quot;http://192.168.150.140:2379&quot;<br>ETCD_INITIAL_CLUSTER_TOKEN=&quot;etcd-cluster&quot;<br>ETCD_INITIAL_CLUSTER_STATE=&quot;new&quot;</pre><p>restart dan cek status etcd</p><pre>sudo systemctl restart etcd <br><br>sudo systemctl status etcd<br><br>curl http://&lt;etcdnode_ip&gt;:2380/members</pre><h3>Step 7— <strong>Configure Patroni on the db-master and db-slave:</strong></h3><p>konfigurasi :</p><pre>scope: postgres<br>namespace: /db/<br>name: node1<br><br>restapi:<br>    listen: &lt;nodeN_ip&gt;:8008<br>    connect_address: &lt;nodeN_ip&gt;:8008<br><br>etcd:<br>    host: &lt;etcdnode_ip&gt;:2379<br><br>bootstrap:<br>  dcs:<br>    ttl: 30<br>    loop_wait: 10<br>    retry_timeout: 10<br>    maximum_lag_on_failover: 1048576<br>    postgresql:<br>      use_pg_rewind: true<br>      use_slots: true<br>      parameters:<br><br>  initdb:<br>  - encoding: UTF8<br>  - data-checksums<br><br>  pg_hba:<br>  - host replication replicator 127.0.0.1/32 md5<br>  - host replication replicator &lt;node1_ip&gt;/0 md5<br>  - host replication replicator &lt;node2_ip&gt;/0 md5<br>  - host replication replicator &lt;node3_ip&gt;/0 md5<br>  - host all all 0.0.0.0/0 md5<br><br>  users:<br>    admin:<br>      password: admin<br>      options:<br>        - createrole<br>        - createdb<br><br>postgresql:<br>  listen: &lt;nodeN_ip&gt;:5432<br>  connect_address: &lt;nodeN_ip&gt;:5432<br>  data_dir: /data/patroni<br>  pgpass: /tmp/pgpass<br>  authentication:<br>    replication:<br>      username: replicator<br>      password: ************<br>    superuser:<br>      username: postgres<br>      password: ************<br>  parameters:<br>      unix_socket_directories: &#39;.&#39;<br><br>tags:<br>    nofailover: false<br>    noloadbalance: false<br>    clonefrom: false<br>    nosync: false</pre><p>contoh <em>config </em>patroni node 1/node db <em>master</em>:</p><pre>scope: postgres<br>namespace: /db/<br>name: node1<br><br>restapi:<br>    listen: 192.168.150.140:8008<br>    connect_address: 192.168.150.140:8008<br><br>etcd:<br>    host: 192.168.150.140:2379<br><br>bootstrap:<br>  dcs:<br>    ttl: 30<br>    loop_wait: 10<br>    retry_timeout: 10<br>    maximum_lag_on_failover: 1048576<br>    postgresql:<br>      use_pg_rewind: true<br>      use_slots: true<br>      parameters:<br><br>  initdb:<br>  - encoding: UTF8<br>  - data-checksums<br><br>  pg_hba:<br>  - host replication replicator 127.0.0.1/32 md5<br>  - host replication replicator 192.168.150.140/0 md5<br>  - host replication replicator 192.168.150.141/0 md5<br>  - host all all 0.0.0.0/0 md5<br><br>  users:<br>    admin:<br>      password: admin<br>      options:<br>        - createrole<br>        - createdb<br><br>postgresql:<br>  listen: 192.168.150.140:5432<br>  connect_address: 192.168.150.140:5432<br>  data_dir: /data/patroni<br>  pgpass: /tmp/pgpass<br>  authentication:<br>    replication:<br>      username: replicator<br>      password: 1dri551Gm4!<br>    superuser:<br>      username: postgres<br>      password: 1dri551Gm4!<br>  parameters:<br>      unix_socket_directories: &#39;.&#39;<br><br>tags:<br>    nofailover: false<br>    noloadbalance: false<br>    clonefrom: false<br>    nosync: false</pre><p>contoh <em>config </em>patroni node 1/node db <em>slave</em>:</p><pre>scope: postgres<br>namespace: /db/<br>name: node2<br><br>restapi:<br>    listen: 192.168.150.141:8008<br>    connect_address: 192.168.150.141:8008<br><br>etcd:<br>    host: 192.168.150.140:2379<br><br>bootstrap:<br>  dcs:<br>    ttl: 30<br>    loop_wait: 10<br>    retry_timeout: 10<br>    maximum_lag_on_failover: 1048576<br>    postgresql:<br>      use_pg_rewind: true<br>      use_slots: true<br>      parameters:<br><br>  initdb:<br>  - encoding: UTF8<br>  - data-checksums<br><br>  pg_hba:<br>  - host replication replicator 127.0.0.1/32 md5<br>  - host replication replicator 192.168.150.140/0 md5<br>  - host replication replicator 192.168.150.141/0 md5<br>  - host all all 0.0.0.0/0 md5<br><br>  users:<br>    admin:<br>      password: admin<br>      options:<br>        - createrole<br>        - createdb<br><br>postgresql:<br>  listen: 192.168.150.141:5432<br>  connect_address: 192.168.150.141:5432<br>  data_dir: /data/patroni<br>  pgpass: /tmp/pgpass<br>  authentication:<br>    replication:<br>      username: replicator<br>      password: 1dri551Gm4!<br>    superuser:<br>      username: postgres<br>      password: 1dri551Gm4!<br>  parameters:<br>      unix_socket_directories: &#39;.&#39;<br><br>tags:<br>    nofailover: false<br>    noloadbalance: false<br>    clonefrom: false<br>    nosync: false</pre><p>buat data untuk folder patroni</p><pre>sudo mkdir -p /data/patroni<br><br>sudo chown postgres:postgres /data/patroni<br><br>sudo chmod 700 /data/patroni</pre><p>membuat systemd<br>/etc/systemd/system/patroni.service</p><pre>[Unit]<br>Description=High availability PostgreSQL Cluster<br>After=syslog.target network.target<br><br>[Service]<br>Type=simple<br>User=postgres<br>Group=postgres<br>ExecStart=/usr/local/bin/patroni /etc/patroni.yml<br>KillMode=process<br>TimeoutSec=30<br>Restart=no<br><br>[Install]<br>WantedBy=multi-user.targ</pre><h3>Step 8— <strong>Start Patroni service on the</strong> db-master and db-slave:</h3><pre>sudo systemctl start patroni<br><br>sudo systemctl status patroni</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*RzTTjBfyzZhmTylYc_NdTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*bqgH3Tn6gHR-fua_8epjCg.png" /></figure><h3>Step 9— <strong>Configuring HA Proxy on the node db-master:</strong></h3><pre>global<br><br>        maxconn 100<br>        log     127.0.0.1 local2<br><br>defaults<br>        log global<br>        mode tcp<br>        retries 2<br>        timeout client 30m<br>        timeout connect 4s<br>        timeout server 30m<br>        timeout check 5s<br><br>listen stats<br>    mode http<br>    bind *:7000<br>    stats enable<br>    stats uri /<br><br>listen postgres<br>    bind *:5000<br>    option httpchk<br>    http-check expect status 200<br>    default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions<br>    server node1 &lt;node1_ip&gt;:5432 maxconn 100 check port 8008<br>    server node2 &lt;node2_ip&gt;:5432 maxconn 100 check port 8008<br>    server node3 &lt;node3_ip&gt;:5432 maxconn 100 check port 8008<br><br>sudo systemctl restart haproxy<br><br>sudo systemctl status haproxy</pre><p>maka di konfigurasi lab ini menjadi seperti ini:</p><pre>global<br>        maxconn 100<br>        log     127.0.0.1 local2<br><br>defaults<br>        log global<br>        mode tcp<br>        retries 2<br>        timeout client 30m<br>        timeout connect 4s<br>        timeout server 30m<br>        timeout check 5s<br><br>listen stats<br>    mode http<br>    bind *:7000<br>    stats enable<br>    stats uri /<br><br>listen postgres<br>    bind *:5000<br>    option httpchk<br>    http-check expect status 200<br>    default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions<br>    server node1 192.168.150.140:5432 maxconn 100 check port 8008<br>    server node2 192.168.150.141:5432 maxconn 100 check port 8008</pre><pre>sudo systemctl restart haproxy<br><br>sudo systemctl status haproxy</pre><h3>Step 10— Testing High Availability Cluster Setup of PostgreSQL:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6AGWcvwz74ScNb_JCuxBig.png" /></figure><p>link <a href="https://www.itopsecure.com/">itopsecure.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf248f6dc89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solusi PAM yang Gratis dan Powerfull (High Availability Cluster)]]></title>
            <link>https://idrisaziz52.medium.com/jumpserver-pam-high-availability-cluster-27787680bf5e?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/27787680bf5e</guid>
            <category><![CDATA[privileged-access-mgmt]]></category>
            <category><![CDATA[bastion-host]]></category>
            <category><![CDATA[haproxy]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Wed, 12 Mar 2025 02:23:17 GMT</pubDate>
            <atom:updated>2025-04-14T04:16:03.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*D0gc7r4F-Z0kEmfQpSEfow.png" /></figure><p>Cluster <strong>HA (High Availability)</strong> untuk JumpServer diperlukan untuk memastikan <strong>ketersediaan sistem yang tinggi</strong> dan <strong>meminimalkan downtime</strong>. Dengan adanya HA, sistem dapat:</p><ol><li><strong>Menghindari downtime</strong>: Jika salah satu node dalam cluster mengalami kegagalan, node lain akan tetap menangani permintaan pengguna.</li><li><strong>Memastikan toleransi kesalahan</strong>: Sistem secara otomatis beralih ke node yang tersedia jika terjadi error.</li><li><strong>Meningkatkan Performa</strong>: Beban kerja didistribusikan ke beberapa node, sehingga respons sistem tetap optimal meskipun ada lonjakan pengguna.</li><li><strong>Meningkatkan keandalan penyimpanan data</strong>: Menggunakan sumber daya bersama seperti <strong>MySQL dan Redis</strong> dengan dukungan clustering untuk meminimalkan risiko kehilangan data.</li><li><strong>Scalability</strong>: Cluster dapat diperluas dengan menambahkan lebih banyak node agar dapat menangani lebih banyak pengguna dan tugas.</li></ol><p>Arsitektur ini sangat penting bagi organisasi yang menggunakan JumpServer sebagai <strong>sistem akses dan kontrol yang kritis</strong>.</p><h3>1. Infrastucture Server</h3><p>Skenario yang gunakan adalah berikut:</p><p><strong><em>Supporting Apps :</em></strong><br>IP Address : 192.168.150.130<br>Komponen : NFS, Redis dan MySQL DB</p><p><strong><em>Jumpserver Node 1 :</em></strong><br>IP Address : 192.168.150.131</p><p><strong><em>Jumpserver Node 2 </em>:</strong><br>IP Address : 192.168.150.132</p><p><strong><em>Haproxy Load Balancer</em>:</strong><br>IP Address : 192.168.150.130 (menggunakan <em>server </em>yang sama dengan Supporting Apps karena keterbatasan resource. Hehe :D</p><p>Baiknya memang menggunakan <em>Server </em>terpisah sehingga tidak mengganggu operasi yang lainnya.</p><h3>2. Preparing the Server with NFS, MySQL and Redis</h3><p>Di <em>server Supporting Apps </em>(IP Address : 192.168.150.130)</p><p><strong>2.1 Installing and configuring NFS</strong></p><pre>sudo apt install nfs-kernel-server<br>sudo mkdir -p /data<br>sudo chown -R nobody:nogroup /data/<br>sudo chmod 777 /data/<br>sudo nano /etc/exports</pre><p>Tambahkan baris berikut di <em>file </em>/etc/exports :</p><pre>/data 192.168.150.130/24(rw,sync,no_subtree_check)</pre><p>Simpan konfigurasi dan <em>restart </em><strong>NFS service</strong>:</p><pre>sudo exportfs -a<br>sudo systemctl restart nfs-kernel-server</pre><p><strong>2.2 Installing and configuring MySQL</strong></p><p><em>Step </em>instalasi bergantung pada <em>OS </em>yang digunakan.</p><pre>apt install mysql</pre><p>ubah konfigurasi <em>bind-address</em> di <em>mysql </em>ke 0.0.0.0</p><p>lokasi /etc/mysql/mysql.conf.d/mysqld.cnf:</p><pre>nano /etc/mysql/mysql.conf.d/mysqld.cnf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*YLcUJInCLnVP6d8CC8UUBA.png" /></figure><p>lalu <em>restart</em></p><pre>systemctl restart mysql</pre><p>Buat sebuah <em>database </em>dan <em>user, </em>jalankan perintah berikut:</p><pre>mysql -uroot<br>mysql&gt; create database jumpserver default charset &#39;utf8&#39;;<br>mysql&gt; create user &#39;jumpserver&#39;@&#39;%&#39; identified by &#39;KXOeyNgDeTdpeu9q&#39;;<br>mysql&gt; grant all on jumpserver.* to &#39;jumpserver&#39;@&#39;%&#39;;<br>mysql&gt; flush privileges;<br>mysql&gt; exit;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*d-HyFq_uOv6mohy3LWYhOQ.png" /></figure><p><strong>2.3 Installing and configuring Redis</strong></p><p><em>Step </em>instalasi bergantung pada <em>OS </em>yang digunakan.</p><pre>apt install -y redis</pre><p>Setelah meng-<em>install </em><strong><em>Redis</em></strong>, jalankan perintah berikut untuk konfigurasi <strong><em>Redis</em></strong></p><pre>sed -i &quot;s/bind 127.0.0.1/bind 0.0.0.0/g&quot; /etc/redis/redis.conf<br>sed -i &quot;561i maxmemory-policy allkeys-lru&quot; /etc/redis/redis.conf<br>sed -i &quot;481i requirepass KXOeyNgDeTdpeu9q&quot; /etc/redis/redis.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*UgcOvzTTJD7HCq6-7FiY6A.png" /></figure><p><em>Enable </em>dan <em>start </em><strong><em>redis</em></strong></p><pre>systemctl enable redis<br>systemctl start redis</pre><h3>3. Installing Jumpserver</h3><p><strong>3.1 Install Jumpserver di Node 1</strong></p><p><strong>3.1.1 Mounting NFS</strong></p><pre>sudo apt install nfs-common<br>mkdir -p /opt/jumpserver/core/data<br>mount -t nfs 192.168.150.130:/data /data/jumpserver/core/data<br>echo &quot;192.168.150.130:/data /data/jumpserver/core/data nfs defaults 0 0&quot; &gt;&gt; /etc/fstab</pre><p>cek <em>mounting </em>dengan df -Th</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*ajHhaCS3PlBzhp97D_W2aA.png" /></figure><p><strong>3.1.2 Configuring Jumpserver</strong></p><pre>cd /opt<br>wget -qO jumpserver-installer-v4.5.0.tar.gz https://resource.fit2cloud.com/jumpserver/installer/releases/download/v4.5.0/jumpserver-installer-v4.5.0.tar.gz<br>tar -xf jumpserver-installer-v4.5.0.tar.gz<br>cd jumpserver-installer-v4.5.0</pre><p>Ubah <em>file </em>config-example.txtdi <em>installer directory </em>dan sesuaikan koneksi <em>database </em>dan <strong><em>redis </em></strong>ke <strong><em>VM Supporting Apps</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*tBJFynm3rMZYNMieXdC7AQ.png" /></figure><pre># JumpServer configuration file example.<br>#<br># If you don&#39;t understand the purpose, you can skip modifying this configuration file, the system will automatically fill in<br># Complete parameter documentation https://docs.jumpserver.org/zh/v3/guide/env/<br><br>################################# Image Configuration #################################<br>#<br># The connection to docker.io in China will timeout or the download speed will be slow, enable this option to use Huawei Cloud image acceleration<br># Replace the old version DOCKER_IMAGE_PREFIX<br>#<br># DOCKER_IMAGE_MIRROR=1<br><br># Image pull policy Always, IfNotPresent<br># Always means that the latest image will be pulled every time, IfNotPresent means that the image will be pulled only if it does not exist locally<br>#<br># IMAGE_PULL_POLICY=Always<br><br>############################## Installation Configuration #############################<br>#<br># JumpServer database persistence directory, by default, recordings, task logs are in this directory<br># Please modify according to the actual situation, the database file (.sql) and configuration file backed up during the upgrade will also be saved to this directory<br>#<br>VOLUME_DIR=/data/jumpserver<br><br># Encryption key, please ensure that SECRET_KEY is consistent with the old environment when migrating, do not use special strings<br># (*) Warning: Keep this value secret.<br># (*) Do not disclose SECRET_KEY to anyone<br>#<br>SECRET_KEY=<br><br># The token used by the component to register with core, please keep BOOTSTRAP_TOKEN consistent with the old environment when migrating,<br># Do not use special strings<br># (*) Warning: Keep this value secret.<br># (*) Do not disclose BOOTSTRAP_TOKEN to anyone<br>#<br>BOOTSTRAP_TOKEN=<br><br># Log level INFO, WARN, ERROR<br>#<br>LOG_LEVEL=ERROR<br><br># The network segment used by the JumpServer container, please do not conflict with the existing network, modify according to the actual situation<br>#<br>DOCKER_SUBNET=192.168.250.0/24<br><br># ipv6 nat, no need to enable under normal circumstances<br># If the host does not support ipv6, enabling this option will prevent the real client ip address from being obtained<br>#<br>USE_IPV6=0<br>DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64<br><br>################################# DB Configuration ####################################<br># For external databases, you need to enter the correct database information, the system will automatically handle the built-in database<br># (*) The password part must not contain single quotes and double quotes<br>#<br>DB_ENGINE=mysql<br>DB_HOST=192.168.150.130<br>DB_PORT=3306<br>DB_USER=jumpserver<br>DB_PASSWORD=KXOeyNgDeTdpeu9q<br>DB_NAME=jumpserver<br><br># If external MySQL needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/<br>#<br># DB_USE_SSL=true<br><br>################################# Redis Configuration #################################<br># For external Redis, please enter the correct Redis information, the system will automatically handle the built-in Redis<br># (*) The password part must not contain single quotes and double quotes<br>#<br>REDIS_HOST=192.168.150.130<br>REDIS_PORT=6379<br>REDIS_PASSWORD=KXOeyNgDeTdpeu9q<br><br># If you are using external Redis Sentinel, please manually fill in the following content<br>#<br># REDIS_SENTINEL_HOSTS=mymaster/192.168.100.1:26379,192.168.100.1:26380,192.168.100.1:26381<br># REDIS_SENTINEL_PASSWORD=your_sentinel_password<br># REDIS_PASSWORD=your_redis_password<br># REDIS_SENTINEL_SOCKET_TIMEOUT=5<br><br># If external Redis needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/<br>#<br># REDIS_USE_SSL=true<br><br>################################# Access Configuration ################################<br># The service port provided to the outside, if it conflicts with the existing service, please modify it yourself<br>#<br>HTTP_PORT=80<br><br>################################# HTTPS Configuration #################################<br># Refer to https://docs.jumpserver.org/zh/v3/installation/proxy/ for configuration<br>#<br># HTTPS_PORT=443<br># SERVER_NAME=your_domain_name<br># SSL_CERTIFICATE=your_cert<br># SSL_CERTIFICATE_KEY=your_cert_key<br>#<br><br># Nginx file upload and download size limit<br>#<br>CLIENT_MAX_BODY_SIZE=4096m<br><br>################################# Component Configuration #############################<br># Component registration use, by default, register to the core container, the cluster environment needs to be modified to the cluster vip address<br>#<br>CORE_HOST=http://core:8080<br>PERIOD_TASK_ENABLED=true<br><br># Core Session definition,<br># SESSION_COOKIE_AGE indicates how many seconds the session expires after idling,<br># SESSION_EXPIRE_AT_BROWSER_CLOSE=true means that the session expires as soon as the browser is closed<br>#<br># SESSION_COOKIE_AGE=86400<br>SESSION_EXPIRE_AT_BROWSER_CLOSE=false<br><br># Trusted DOMAINS definition,<br># Define the trusted access IP, please modify according to the actual situation, if it is a public IP, please change to the corresponding public IP,<br># DOMAINS=&quot;demo.jumpserver.org:443&quot;<br># DOMAINS=&quot;172.17.200.191:80&quot;<br># DOMAINS=&quot;demo.jumpserver.org:443,172.17.200.191:80&quot;<br>DOMAINS=<br><br># Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off<br># CORE_ENABLED=0<br># CELERY_ENABLED=0<br># KOKO_ENABLED=0<br># LION_ENABLED=0<br># CHEN_ENABLED=0<br># WEB_ENABLED=0<br><br># Lion enables font smoothing to optimize the experience<br>#<br>JUMPSERVER_ENABLE_FONT_SMOOTHING=true<br><br>################################# XPack Configuration #################################<br># XPack package, invalid setting in open source version<br>#<br>SSH_PORT=2222<br>RDP_PORT=3389<br>XRDP_PORT=3390<br>MAGNUS_MYSQL_PORT=33061<br>MAGNUS_MARIADB_PORT=33062<br>MAGNUS_REDIS_PORT=63790<br>MAGNUS_POSTGRESQL_PORT=54320<br>MAGNUS_SQLSERVER_PORT=14330<br>MAGNUS_ORACLE_PORTS=30000-30030<br><br>XRDP_ENABLED=0<br><br>################################## Other Configuration ################################<br># The terminal uses the host HOSTNAME as the identifier, automatically generated during the first installation<br>#<br>SERVER_HOSTNAME=${HOSTNAME}<br><br># Use built-in SLB, if the client IP address obtained by the Web page is not correct, please set USE_LB to 0<br># When USE_LB is set to 1, use the configuration proxy_set_header X-Forwarded-For $remote_addr<br># When USE_LB is set to 0, use the configuration proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for<br>USE_LB=1<br><br># The current running version number of JumpServer, automatically generated after installation and upgrade<br>#<br>TZ=Asia/Jakarta<br>TIME_ZONE=Asia/Jakarta<br>CURRENT_VERSION=</pre><p>Jalankan installasi:</p><pre>./jmsctl.sh install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6LdwqmVpW9oq6rlkIooNhw.png" /></figure><p>Setelah instalasi selesai, kita akan melihat <em>private key</em>. Simpan, karena nanti akan kita masukkan di <em>node </em>2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*mgJJ9xbjYcc3obpgjD29rQ.png" /></figure><p><strong>3.2 Install Jumpserver di Node 2</strong></p><p><em>Install </em><strong>NFS client</strong> and <em>mount folder </em>seperti yang ada di <em>node </em>pertama.</p><p><em>Install </em><strong>Jumpserver </strong>seperti pada <em>node </em>pertama</p><pre>cd /opt<br>wget -qO jumpserver-installer-v4.5.0.tar.gz https://resource.fit2cloud.com/jumpserver/installer/releases/download/v4.5.0/jumpserver-installer-v4.5.0.tar.gz<br>tar -xf jumpserver-installer-v4.5.0.tar.gz<br>cd jumpserver-installer-v4.5.0</pre><p>Saat mengubah <strong>Jumpserver </strong>konfigurasi <em>file</em>, isi nilai <strong>SECRET_KEY</strong> dan <strong>BOOTSTRAP_TOKEN</strong>yang didapatkan saat instalasi pada <em>node </em>yang pertama:</p><pre># JumpServer configuration file example.<br>#<br># If you don&#39;t understand the purpose, you can skip modifying this configuration file, the system will automatically fill in<br># Complete parameter documentation https://docs.jumpserver.org/zh/v3/guide/env/<br><br>################################# Image Configuration #################################<br>#<br># The connection to docker.io in China will timeout or the download speed will be slow, enable this option to use Huawei Cloud image acceleration<br># Replace the old version DOCKER_IMAGE_PREFIX<br>#<br># DOCKER_IMAGE_MIRROR=1<br><br># Image pull policy Always, IfNotPresent<br># Always means that the latest image will be pulled every time, IfNotPresent means that the image will be pulled only if it does not exist locally<br>#<br># IMAGE_PULL_POLICY=Always<br><br>############################## Installation Configuration #############################<br>#<br># JumpServer database persistence directory, by default, recordings, task logs are in this directory<br># Please modify according to the actual situation, the database file (.sql) and configuration file backed up during the upgrade will also be saved to this directory<br>#<br>VOLUME_DIR=/data/jumpserver<br><br># Encryption key, please ensure that SECRET_KEY is consistent with the old environment when migrating, do not use special strings<br># (*) Warning: Keep this value secret.<br># (*) Do not disclose SECRET_KEY to anyone<br>#<br>SECRET_KEY=86042f92c68e156c8fc88d42b74530ed68a189c70a7a7a48<br><br># The token used by the component to register with core, please keep BOOTSTRAP_TOKEN consistent with the old environment when migrating,<br># Do not use special strings<br># (*) Warning: Keep this value secret.<br># (*) Do not disclose BOOTSTRAP_TOKEN to anyone<br>#<br>BOOTSTRAP_TOKEN=q8WP8T180jKcwH4BPgP9JcXz<br><br># Log level INFO, WARN, ERROR<br>#<br>LOG_LEVEL=ERROR<br><br># The network segment used by the JumpServer container, please do not conflict with the existing network, modify according to the actual situation<br>#<br>DOCKER_SUBNET=192.168.250.0/24<br><br># ipv6 nat, no need to enable under normal circumstances<br># If the host does not support ipv6, enabling this option will prevent the real client ip address from being obtained<br>#<br>USE_IPV6=0<br>DOCKER_SUBNET_IPV6=fc00:1010:1111:200::/64<br><br>################################# DB Configuration ####################################<br># For external databases, you need to enter the correct database information, the system will automatically handle the built-in database<br># (*) The password part must not contain single quotes and double quotes<br>#<br>DB_ENGINE=mysql<br>DB_HOST=192.168.150.130<br>DB_PORT=3306<br>DB_USER=jumpserver<br>DB_PASSWORD=KXOeyNgDeTdpeu9q<br>DB_NAME=jumpserver<br><br># If external MySQL needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/mysql_ssl/<br>#<br># DB_USE_SSL=true<br><br>################################# Redis Configuration #################################<br># For external Redis, please enter the correct Redis information, the system will automatically handle the built-in Redis<br># (*) The password part must not contain single quotes and double quotes<br>#<br>REDIS_HOST=192.168.150.130<br>REDIS_PORT=6379<br>REDIS_PASSWORD=KXOeyNgDeTdpeu9q<br><br># If you are using external Redis Sentinel, please manually fill in the following content<br>#<br># REDIS_SENTINEL_HOSTS=mymaster/192.168.100.1:26379,192.168.100.1:26380,192.168.100.1:26381<br># REDIS_SENTINEL_PASSWORD=your_sentinel_password<br># REDIS_PASSWORD=your_redis_password<br># REDIS_SENTINEL_SOCKET_TIMEOUT=5<br><br># If external Redis needs to enable TLS/SSL connection, refer to https://docs.jumpserver.org/zh/v3/installation/security_setup/redis_ssl/<br>#<br># REDIS_USE_SSL=true<br><br>################################# Access Configuration ################################<br># The service port provided to the outside, if it conflicts with the existing service, please modify it yourself<br>#<br>HTTP_PORT=80<br><br>################################# HTTPS Configuration #################################<br># Refer to https://docs.jumpserver.org/zh/v3/installation/proxy/ for configuration<br>#<br># HTTPS_PORT=443<br># SERVER_NAME=your_domain_name<br># SSL_CERTIFICATE=your_cert<br># SSL_CERTIFICATE_KEY=your_cert_key<br>#<br><br># Nginx file upload and download size limit<br>#<br>CLIENT_MAX_BODY_SIZE=4096m<br><br>################################# Component Configuration #############################<br># Component registration use, by default, register to the core container, the cluster environment needs to be modified to the cluster vip address<br>#<br>CORE_HOST=http://core:8080<br>PERIOD_TASK_ENABLED=true<br><br># Core Session definition,<br># SESSION_COOKIE_AGE indicates how many seconds the session expires after idling,<br># SESSION_EXPIRE_AT_BROWSER_CLOSE=true means that the session expires as soon as the browser is closed<br>#<br># SESSION_COOKIE_AGE=86400<br>SESSION_EXPIRE_AT_BROWSER_CLOSE=false<br><br># Trusted DOMAINS definition,<br># Define the trusted access IP, please modify according to the actual situation, if it is a public IP, please change to the corresponding public IP,<br># DOMAINS=&quot;demo.jumpserver.org:443&quot;<br># DOMAINS=&quot;172.17.200.191:80&quot;<br># DOMAINS=&quot;demo.jumpserver.org:443,172.17.200.191:80&quot;<br>DOMAINS=<br><br># Configure the components that do not need to be started, by default all components will be started, if you do not need a certain component, you can set {component name}_ENABLED to 0 to turn it off<br># CORE_ENABLED=0<br># CELERY_ENABLED=0<br># KOKO_ENABLED=0<br># LION_ENABLED=0<br># CHEN_ENABLED=0<br># WEB_ENABLED=0<br><br># Lion enables font smoothing to optimize the experience<br>#<br>JUMPSERVER_ENABLE_FONT_SMOOTHING=true<br><br>################################# XPack Configuration #################################<br># XPack package, invalid setting in open source version<br>#<br>SSH_PORT=2222<br>RDP_PORT=3389<br>XRDP_PORT=3390<br>MAGNUS_MYSQL_PORT=33061<br>MAGNUS_MARIADB_PORT=33062<br>MAGNUS_REDIS_PORT=63790<br>MAGNUS_POSTGRESQL_PORT=54320<br>MAGNUS_SQLSERVER_PORT=14330<br>MAGNUS_ORACLE_PORTS=30000-30030<br><br>XRDP_ENABLED=0<br><br>################################## Other Configuration ################################<br># The terminal uses the host HOSTNAME as the identifier, automatically generated during the first installation<br>#<br>SERVER_HOSTNAME=${HOSTNAME}<br><br># Use built-in SLB, if the client IP address obtained by the Web page is not correct, please set USE_LB to 0<br># When USE_LB is set to 1, use the configuration proxy_set_header X-Forwarded-For $remote_addr<br># When USE_LB is set to 0, use the configuration proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for<br>USE_LB=1<br><br># The current running version number of JumpServer, automatically generated after installation and upgrade<br>#<br>TZ=Asia/Jakarta<br>TIME_ZONE=Asia/Jakarta<br>CURRENT_VERSION=</pre><p>Jalankan instalasi:</p><pre>./jmsctl.sh install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NTonMIQR0FI--Fo5QHqzeg.png" /></figure><h3>4. Installing Haproxy Load Balancer</h3><p>Langkah terakhir adalah kita perlu <em>install </em><strong>haproxy </strong>untuk melakukan <strong>Load Balance</strong> antara <strong>Jumpserver </strong><em>node </em>pertama dan kedua.</p><pre>apt install -y haproxy<br>cd /etc/haproxy/<br>cp haproxy.cfg haproxy.cfg-bak</pre><p>Ubah konfigurasi <strong><em>haproxy.</em></strong></p><pre>nano haproxy.cfg</pre><pre>global<br>    # to have these messages end up in /var/log/haproxy.log you will<br>    # need to:<br>    #<br>    # 1) configure syslog to accept network log events.  This is done<br>    #    by adding the &#39;-r&#39; option to the SYSLOGD_OPTIONS in<br>    #    /etc/sysconfig/syslog<br>    #<br>    # 2) configure local2 events to go to the /var/log/haproxy.log<br>    #   file. A line like the following can be added to<br>    #   /etc/sysconfig/syslog<br>    #<br>    #    local2.*                       /var/log/haproxy.log<br>    #<br>    log         127.0.0.1 local2<br><br>    chroot      /var/lib/haproxy<br>    pidfile     /var/run/haproxy.pid<br>    maxconn     4000<br>    user        haproxy<br>    group       haproxy<br>    daemon<br><br>    # turn on stats unix socket<br>    stats socket /var/lib/haproxy/stats<br><br>#---------------------------------------------------------------------<br># common defaults that all the &#39;listen&#39; and &#39;backend&#39; sections will<br># use if not designated in their block<br>#---------------------------------------------------------------------<br>defaults<br>    log                     global<br>    option                  dontlognull<br>    option                  redispatch<br>    retries                 3<br>    timeout http-request    10s<br>    timeout queue           1m<br>    timeout connect         10s<br>    timeout client          1m<br>    timeout server          1m<br>    timeout http-keep-alive 10s<br>    timeout check           10s<br>    maxconn                 3000<br><br>listen stats<br>    bind *:8080<br>    mode http<br>    stats enable<br>    stats uri /haproxy                      # 监控页面, 请自行修改. 访问地址为 http://192.168.100.100:8080/haproxy<br>    stats refresh 5s<br>    stats realm haproxy-status<br>    stats auth admin:KXOeyNgDeTdpeu9q       # 账户密码, 请自行修改. 访问 http://192.168.100.100:8080/haproxy 会要求输入<br><br>#---------------------------------------------------------------------<br># check  检活参数说明<br># inter  间隔时间, 单位: 毫秒<br># rise   连续成功的次数, 单位: 次<br># fall   连续失败的次数, 单位: 次<br># 例: inter 2s rise 2 fall 3<br># 表示 2 秒检查一次状态, 连续成功 2 次服务正常, 连续失败 3 次服务异常<br>#<br># server 服务参数说明<br># server 192.168.100.21 192.168.100.21:80 weight 1 cookie web01<br># 第一个 192.168.100.21 做为页面展示的标识, 可以修改为其他任意字符串<br># 第二个 192.168.100.21:80 是实际的后端服务端口<br># weight 为权重, 多节点时安装权重进行负载均衡<br># cookie 用户侧的 cookie 会包含此标识, 便于区分当前访问的后端节点<br># 例: server db01 192.168.100.21:3306 weight 1 cookie db_01<br>#---------------------------------------------------------------------<br>#<br>#listen jms-web<br>#    bind *:80                               # 监听 80 端口<br>#    mode http<br><br>    # redirect scheme https if !{ ssl_fc }  # 重定向到 https<br>    # bind *:443 ssl crt /opt/ssl.pem       # https 设置<br><br>#    option httpchk GET /api/health/         # Core 检活接口<br>#<br>#    stick-table type ip size 200k expire 30m<br>#    stick on src<br><br>#    balance leastconn<br>#    server 192.168.150.131 192.168.150.131:80 weight 1 cookie web01 check inter 2s rise 1 fall 2  # JumpServer 服务器<br>#    server 192.168.150.132 192.168.150.132:80 weight 1 cookie web02 check inter 2s rise 1 fall 2<br>listen jms-web<br>    bind *:80<br>    mode http<br><br>    option httpchk GET /api/health/ HTTP/1.1\r\nHost:\ 192.168.150.130<br><br>    stick-table type ip size 200k expire 30m<br>    stick on src<br><br>    balance leastconn<br>    server 192.168.150.131 192.168.150.131:80 weight 1 cookie web01 check inter 5s rise 2 fall 3<br>    server 192.168.150.132 192.168.150.132:80 weight 1 cookie web02 check inter 5s rise 2 fall 3<br><br><br>listen jms-ssh<br>    bind *:2222<br>    mode tcp<br><br>    option tcp-check<br><br>    fullconn 500<br>    balance source<br>    server 192.168.150.131 192.168.150.131:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy<br>    server 192.168.150.132 192.168.150.132:2222 weight 1 check inter 2s rise 2 fall 3 send-proxy<br><br>listen jms-koko<br>    mode http<br><br>    option httpclose<br>    option forwardfor<br>    option httpchk GET /koko/health/ HTTP/1.1\r\nHost:\ 192.168.150.130  # KoKo 检活接口, host 填写 HAProxy 的 ip 地址<br><br>    cookie SERVERID insert indirect<br>    hash-type consistent<br>    fullconn 500<br>    balance leastconn<br>    server 192.168.150.131 192.168.150.131:80 weight 1 cookie web01 check inter 2s rise 2 fall 3  # JumpServer 服务器<br>    server 192.168.150.132 192.168.150.132:80 weight 1 cookie web02 check inter 2s rise 2 fall 3<br><br><br>listen jms-lion<br>    mode http<br><br>    option httpclose<br>    option forwardfor<br>    option httpchk GET /lion/health/ HTTP/1.1\r\nHost:\ 192.168.100.100  # Lion 检活接口, host 填写 HAProxy 的 ip 地址<br><br>    cookie SERVERID insert indirect<br>    hash-type consistent<br>    fullconn 500<br>    balance leastconn<br>    server 192.168.150.131 192.168.150.131:80 weight 1 cookie web01 check inter 2s rise 2 fall 3  # JumpServer 服务器<br>    server 192.168.150.132 192.168.150.132:80 weight 1 cookie web02 check inter 2s rise 2 fall 3<br><br></pre><p>Mengaktifkan <strong>haproxy</strong>.</p><pre>systemctl enable haproxy<br>systemctl start haproxy</pre><h3>5. Pengujian</h3><p>Akses <a href="http://192.168.150.130:8080/haproxy">http://192.168.150.130:8080/haproxy</a>. Masukkan <em>username </em>dan <em>password </em>dari konfigurasi <strong>haproxy </strong>tadi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fs4XQD18nwpa55MGie44Ag.png" /></figure><p>kita bisa mengakses <strong>jumpserver </strong>melalui server <strong>LB/Haproxy.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFuqn1l2tT_axALk29H-uw.png" /></figure><p>Jika kita matikan salah satu node maka akan tetap jalan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04dLQ8P9zrmBQP6dAqrH8A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*bktwZCCHTgk-QRJ_m7BYGA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27787680bf5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MicroK8S Clustering]]></title>
            <link>https://idrisaziz52.medium.com/microk8s-clustering-9ab8f0fb9f57?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ab8f0fb9f57</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 15:08:27 GMT</pubDate>
            <atom:updated>2025-03-05T15:09:34.927Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>MicroK8s Clustering</strong> adalah fitur dalam <strong><em>MicroK8s</em></strong><em> </em>yang memungkinkan Anda menghubungkan beberapa <em>node </em>untuk membentuk <strong><em>cluster</em> <em>Kubernetes</em></strong><em> </em>dengan cara yang ringan dan mudah dikelola. MicroK8s sendiri adalah distribusi <em>Kubernetes </em>yang ringan, dirancang oleh <em>Canonical </em>untuk digunakan di lingkungan <strong>edge computing, IoT, CI/CD, atau development</strong>.</p><p>Disini saya akan menggunakan 3 <em>node </em>yang 1 berperan sebagai <em>master </em>dan 2 lainnya sebagai <em>worker</em>.</p><p>Dalam <strong><em>Kubernetes </em>standar</strong>, ada dua jenis <em>node </em>utama:</p><ol><li><strong>Master Node</strong> (Control Plane)</li></ol><ul><li>Mengelola seluruh <em>cluster</em></li><li>Menjalankan <strong>API Server, Scheduler, Controller Manager, dan etcd</strong></li><li>Tidak menjalankan aplikasi secara langsung</li></ul><p><strong>2. Worker Node</strong></p><ul><li>Menjalankan aplikasi dan <em>container</em></li><li>Menggunakan <strong>kubelet</strong> untuk berkomunikasi dengan <em>master</em></li><li>Memiliki <strong>kube-proxy</strong> untuk jaringan</li></ul><p>Skenario yang gunakan adalah berikut:</p><p><strong><em>K8S Master :</em></strong><br>IP Address : 192.168.150.120<br>Hostname : master</p><p><strong><em>K8S Worker 01 </em>:</strong><br>IP Address : 192.168.150.121<br>Hostname : worker01</p><p><strong><em>K8S Worker 02 </em>:</strong><br>IP Address : 192.168.150.122<br>Hostname : worker02</p><p>Sebelum kita memulai proses implementasi pastikan kita sudah memasukkan hostname disetiap <em>node.</em></p><pre>nano /etc/hosts</pre><p>Master</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*K1Mm3PzpYVOCwqLPUF6Xew.png" /></figure><p>Worker01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*X1jZLmrzKBKplxT5U7Vvpg.png" /></figure><p>Worker02</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*Q3-bmgUaoR8-XU8rrwN7Cg.png" /></figure><h3>1. Install MicroK8S pada setiap node</h3><p>Pertama kita <em>install </em>terlebih dahulu pada setiap <em>node</em>. Kita menggunakan versi <em>kubernetes 1.25.</em></p><pre>snap install microk8s --classic --channel=1.25/stable</pre><h3>2. Membuat Cluster</h3><p>Di <strong>node utama (master)</strong>, jalankan:</p><pre>microk8s add-node</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*fABHhNtbDMTK8BX8MAYr5A.png" /></figure><p><em>Copy </em>yang ditandai itu dan <em>paste</em>-kan ke <em>node </em>2 (Worker01). Oh ya sesuaikan dengan IP yang anda gunakan. Disini <em>master </em>saya menggunakan <em>IP </em>192.168.150.120</p><pre>microk8s join 192.168.150.120:25000/88c9e94aabcd6e9df7c6d26560a64863/4c02b16c6657</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*nBD44xRbn2TIJL2b2FjnTA.png" /></figure><p>Jika sudah, kita cek kembali <em>list cluster </em>di node <em>master</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*OdtHNcA9hJ9a2yTbfMNk7Q.png" /></figure><p>Ya, node 2 atau Worker01 sudah terdaftar. Sekarang lakukan yang sama di node 3 (Worker02)</p><p>Di <strong>node utama (master)</strong>, jalankan kembali:</p><pre>microk8s add-node</pre><p>Lalu copy dan paste-kan ke node 3 (Worker02).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*CegwuOjy59f3qgkl_NWCew.png" /></figure><p>Jika sudah, kita cek kembali <em>list cluster </em>di node <em>master</em></p><pre>microk8s kubectl get nodes -o wide</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pyf8E4RlrCOQek0N6tss4g.png" /></figure><h3>3. High Availability</h3><p>Jika clustering berisi 3 node atau lebih, maka secara otomatis High Availability sudah aktif.</p><p>Kita bisa mengecek hal tersebut dengan perintah:</p><pre>microk8s status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*SIspdta4EK6c8zcPPR5URQ.png" /></figure><h3>3. Mengaktifkan CoreDNS</h3><p>Dalam <strong><em>MicroK8s</em></strong>, addon <strong>DNS</strong> sangat penting untuk <strong>resolusi nama layanan <em>(Service Discovery)</em></strong> di dalam <em>cluster</em>. Tanpa DNS, <em>pod </em>dalam <em>cluster </em>harus berkomunikasi menggunakan <strong>alamat IP langsung</strong>, yang tidak praktis karena IP <em>pod </em>bisa berubah setiap saat.</p><h3>Fungsi Utama Addon DNS di MicroK8s</h3><p><strong>1. Service Discovery</strong></p><ul><li>Memungkinkan <strong><em>pod</em></strong><em> </em>berkomunikasi dengan <strong><em>service </em>lain</strong> menggunakan nama, bukan IP.</li><li>Contoh: Pod <strong><em>frontend</em></strong><em> </em>bisa mengakses <strong><em>backend</em></strong><em> </em>dengan backend.default.svc.cluster.local tanpa mengetahui IP-nya.</li></ul><p><strong>2. Load Balancing Internal</strong></p><ul><li>Kubernetes secara otomatis melakukan load balancing ke <em>pod </em>yang sesuai menggunakan <em>DNS</em>.</li></ul><p><strong>3. Otomatisasi Resolusi Nama</strong></p><ul><li>DNS di <em>Kubernetes </em>akan secara otomatis memperbarui IP pod dan <em>service </em>jika terjadi perubahan.</li></ul><p><strong>4. Dukungan untuk Stateful Applications</strong></p><ul><li>Aplikasi seperti <em>database </em><strong>(MySQL, PostgreSQL, Redis)</strong> sering memerlukan resolusi nama yang stabil.</li></ul><p>Di <em>MicroK8s</em>, <em>addon </em>DNS menggunakan <strong>CoreDNS</strong>, yang merupakan DNS server ringan untuk Kubernetes.</p><pre>microk8s enable dns</pre><p>untuk mengecek dns sudah jalan kita bisa jalankan perintah:</p><pre>microk8s kubectl get pods -n kube-system -o wide</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-V7ogAXG2eXkr5cSfGelg.png" /></figure><p>maka akan terlihat <em>pods </em><strong><em>coredns-xxxx-xx</em></strong></p><h3>4. Mengaktifkan Dashboard</h3><p>Mengaktifkan <em>Dashboard </em>akan memudahkan kita untuk mengoperasikan <em>kubernetes </em>dengan tampilan <em>Web UI</em>.</p><p>jalankan perintah :</p><pre>microk8s enable dashboard</pre><p>untuk menampilkan <em>dashboard</em></p><pre>microk8s dashboard-proxy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8pJ39CTCmg8yRxq4eRPjFQ.png" /><figcaption>Token</figcaption></figure><p>Disini saya ingin menampilkan <em>dashboard </em>di Worker02. Jadi ketika akses maka <em>URL </em>akan sesuai dengan IP dari node (<a href="https://192.168.150.122:10443/#/login">https://192.168.150.122:10443/#/login</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDWT7ahuDyL7bkPHB2LRdg.png" /><figcaption>Halaman awal dashboard K8S</figcaption></figure><p>Lalu paste kan token di kolom Enter Token lalu Sign In</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DhfMWBDNS2PW5VSxuZMhyw.png" /><figcaption>Menampilkan list node yang <em>Ready</em></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ab8f0fb9f57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MySQL Clustering dengan MariaDB Galera Cluster]]></title>
            <link>https://idrisaziz52.medium.com/mysql-clustering-dengan-mariadb-galera-cluster-bf2b0bc2d0b5?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf2b0bc2d0b5</guid>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[galera-cluster]]></category>
            <category><![CDATA[database-administration]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Fri, 17 May 2024 03:11:50 GMT</pubDate>
            <atom:updated>2024-05-25T11:10:55.419Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*_4xyZZanjDqi5_562qWWVw.png" /></figure><p><strong>MariaDB Galera Cluster</strong> adalah salah satu DBMS <em>(Database Management system)</em> yang open source artinya dapat digunakan secara bebas dan tentunya sangat populer serta mempunyai mekanisme replikasi.</p><p><strong>MariaDB Galera Cluster</strong> salah satu tipe cluster synchronous multi-master untuk MariaDB dan hanya tersedia di sistem operasi GNU/Linux. Galera Cluster hanya mendukung <a href="https://mariadb.com/kb/en/xtradb-and-innodb/"><strong>XtraDB/InnoDB</strong></a> storage engine dan untuk <a href="https://mariadb.com/kb/en/myisam/"><strong>MyISAM</strong></a> masih dalam experimental, dengan menggunakan Galera Cluster salah satu cara untuk implementasi high-availability database server, karena semua database server akan menjadi server aktif yang dapat melayani baca (read) atau tulis (write) ke database.</p><p>Beberapa fitur utama MariaDB Galera Cluster antara lain :</p><ul><li>Dapat <em>read</em> dan <em>write</em> ke node cluster mana pun.</li><li>Dapat bergabung dengan node lain secara otomatis.</li><li>User dapat tidak perlu backup database secara manual.</li></ul><h3>1. MariaDB Clustering Setup</h3><ul><li><strong><em>VM mariadb01 : 192.168.56.102 (akan dijadikan master node)</em></strong></li><li><strong><em>VM mariadb02 : 192.168.56.103</em></strong></li></ul><h3>2. Install MariaDB service dari semua node</h3><p>Karena saat ini fitur Galera Cluster sudah digabungkan ke dalam MariaDB. Jadi, kita perlu menginstall dan mengkonfigurasi <strong><em>mariadb-server</em></strong> di kedua node. Kita bisa menginstalnya menggunakan perintah berikut:</p><pre>apt-get install mariadb-server -y</pre><p>Jalankan MariaDB service di semua node.</p><pre>systemctl start mariadb.service</pre><p>Untuk mengeceknya jalankan perintah berikut:</p><pre>systemctl status mariadb.service</pre><p>Kamu dapat melihat output seperti ini jika berhasil diinstall:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*WW2gYT6T0VJxeW7lgkQIEg.png" /></figure><p>masuk ke mysql consolenya untuk set password user rootnya</p><pre>$ mysql -u root<br>MariaDB[(none)]&gt; set password = password(&quot;your_password&quot;);<br>MariaDB[(none)]&gt; quit;<br></pre><p>Kita sekarang memiliki semua bagian yang diperlukan untuk mulai mengonfigurasi cluster, dan kita akan mengandalkan rsync pada langkah selanjutnya, pastikan kita sudah menginstall rsync tersebut:</p><pre>sudo apt install rsync</pre><h3>3. Konfigurasi Galera Cluster</h3><p>Selanjutnya, kita akan membuat sebuah file konfigurasi MariaDB Galera pada setiap node.</p><h4>Node Pertama</h4><p>Login ke node pertama dan buat file konfigurasi MariaDB Galera Cluster:</p><pre>nano /etc/mysql/conf.d/galera.cnf</pre><p>Tambahkan baris berikut dan sesuaikan IP Node dan nama Node-nya:</p><pre>[mysqld]<br>binlog_format=ROW<br>default-storage-engine=innodb<br>innodb_autoinc_lock_mode=2<br>bind-address=0.0.0.0<br><br># Galera Provider Configuration<br>wsrep_on=ON<br>wsrep_provider=/usr/lib/galera/libgalera_smm.so<br><br># Galera Cluster Configuration<br>wsrep_cluster_name=&quot;test_cluster&quot;<br>wsrep_cluster_address=&quot;gcomm://First_Node_IP,Second_Node_IP&quot;<br><br># Galera Synchronization Configuration<br>wsrep_sst_method=rsync<br><br># Galera Node Configuration<br>wsrep_node_address=&quot;This_Node_IP&quot;<br>wsrep_node_name=&quot;This_Node_Name&quot;</pre><p><em>*Tampilan node pertama akan seperti ini :</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*644J6Uy-b68vnqpAOb4L6w.png" /></figure><p>Simpan dan tutup.</p><p>Sekarang kita telah berhasil mengkonfigurasi pada node pertama, lakukan juga pada node berikutnya.</p><p><em>*Tampilan node kedua akan seperti ini :</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*a16EjFcBvAXsKrPKngPd-w.png" /></figure><h3>4. Starting the Galera Cluster</h3><p>Semua node sudah dikonfigurasi. Sekarang MariaDB Cluster sudah siap digunakan.</p><h4>Menghentikan MariaDB service di semua node</h4><p>pertama, menonaktifkan MariaDB server pada setiap node:</p><pre>systemctl stop mariadb</pre><h4>Aktifkan Galera Cluster pada node pertama</h4><p>Login ke node pertama (master) dan gunakan script galera_new_cluster untuk memulai clustering.</p><pre>galera_new_cluster</pre><p>Kita seharusnya tidak mendapatkan output apapun jika itu sukses.</p><p>Selanjutnya, verifikasi bahwa clustering sudah aktif dengan perintah berikut:</p><pre>mysql -u root -p -e &quot;SHOW STATUS LIKE &#39;wsrep_cluster_size&#39;&quot;</pre><p>Seharusnya akan keluar output seperti ini.</p><pre>+--------------------+-------+<br>| Variable_name      | Value |<br>+--------------------+-------+<br>| wsrep_cluster_size | 1     |<br>+--------------------+-------+</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*nykprNMd76xFt4lS_SwWSQ.png" /></figure><h4>Start the Second Node</h4><p>Login ke node kedua (slave) dan nyalakan MariaDB service untuk memulai clustering pada node kedua:</p><pre>systemctl start mariadb</pre><p>Selanjutnya, verifikasi bahwa clustering sudah aktif dengan perintah berikut:</p><pre>mysql -u root -p -e &quot;SHOW STATUS LIKE &#39;wsrep_cluster_size&#39;&quot;</pre><p>Output berikut menandakan bahwa node kedua sudah join ke cluster :</p><pre>+--------------------+-------+<br>| Variable_name      | Value |<br>+--------------------+-------+<br>| wsrep_cluster_size | 2     |<br>+--------------------+-------+</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*QjyT6g3EabkZxtc_nu_MoQ.png" /></figure><h3>5. Verify Replication</h3><h4>Create a Database and Table on the First Node</h4><p>Masuk ke node pertama dan konek ke MariaDB</p><pre>mysql -u root -p</pre><p>Buat database dengan nama <strong><em>localdb;</em></strong></p><pre>MariaDB [(none)]&gt; CREATE DATABASE localdb;</pre><p>Selanjutnya, masuk ke database <strong><em>locald</em></strong>b dan buat sebuah table dengan nama <strong><em>karyawan :</em></strong></p><pre>MariaDB [(none)]&gt; USE localdb;<br>MariaDB [classdb]&gt; CREATE TABLE karyawan (id int, name varchar(20), surname varchar(20));</pre><p>Selanjutnya, <strong><em>insert</em></strong> beberapa data ke table <strong>karyawan:</strong></p><pre>MariaDB [classdb]&gt; INSERT INTO karyawan VALUES (1,&quot;idris&quot;,&quot;azis&quot;);<br>MariaDB [classdb]&gt; INSERT INTO karyawan VALUES (2,&quot;indah&quot;,&quot;pratiwi&quot;);</pre><p>Sekarang, pastikan bahwa data sudah berhasil di masukkan:</p><pre>MariaDB [schooldb]&gt; SELECT * FROM karyawan;</pre><p>Output semestinya akan seperti ini:</p><pre>+------+-------+---------+<br>| id   | name  | surname |<br>+------+-------+---------+<br>|    1 | Idris | azis    |<br>|    2 | indah | pratiwi |<br>+------+-------+---------+</pre><p>Kalau kita lihat di node kedua, database sudah otomatis terbuat beserta table dan rownya.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qM9KIEZVvE78u-D3iur5Yw.png" /></figure><p>Jika sudah seperti ini, maka replication sudah berhasil.</p><p>Terimakasih :)</p><p>Untuk mempelajari lebih jauh seputar dunia IT terutama DevOps yuk gabung aja di Bumenet mumpung ada <a href="http://www.bumenet.com/">sertifikat IT gratis</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf2b0bc2d0b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Load Balancer Menggunakan Haproxy]]></title>
            <link>https://idrisaziz52.medium.com/load-balancer-menggunakan-haproxy-ada13b1a7492?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ada13b1a7492</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[haproxy]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 04:25:56 GMT</pubDate>
            <atom:updated>2024-04-02T06:15:05.651Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Cm1zrHMwl08olBq1EXg3Mg.png" /></figure><p>Ketika ribuan pengguna mengakses situs web atau aplikasi secara bersamaan, akan terjadi peningkatan <em>traffic </em>yang tinggi. Hal ini dapat menyebabkan <em>server </em>mengalami <em>overload </em>(<em>down</em>) karena tidak mampu menangani semua permintaan yang diterima. Untuk mengatasi situasi tersebut, <strong><em>HAProxy </em></strong>adalah salah satu solusi yang tepat.</p><h3>1. Apa Itu Haproxy</h3><p><strong><em>HAProxy </em></strong>adalah singkatan dari <strong><em>High Availability Proxy</em></strong>, yaitu perangkat lunak yang berfungsi sebagai penyeimbang <em>traffic </em>untuk aplikasi yang berbasis <em>HTTP </em>atau <em>TCP</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*DgkTWwu-V9k05ln4bWZuFw.png" /></figure><p>Sistem <strong><em>Haproxy </em></strong>bekerja dengan membagi permintaan atau <em>request </em>yang masuk ke beberapa server <em>backend </em>yang tersedia. Dengan demikian, beban server akan didistribusikan secara merata diantara server-server tersebut. Untuk lebih detailnya silahkan temen-temen bisa mencari di google. Karena ada banyak sekali referensi tentang <strong><em>haproxy</em></strong>.</p><p>Daripada kita bertele-tele akan lebih baik kita langsung praktek saja.</p><h3>2. Persiapan Tools</h3><p>Disini kita mempunya 2 server yang salah satunya bertugas sebagai haproxy</p><ul><li><strong><em>Haproxy</em></strong></li><li><strong><em>VM Haproxy Apps Web Server : 192.168.56.101</em></strong></li><li><strong><em>VM Apps Web Server : 192.168.56.102</em></strong></li></ul><p><strong><em>VM Haproxy</em></strong> akan bekerja sebagai <em>load balancer</em> juga sekaligus didalamnya akan ada aplikasi yang web-servernya. Karena keterbatasan <em>resource </em>dari laptop yang saya gunakan :) Tapi intinya secara konsep tidak akan berbeda jauh.</p><h3>3. Konfigurasi Haproxy</h3><p>Pertama kita <em>remote </em>terlebih dahulu server yang kita gunakan sebagai <em>loadbalancer </em>untuk nanti kita <em>install </em><strong><em>haproxy </em></strong>dan konfigurasi disana.</p><p>Install <strong><em>Haproxy</em></strong></p><p>apt install haproxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*UxB_a0vS9qRH6WZZ1L_oUQ.png" /></figure><p>Karena sebelumnya saya sudah install haproxy maka akan keluar output seperti. Jika pertama kali, klik saja Y untuk konfirmasi <strong><em>installasi Haproxy </em></strong>di server.</p><p><em>Backup </em>terlebih dahulu konfigurasi <strong><em>haproxy </em></strong><em>defaultnya</em></p><p>cd /etc/haproxy<br>cp haproxy.cfg haproxy.cfg-bkp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*hLKoojoPyBE0UlpMkJBeFw.png" /></figure><p>Masuk ke konfigurasi <strong><em>Haproxy</em></strong>nya dan tambahkan <em>script </em>dibawah ini sebagai <em>listener-</em>nya. Letakkan saja dipaling bawah.</p><pre>frontend front-loadbalance<br>        bind 192.168.56.101:8088<br>        mode http<br>        default_backend be-loadbalance</pre><p>Berikutnya tambahkan konfigurasi untuk backend web server.</p><pre>backend be-loadbalance<br>        mode http<br>        balance roundrobin<br>        option forwardfor<br>        server node-1 192.168.56.101:3001 check<br>        server node-2 192.168.56.102:3001 check</pre><p>Terakhir konfigurasi tambahan untuk <em>statistik </em><strong><em>HAProxy</em></strong>.</p><pre>listen stats<br>        bind 192.168.56.101:8089<br>        stats enable<br>        stats hide-version<br>        stats refresh 30s<br>        stats show-node<br>        stats auth username:password<br>        stats uri /stats</pre><p>Untuk konfigurasi secara lengkap ada dibawah ini :</p><pre>global<br>        log /dev/log    local0<br>        log /dev/log    local1 notice<br>        chroot /var/lib/haproxy<br>        stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners<br>        stats timeout 30s<br>        user haproxy<br>        group haproxy<br>        daemon<br><br>        # Default SSL material locations<br>        ca-base /etc/ssl/certs<br>        crt-base /etc/ssl/private<br><br>        # See: https://ssl-config.mozilla.org/#server=haproxy&amp;server-version=2.0.3&amp;config=intermediate<br>        ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384<br>        ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256<br>        ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets<br><br>defaults<br>        log     global<br>        mode    http<br>        option  httplog<br>        option  dontlognull<br>        timeout connect 5000<br>        timeout client  50000<br>        timeout server  50000<br>        errorfile 400 /etc/haproxy/errors/400.http<br>        errorfile 403 /etc/haproxy/errors/403.http<br>        errorfile 408 /etc/haproxy/errors/408.http<br>        errorfile 500 /etc/haproxy/errors/500.http<br>        errorfile 502 /etc/haproxy/errors/502.http<br>        errorfile 503 /etc/haproxy/errors/503.http<br>        errorfile 504 /etc/haproxy/errors/504.http<br><br>frontend front-loadbalance<br>        bind 192.168.56.101:8088<br>        mode http<br>        default_backend be-loadbalance<br><br>backend be-loadbalance<br>        mode http<br>        balance roundrobin<br>        option forwardfor<br>        server node-1 192.168.56.101:3001 check<br>        server node-2 192.168.56.102:3001 check<br><br>listen stats<br>        bind 192.168.56.101:8089<br>        stats enable<br>        stats hide-version<br>        stats refresh 30s<br>        stats show-node<br>        stats auth username:password<br>        stats uri /stats</pre><p><em>Restart </em><strong><em>Haproxy</em></strong></p><p>systemctl restart haproxy</p><p>Untuk akses <strong><em>Haproxy </em></strong><em>web interface</em>, buka di <em>browser </em>dan masukkan alamat ip dengan <em>port 8089 </em>yang sebelumnya sudah kita set di konfigurasi <strong><em>Haproxy</em></strong>, dibagian <strong><em>listen stats</em></strong>. <strong><em>URL </em></strong>format seharusnya <a href="http://your_server_ip:3000/">http://your_server_IP:</a>8089.</p><p>login menggunakan <em>username</em>: username dan <em>password</em>: password</p><p>Jika berhasil tampilan akan seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qpRaUhIh1HBEA_3yvmLmTw.png" /></figure><p>Kalau kita lihat dibagian <strong><em>be-loadbalance</em></strong>, kedua node masih merah atau menandakan aplikasi BE kita belum <em>running</em>.</p><h3>4. Menjalankan Apps Backend</h3><p>Jalankan <em>command </em>dibawah di kedua server (192.168.56.101, dan 192.168.56.102)</p><p>docker run -d --name idrisazis-backend_cat-1.0 -p 3001:3000 idrisazis/backend_categorization:1.0</p><p><em>Backend </em>dijalankan menggunakan <strong><em>docker </em></strong>pastikan bahwa port 3001 anda <em>available</em>/atau tidak sedang digunakan.</p><p><strong><em>Server/Node</em></strong> 1 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nwbl67RIPFoxrmwTROgXtg.png" /></figure><p><strong><em>Server/Node</em></strong> 2 :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4eNsxmRmIoot6KFonT_jtg.png" /></figure><p>Taraaa…. masing-masing <em>node </em>kini sudah berwarna hijau atau sudah aktif</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_FoTtsPRBsqc_UFMs21AQ.png" /></figure><p>Untuk bukti pengujian silahkan kita akses <a href="http://your_server_ip:3000/">http://your_server_IP:</a>8088/api/categorization</p><p>Hasil akhirnya akan seperti ini. Dan kalau kita matikan salah satu <em>node</em>. <em>Service BE </em>akan tetap bisa diakses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sY98QrayzZ8E0C2JkPfWXA.png" /></figure><p>Kunjungi website kami untuk mengenal lebih jauh tentang DevOps, dan perihal dunia IT lainnya <a href="http://www.bumenet.com/">Bumenet</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ada13b1a7492" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote Server dengan SSH Tanpa Password (Passwordless)]]></title>
            <link>https://idrisaziz52.medium.com/remote-server-dengan-ssh-tanpa-password-passwordless-055511291278?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/055511291278</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[secure-shell]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Wed, 06 Mar 2024 06:41:58 GMT</pubDate>
            <atom:updated>2024-03-06T06:41:58.792Z</atom:updated>
            <content:encoded><![CDATA[<p>SSH Secure Shell Protocol adalah protokol kriptograpi untuk keamanan data koneksi dan perintah untuk remote ke server tertentu.</p><p>Pada artikel ini, kita akan melakukan bagaimana konfigurasi SSH tanpa password untuk login ke remote server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*jMzsCooI8hMyxhjSPKJyxg.jpeg" /></figure><p>Sebelum kita memulai, diharapkan sudah menginstall sshd pada masing-masing server.</p><h3>1. Connect to remote machine</h3><p>Jalankan perintah remote ssh seperti biasanya. Jika itu pertama kali melakukan remote biasanya akan muncul seperti ini:</p><blockquote><strong><em>The authenticity of host XXXXXX can’t be established.</em></strong></blockquote><blockquote><strong><em>RSA key fingerprint is </em></strong>SHA256:zV6Qr5PZ WvTFXB8ChfT6WS03h8PzXaqrbMd46uO7tQ<strong><em>.</em></strong></blockquote><blockquote><strong><em>Are you sure you want to continue connecting (yes/no)?</em></strong></blockquote><pre>ssh &lt;remote_username&gt;@&lt;ip-server&gt;</pre><p>Ketik Yes saja, lalu enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*v39W3RYTMZttG0O-ztJdbA.png" /></figure><h3>2. Generate private and public keys</h3><p>Kembali ke localhost server kita, key yang nanti digunakan harus di create/generate dengan command :</p><pre>ssh-keygen</pre><p>Tekan enter tiga kali sampai selesai. Public key akan tersimpan di path ~/.ssh/id_rsa.pub dan file private key akan di generate di ~/.ssh/id_rsa</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*aDbt45N8H-LD5nraQ0A-mA.png" /></figure><h3>3. Copy the public key file to the remote machine</h3><p>Setelah kita berhasil meng-generate SSH key pair, saatnya untuk menyalin key tersebut ke remote server yang akan kita tuju. Sehingga kedepan saat kita meremote server tak perlu lagi dimintai password untuk masuk.</p><pre>ssh-copy-id &lt;remote_username&gt;@&lt;ip-server&gt;</pre><p>Output akan seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*NyMrELFuif_8IxbKhNktLg.png" /></figure><h3>4. Login to your server using SSH keys</h3><p>Saat ini, melakukan remote akan jauh lebih cepat dan efisien</p><p>$ ssh remote_username@remote_server_ip_address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*lJ8OAqao0m8XpOgFgKHJ7Q.png" /></figure><p>Taraaaa….. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=055511291278" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Monitoring Grafana, Prometheus, Node Exporter]]></title>
            <link>https://idrisaziz52.medium.com/install-monitoring-grafana-prometheus-node-exporter-91786a54ef91?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/91786a54ef91</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sysadmin]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 09:05:07 GMT</pubDate>
            <atom:updated>2024-03-06T04:34:41.397Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Grafana </em></strong>adalah perangkat lunak untuk visualisasi data dan monitoring. <strong><em>Grafana </em></strong>dapat mengambil data dari berbagai sumber, termasuk <strong><em>Prometheus</em></strong>, dan memungkinkan pengguna untuk membuat dashboard yang menampilkan data dalam bentuk grafik, tabel, dan grafis lainnya.</p><p>Dalam artikel ini, kita akan membahas cara melakukan <strong><em>setup Prometheus</em></strong> dan <strong><em>Grafana</em></strong>, mengkonfigurasi <em>datasource</em>, membuat <em>dashboard </em>untuk memvisualisasikan metrik yang dikumpulkan.</p><p>Ada 3 yang nanti akan kita install: <strong><em>Grafana</em></strong>, <strong><em>Prometheus</em></strong>, dan <strong><em>Node Exporter</em></strong>.</p><h3>1. Install Grafana Server</h3><p>Pertama, kita jalankan <em>command </em>untuk <em>install packages </em>yang diperlukan.</p><pre>sudo apt install -y apt-transport-https software-properties-common wget</pre><p>Tambahkan <strong><em>Grafana GPG key</em></strong></p><pre>sudo mkdir -p /etc/apt/keyrings/<br>wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg &gt; /dev/null</pre><p>Tambahkan <strong><em>Grafana APT repository</em></strong> dan lakukan <em>update</em></p><pre>echo &quot;deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main&quot; | sudo tee -a /etc/apt/sources.list.d/grafana.list<br>sudo apt update</pre><p>Langkah berikutnya adalah menginstall <strong><em>grafana</em></strong></p><pre>sudo apt install grafana</pre><p>Untuk akses <strong><em>Grafana </em></strong><em>web interface</em>, buka di <em>browser </em>dan masukkan alamat ip dengan <em>port </em>3000. URL format seharusnya <a href="http://your_server_ip:3000/">http://your_server_IP:3000</a>. Seharusnya kita diarahkan ke halaman login <strong><em>Grafana</em></strong>. <em>Credential defaultnya </em>:</p><ul><li>Username: admin</li><li>Password: admin</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSAvYGg29JvbGuoPx1_N9A.png" /></figure><h3>2. Install Prometheus</h3><p>Sebelum kita <em>install </em><strong><em>Prometheus </em></strong>ada baiknya kita buat dulu <em>user </em>dan <em>group</em> yang bernama “<strong><em>prometheus</em></strong>”. Untuk mengantisipasi resiko <em>unauthorized</em> <em>access</em>.</p><pre>sudo groupadd --system prometheus<br>sudo useradd -s /sbin/nologin --system -g prometheus prometheus</pre><p>Buat directori untuk menyimpan file konfigurasi dan kumpulan librari untuk <strong><em>prometheus</em></strong>. Direktori akan berada di path /etc dan /var/lib Gunakan command berikut untuk membuat direktori.</p><pre>sudo mkdir /etc/prometheus<br>sudo mkdir /var/lib/prometheus</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*79coWKohjsITq7DOvAxAsg.png" /></figure><p><em>Download </em>dan <em>extract </em><strong><em>prometheus </em></strong>di <a href="https://prometheus.io/download/#prometheus">Prometheus official downloads site</a> menggunakan <em>wget.</em></p><pre>wget https://github.com/prometheus/prometheus/releases/download/v2.43.0/prometheus-2.43.0.linux-amd64.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHyCOkV5FDiCpME_tlAeJg.png" /></figure><p>Setelah <em>download </em>selesai, jalankan perintah untuk mengextrak file:</p><pre>tar vxf prometheus*.tar.gz</pre><p>Kita perlu memindahkan beberapa binari file (<strong>prometheus</strong> and <strong>promtool</strong>) ke /var/local/bin dan ubah <em>ownership </em>file ke “<strong><em>prometheus</em>”</strong> user dan group.</p><pre>sudo mv prometheus /usr/local/bin<br>sudo mv promtool /usr/local/bin<br>sudo chown prometheus:prometheus /usr/local/bin/prometheus<br>sudo chown prometheus:prometheus /usr/local/bin/promtool</pre><p>Selanjutnya, pindahkan konfigurasi <em>file </em>dan <em>set ownership </em>agar <strong><em>Prometheus</em></strong> dapat diakses.</p><pre>sudo mv consoles /etc/prometheus<br>sudo mv console_libraries /etc/prometheus<br>sudo mv prometheus.yml /etc/prometheus</pre><pre>sudo chown prometheus:prometheus /etc/prometheus<br>sudo chown -R prometheus:prometheus /etc/prometheus/consoles<br>sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries<br>sudo chown -R prometheus:prometheus /var/lib/prometheus</pre><p>Fileprometheus.yml adalah file konfigurasi utama yang didalamnya dapat mengatur target yang dimonitor.</p><pre>sudo nano /etc/prometheus/prometheus.yml</pre><p>Berikut adalah isi file konfigurasi prometheus secara default.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*i4zVvAL_AQ9vbBo37hcevQ.png" /></figure><p>Buat <em>Systemd Prometheus Service</em> agar kedepan <strong><em>Prometheus </em></strong>lebih mudah untuk di manage sebagai <em>system service</em> di Sistem Operasi.</p><pre>sudo nano /etc/systemd/system/prometheus.service</pre><p>Berikut <em>copy </em>dan <em>paste </em>dalam <em>service</em>.</p><pre>[Unit]<br>Description=Prometheus<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>User=prometheus<br>Group=prometheus<br>Type=simple<br>ExecStart=/usr/local/bin/prometheus \<br>    --config.file /etc/prometheus/prometheus.yml \<br>    --storage.tsdb.path /var/lib/prometheus/ \<br>    --web.console.templates=/etc/prometheus/consoles \<br>    --web.console.libraries=/etc/prometheus/console_libraries<br><br>[Install]<br>WantedBy=multi-user.target</pre><p><em>Reload Systemd</em></p><pre>sudo systemctl daemon-reload</pre><p><em>Start </em><strong><em>Prometheus </em></strong><em>service</em></p><pre>sudo systemctl enable prometheus<br>sudo systemctl start prometheus</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qcyQZIrnITo6THLm14xSQ.png" /></figure><h3>3. Install Node Exporter</h3><p>Kita perlu download <strong><em>Node Exporter</em></strong> <em>binary </em>di <a href="https://prometheus.io/download/#node_exporter">available for Linux in the official Prometheus website here</a> dengan menggunakan <em>wget</em>.</p><pre>wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64tVxeoW4Ow9MQOCP7Du4Q.png" /></figure><p>Ekstrak <strong><em>Node Exporter</em></strong> dan pindahkan <em>binary</em></p><pre>tar xvf node_exporter-*.tar.gz</pre><p>Kita perlu memindahkan binary file node_exporter ke/usr/local/bin direktori <em>system</em>.</p><pre>cd node_exporter-1.3.1.linux-amd64<br>sudo cp node_exporter /usr/local/bin</pre><p>Buat <em>user </em><strong><em>Node Exporter</em> </strong>dan <em>set owner binary</em> <strong><em>node_exporter </em></strong>ke <em>user </em>yang sudah kita <em>define</em>.</p><pre>sudo useradd --no-create-home --shell /bin/false node_exporter<br>sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter</pre><p>Buat dan jalankan <strong><em>Node Exporter</em></strong> <em>service</em></p><pre>sudo nano /etc/systemd/system/node_exporter.service</pre><p>Berikut <em>copy </em>dan <em>paste </em>dalam <em>service</em>.</p><pre>[Unit]<br>Description=Node Exporter<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>User=node_exporter<br>Group=node_exporter<br>Type=simple<br>ExecStart=/usr/local/bin/node_exporter<br>Restart=always<br>RestartSec=3<br><br>[Install]<br>WantedBy=multi-user.target</pre><p><em>Reload Systemd</em></p><pre>sudo systemctl daemon-reload</pre><p><em>Start </em><strong><em>node_exporter </em></strong><em>service</em></p><pre>sudo systemctl enable node_exporter<br>sudo systemctl start node_exporter</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDkYC_hLw7YPtPiPi4h_8g.png" /></figure><p>Untuk mengecek apakah <strong><em>node_exporter </em></strong>sudah berhasil di <em>install</em>. Akses di browser <a href="http://your_server_ip:3000/">http://your_server_IP:9</a>100/metrics. Jika sukses tampilan akan seperti ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URTAMBSOB97nIz-CROPuAg.png" /></figure><h3>4. Integrasi Grafana dengan Prometheus</h3><p>Tambahkan <em>script </em>konfigurasi tersebut di file <strong><em>prometheus </em></strong>untuk mendefine <strong><em>node exporter</em></strong> yang sudah kita install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bixmHUYnLFjU0Is8rtuFRw.png" /></figure><p><em>Restart</em> <strong><em>prometheus</em></strong> dan <strong><em>grafana</em></strong></p><pre>systemctl restart prometheus<br>systemctl restart grafana-server</pre><p>Setelah itu, masuk ke <em>dashboard </em><strong><em>Grafana</em></strong>, klik <em>sidebar </em>kiri, lalu pilih <strong><em>Connection &gt; Data sources</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YguMLghg6lsRUxKRXd7iEQ.png" /></figure><p><strong><em>Add Data Source</em></strong> &gt; pilih <strong><em>Prometheus</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yh1P7cE3r8kJJw6-ulF-YQ.png" /></figure><p>Masukkan url <strong><em>prometheus </em></strong>yang sudah kita <em>set </em>tadi. Secara <em>default url </em>akan seperti ini <a href="http://your_server_ip:3000/">http://your_server_IP:</a>9090</p><p>Lalu <strong><em>Save &amp; Test</em></strong>.</p><p>Berikutnya adalah <em>mensetting </em><strong><em>node exporter</em></strong> kita menjadi <em>dashboard </em>utama.</p><p>Masuk <strong><em>Dashboard </em></strong>&gt; <em>Create Dashboard </em>&gt; <em>Import Dashboard</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLsromVOusJPRapPL5G4FA.png" /></figure><p>Isi kolom <em>import dashboard </em>1860, lalu <strong><em>Load</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_qK-5JcO2XcV3LwD3Yu8w.png" /></figure><p>Selanjutnya <strong><em>Grafana </em></strong>akan mengarahkan kita ke halaman berikut</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTYGS6Kkhy1wPBrlnv7T6g.png" /></figure><p>isi Name sesuai dengan keinginan. Dikolom <strong><em>Prometheus </em></strong>isi dengan prometheus, lalu <strong><em>Import.</em></strong></p><p>Taraaa….. :)</p><p>Jika berhasil anda akan diarahkan ke halaman dashboard yang sudah menampilkan report monitoring server anda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vF7z-hgh9JDk6sp0k0Ar_A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91786a54ef91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Harbor Docker Image Registry di Ubuntu 20.04]]></title>
            <link>https://idrisaziz52.medium.com/install-harbor-docker-image-registry-di-ubuntu-20-04-223408763cf5?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/223408763cf5</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[harbor]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[image-registry]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Tue, 02 Jan 2024 07:56:51 GMT</pubDate>
            <atom:updated>2024-08-14T10:06:01.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VYGCst0ngaLhUzMwTVsRA.png" /><figcaption>Logo Harbor Image Registry</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2SDEdpI0Rf1iz_rEgvmQXA.png" /></figure><p><strong>Harbor </strong>adalah <em>Image Registry Docker</em> open-source untuk lingkungan <em>cloud-native</em>. Sebagai <em>Image Registry</em>, <em>harbor </em>digunakan untuk menyimpan dan mendistribusikan <em>image </em>container. Untuk mengamankan artefak, <em>harbor</em> menyediakan perlindungan keamanan melalui kebijakan, kontrol akses berbasis peran pengguna, pemindai keamanan untuk <em>image </em>untuk memastikan <em>image </em>terbebas dari kerentanan, dan <em>image signing</em> yang memastikan pengguna mengambil <em>image </em>dari <em>registry </em>tepercaya.</p><ol><li><a href="https://www.howtoforge.com/how-to-install-harbor-docker-image-registry-on-ubuntu-22-04/#downloading-harbor-installer">Downloading Harbor Installer</a></li><li><a href="https://www.howtoforge.com/how-to-install-harbor-docker-image-registry-on-ubuntu-22-04/#configuring-harbor-installation">Configuring Harbor Installation</a></li><li><a href="https://www.howtoforge.com/how-to-install-harbor-docker-image-registry-on-ubuntu-22-04/#installing-harbor-via-installer-script-and-docker-compose">Installing Harbor via Installer Script and Docker Compose</a></li></ol><p>Sebelum kita menginstall <em>Harbor </em>pada server kita, diharapkan sudah memiliki service/aplikasi :</p><ul><li>Docker</li><li>Docker Compose</li></ul><p>Jika belum, silahkan install terlebih dahulu.</p><h3>1. Downloading Harbor Installer</h3><p>Kita perlu mendownload harbor installer package untuk menginstall harbor. Ada dua tipe dari harbor installer, install secara offline dan online.</p><p>Artikel ini menggunakan skema install secara offline. Jadi sekarang kita perlu mendownload harbor offline installer ke server kita.</p><p>Pindah ke directory<strong> ‘/ tmp’ </strong>dan download harbor dengan perintah curl seperti dibawah.</p><pre>cd /tmp<br>curl -s https://api.github.com/repos/goharbor/harbor/releases/latest | grep browser_download_url | cut -d &#39;&quot;&#39; -f 4 | grep &#39;\.tgz$&#39; | wget -i -</pre><p>Ekstrak harbor offline installer dengan perintah tar. lalu akan muncul directory dengan nama <em>harbor.</em></p><pre>tar -xzvf harbor-offline-installer-v2.6.1.tgz</pre><p>Pindahkan directory Harbor ke /opt</p><pre>sudo mv harbor /opt/</pre><h3>2. Configuring Harbor Installation</h3><p>Pindah ke directory<em> </em><strong><em>‘/opt/harbor’.</em></strong></p><pre>cd /opt/harbor</pre><p>Salin harbor configuration template <strong><em>‘harbor.yml.tmpl’</em></strong> to <strong><em>‘harbor.yml’.</em></strong></p><pre>cp harbor.yml.tmpl harbor.yml<br>sudo nano harbor.yml</pre><p>Ubah detail <em>configuration </em>seperti berikut.</p><pre># Configuration file of Harbor<br><br># The IP address or hostname to access admin UI and registry service.<br># DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.<br>hostname: harbor.idris.local<br><br># http related config<br>http:<br>  # port for http, default is 80. If https enabled, this port will redirect to https port<br>  port: 80<br><br># https related config<br>#https:<br>  # https port for harbor, default is 443<br>#  port: 443<br>  # The path of cert and key files for nginx<br>#  certificate: /your/certificate/path<br>#  private_key: /your/private/key/path<br><br># # Uncomment following will enable tls communication between all harbor components<br># internal_tls:<br>#   # set enabled to true means internal tls is enabled<br>#   enabled: true<br>#   # put your cert and key files on dir<br>#   dir: /etc/harbor/tls/internal<br>#   # enable strong ssl ciphers (default: false)<br>#   strong_ssl_ciphers: false<br><br># Uncomment external_url if you want to enable external proxy<br># And when it enabled the hostname will no longer used<br># external_url: https://reg.mydomain.com:8433<br><br># The initial password of Harbor admin<br># It only works in first time to install harbor<br># Remember Change the admin password from UI after launching Harbor.<br>harbor_admin_password: Idris123<br><br># Harbor DB configuration<br>database:<br>  # The password for the root user of Harbor DB. Change this before any production use.<br>  password: Idris123Local<br>  # The maximum number of connections in the idle connection pool. If it &lt;=0, no idle connections are retained.<br>  max_idle_conns: 100<br>  # The maximum number of open connections to the database. If it &lt;= 0, then there is no limit on the number of open connections.<br>  # Note: the default number of connections is 1024 for postgres of harbor.<br>  max_open_conns: 900<br>  # The maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If it &lt;= 0, connections are not closed due to a connection&#39;s age.<br>  # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as &quot;300ms&quot;, &quot;-1.5h&quot; or &quot;2h45m&quot;. Valid time units &gt;<br>  conn_max_lifetime: 5m<br>  # The maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If it &lt;= 0, connections are not closed due to a connection&#39;s idle time.<br>  # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as &quot;300ms&quot;, &quot;-1.5h&quot; or &quot;2h45m&quot;. Valid time units &gt;<br>  conn_max_idle_time: 0<br><br># The default data volume<br>data_volume: /data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tF6EDU-946ExCuhZHV2Pg.png" /></figure><p>Berikut detail konfigurasinya:</p><ul><li><strong>hostname</strong> — domain name yang digunakan untuk akses di browser beserta dengan <strong>port: 80.</strong></li><li><strong>harbor_admin_password</strong> — Password yang digunakan untuk otentikasi login di browser dengan <strong>username: admin.</strong></li><li><strong>database</strong> — database konfigurasi untuk harbor.</li></ul><h3>3. Installing Harbor via Installer Script and Docker Compose</h3><p>Now run the harbor installer script<strong> ‘<em>install.sh</em>’ </strong>with sudo privileges.</p><p>Masuk ke directory <strong><em>‘/opt/harbor’</em></strong></p><pre>cd /opt/harbor<br>sudo ./install.sh</pre><p>Script Installer akan mengecek system requirement terlebih dahulu sebelum mulai menginstall harbor. Installer memastikan Docker engine dan Docker Compose sudah terinstall di system.</p><p>Tunggu sampai selesai.</p><p>Next, open your web browser and visit the domain name for your harbor installation (i.e: <a href="https://registry.hwdomain.io/">https://registry.hwdomain.io/</a>). And you should now get the login page of your harbor image registry.</p><p>Lanjut, buka browser dan kunjungi domain yang tadi sudah diset. (i.e: <a href="https://registry.hwdomain.io/">http://harbor.idris.local/</a>)</p><p>Login dengan default user admin and the password yang sudah di konfigurasi di file ‘<em>harbor.yml</em>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*97F3MKw0rJ8Ou0Lg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbco91w41oYVdNI-Ux3eMg.png" /></figure><p>Taraaa… :)</p><p>referensi : <a href="https://www.howtoforge.com/how-to-install-harbor-docker-image-registry-on-ubuntu-22-04/">https://www.howtoforge.com/how-to-install-harbor-docker-image-registry-on-ubuntu-22-04/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=223408763cf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara Install Gitlab CE dengan Docker]]></title>
            <link>https://idrisaziz52.medium.com/cara-install-gitlab-ce-dengan-docker-22010bbc0d8c?source=rss-e48146f4b2d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/22010bbc0d8c</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[gitlab-ci-docker]]></category>
            <category><![CDATA[gi̇t]]></category>
            <category><![CDATA[devops-tool]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Idrisaziz]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 12:17:41 GMT</pubDate>
            <atom:updated>2023-09-02T12:17:41.756Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65Nbs8UGpn5Jhw0KcGCpFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3cBOh56aWDe-3GmAWghzg.png" /></figure><p>Kali ini kita akan melakukan instalasi gitlab-ce dengan docker. Mengapa dengan docker? Yaps betul menurut saya dengan kita menggunakan docker instalasi akan jauh lebih mudah.</p><h3>1. Running Container Gitlab CE</h3><pre>docker run -d --publish 1443:443 --publish 8081:80 --publish 1022:22 \<br> --name gitlab \<br> --restart always \<br> --volume gitlab_config:/etc/gitlab \<br> --volume gitlab_logs:/var/log/gitlab \<br> --volume gitlab_data:/var/opt/gitlab \<br> --shm-size 2gb \<br>gitlab/gitlab-ce:latest</pre><p>Periksa container apakah sudah berjalan, dengan perintah docker ps.</p><p>Untuk starting awal membutuhkan waktu yang lama mungkin sekitar 2–4 menit jadi tunggu saja sampai prosesnya selesai.</p><p>Jika sudah selesai, di status akan ada tulisan <strong><em>healthy</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYgJvRMlFgZz2CQNpKq_5A.png" /></figure><p>untuk mengecek lebih lanjut kita mengecek lognya, dengan perintah docker logs gitlab -f</p><h3>2. Login Gitlab</h3><p>Sekarang, akses urlnya dari gitlab yang sudah kita install tadi.</p><p><a href="http://192.168.56.104:8081/">http://192.168.56.104:8081</a></p><p>Username defaultnya adalah <strong><em>root</em></strong>, dan melihat passwordnya kamu cukup jalankan command ini:</p><p>docker exec -it gitlab grep &#39;Password:&#39; /etc/gitlab/initial_root_password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*K-Hoyu33iz05Jzp34GN8yw.png" /></figure><p>Akan lebih baik jika diganti password menjadi lebih ringkas.</p><h3>3. Nginx Web Service (Berikan domain untuk gitlab)</h3><p>Setting konfigurasi di Nginx kita</p><p>cd /etc/nginx/sites-enabled/</p><p>nano gitlab.conf</p><pre>server {<br><br>    listen 80;<br>    server_name code.idris.com;<br><br>    location / {<br>      proxy_set_header        Host $host:$server_port;<br>      proxy_set_header        X-Real-IP $remote_addr;<br>      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;<br>      proxy_set_header        X-Forwarded-Proto $scheme;<br><br>      # Fix the &quot;It appears that your reverse proxy set up is broken&quot; error.<br>      proxy_pass          http://127.0.0.1:8081;<br>      proxy_read_timeout  90;<br><br>      proxy_redirect      http://127.0.0.1:8081 https://code.idris.com;<br><br>      # Required for new HTTP-based CLI<br>      proxy_http_version 1.1;<br>      proxy_request_buffering off;<br><br>      add_header &#39;X-SSH-Endpoint&#39; &#39;code.idris.com:50022&#39; always;<br>    }<br><br>      listen 443 ssl; # managed by Certbot<br>      ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;<br>      ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;<br>      ssl_dhparam /etc/ssl/certs/dhparam.pem;<br><br>}</pre><p>restart nginx kita</p><p>systemctl restart nginx</p><p>lalu akses dengan domain baru kita.</p><p><a href="http://192.168.56.104:8081/">http://code.idri</a>s.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AN1QBn-aAGZJ4ltB3E_psg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDKKxH1mqkJEKDLvEMv_pQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22010bbc0d8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>