Showing posts with label Centos/RHEL 7. Show all posts
Showing posts with label Centos/RHEL 7. Show all posts

Saturday, December 16, 2017

Setup Elasticsearch Cluster on CentOS 7

       Halo sobat Nostra, pada kali ini saya akan sharing lagi tentang elasticsearch cluster. Elasticsearch adalah "RESTful search and analytics engine" yang merupakan salah satu database yang masuk ke dunia NoSQL dengan fokus di search engine database. Elasticsearch mengasumsikan indeks sebagai "database", types sebagai "tabel" dan dokumen sebagai record atau row, sedangkan mapping dapat diasumsikan sebagai "skema tabel".


Versi elasticsearch yang akan diinstall adalah elasticsearch-5.6.3. Elasticsearch membutuhkan java, maka pastikan di system kita telah terinstall java. Untuk elasticsearch kita menggunakan 3 server cluster dengan mode master=true untuk setiap server (master-eligible). Mode master ini berarti setiap node dapat berperan untuk memanage cluster,indices dan menentukan di node mana shards (data-part) akan disimpan. Oke, langsung saja kita ke bagian Setup dan Configure :


1.  Download package rpm elasticsearch di setiap server dengan menggunakan wget.


2.  Jalankan package dengan command :


3.  Enable service elasticsearch.


4.  Edit file configurasi elasticsearch yang berada di /etc/elasticsearch/elasticsearch.yaml


5.  Konfigurasi untuk server 1 :


6.  Konfigurasi untuk server 2 :


7.  Konfigurasi untuk server 3 :


8.   Jalankan elasticsearch di setiap server dengan command :


9.   Elasticsearch akan berjalan di port 9200 untuk http dan 9300 untuk tcp connection.

10.  Check status elasticsearch cluster dengan command berikut :

Sekian sharing kali ini, semoga bermanfaat.

Referensi : 
-https://www.elastic.co/guide/index.html
-https://www.digitalocean.com/community/tutorials/how-to-set-up-a-production-elasticsearch-cluster-on-ubuntu-14-04

Friday, December 15, 2017

BROTLI compression with NGINX

     Hello guys, this time i wanna share about BROTLI. What is brotli?, Why Brotli?, Comparison and how to build the packages. Let's begin with what brotli is.      

BROTLI is a new compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm + Huffman algorithms.
LZ77 overview :
abcdeabcdf can be compressed with LZ77 to abcde<4,5>f and aaaaaaaaaa can be compressed to simply a<9, 1>.
Huffman : Bit Conversion. I will not discuss this in depth but if you want to, take a look on this brotli-ietf.

Developed by Google.
Why Brotli?

The smaller compressed size allows for better space utilization and faster page loads.
As the smaller compressed size would give additional benefits to mobile users, such as lower data transfer fees and reduced battery useCompressed content takes less time to transfer and reduces load times.

Brotli comes  with 0 to 9 levels of compression.


Comparison with others?



Browser Support?

Brotli compression not yet supported by all varian of web browser, so make sure you have a "PLAN B" compression such as gzip. 


Build the package?

Default nginx package not include brotli module, so we must add brotli module manually and rebuild the nginx package. Even there is bortli-included nginx package on the web (not official), it's recommended to build it yourself in concern of security. So, follow this step

I'm using Centos 7 when i build the package.

- Install the prerequisite package

- Download nginx package using wget. Pull ngx_brotli module using git and update the module.


- Before we configure nginx, add nginx user and temporary folder

- Decompress nginx package and configure nginx to include the ngx_brotli module. After that make the installment.

 
- Check nginx version

- Next, we need to make nginx systemd service

- Run nginx service to make sure it's running and enable it

- Configure nginx.conf file to enable brotli module, in my case i enabled the gzip algorithm too, because in case the browser not support with brotli it will redirect the algorithm to gzip.

- And then restart nginx

Result ?

This is the result sample when brotli compression implemented with nginx server.



Happy Brotling !!!


Referensi :
- https://www.enovate.co.uk/blog/2017/02/28/how-to-brotli-compression-with-nginx
- https://certsimple.com/blog/nginx-brotli
- https://sekolahlinux.com/implementasi-nginx-libressl-http2-brotli-pada-centos-7

Sunday, June 18, 2017

Instalasi GUI pada CentOS / RHEL 7

    Hello, kali ini saya akan sharing mengenai Instalasi GUI pada server CentOS/RHEL 7. Kenapa?, bukannya terdapat pilihan “Server with GUI” pada saat proses instalasi? Yaa, memang Ada. Tapi, bagaimana kalau pada saat proses instalasi kita memilih Minimal Install (“Server tanpa GUI”, yang artinya hanya terdapat terminal)? Nah, bukan berarti kita harus mengulangi proses instalasi server dari awal dan menghapus server yang lama.
GUI ini dibutuhkan secara mandatory contohnya pada kasus instalasi Oracle Infrastucture, SOA Suite, dll yang menampilkan Output Interface untuk tampilan program instalasi (.jar). Daripada install server dari awal, lebih baik ikuti langkah berikut :
-  Terdapat grouplist package yang ada pada linux server.
# yum grouplist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Available Environment Groups:
   Minimal Install
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI  “ package group GUI
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Development Tools
   Graphical Administration Tools
- Install package group dengan yum
# yum groupinstall "Server with GUI"
Transaction Summary
====================================================
Install  199 Packages (+464 Dependent packages)
Upgrade               (   8 Dependent packages) 
Total download size: 523 Ma
Is this ok [y/d/N]:y

- Nah, setelah selesai terinstall, set GUI ke target server.
# systemctl set-default graphical.target
- Start GUI tanpa reboot dan verifikasi
# systemctl start graphical.target
# systemctl get-default
graphical.target

Done. That’s all, from minimal install without GUI we change it to Server with GUI.

Referensi :