Posts

Showing posts from December, 2019

MongoDB BI Connector - a more elaborative guide

Image
It's been a while since I last wrote about MongoDB BI Connector but I felt it's still quite important as most people still feel more comfortable getting their information from using conventional tabular format.  Let's get started! 0. Where to Download Simple choose the platform you would like to host your MongoDB BI Connector process 1. How to install   A. on windows Simply download the .msi, keep everything as default, just click next when prompted, and hit Finish to close the window when installation is completed. B. on linux, will try to point out the difference in the distribution if I encounter any Here I am just using Redhat 7.x as an example scp this onto my Redhat Linux Server, I have installed and configured mingw, therefore, I am able to run scp on my windows box, one of the alternatives would be to use winscp scp mongodb-bi-linux-x86_64-rhel70-v2.13.1.tgz <user>@<target ip>:/tmp Log onto the server U

Redis Cluster basic setup

Image
Disclaimer: Make sure to use Redis 5 to follow along this quick guide, if using the older distribution, please refer to  Official Documentation  for more information. This works on Redhat 7, to install Redis 5 #Set up repo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm # install redis yum install -y redis --enablerepo=remi This creates 3 shards and 3 replicas Client we are using here is the redis-cli command line tool ShardX, SalveX are redis-server processes #create conf files node1.conf ------------------ port 7001 cluster-enabled yes cluster-config-file cluster-node-1.conf cluster-node-timeout 5000 appendonly yes appendfilename node-1.aof dbfilename dump-1.rdb . . . node6.conf ------------------ port 7006 cluster-enabled yes cluster-config-file cluster-node-6.conf cluster-node-timeout 5000 appendonly yes appendfilename node-6.aof dbfilename dump-6.rdb #Start each redis-server node -------------------------

Redis Basics

Going over the basics // to check if there is connection with Redis 127.0.0.1:6379> ping PONG // echo a string 127.0.0.1:6379> echo 'hello' "hello" // insert a record 127.0.0.1:6379> SET foo 100 OK // get record based on the key 127.0.0.1:6379> GET foo "100" 127.0.0.1:6379> SET bar "Hello world" OK //  increment value by 1 127.0.0.1:6379> INCR foo (integer) 101 // can't increment text 127.0.0.1:6379> INCR bar (error) ERR value is not an integer or out of range // value of foo is increased by 1 127.0.0.1:6379> GET foo "101" // decrease by 1 127.0.0.1:6379> DECR foo (integer) 100 127.0.0.1:6379> GET foo "100" // check if the key exists, if exists, return 1, else return 0 127.0.0.1:6379> EXISTS foo (integer) 1 127.0.0.1:6379> EXISTS bar (integer) 1 127.0.0.1:6379> EXISTS foo1231 (integer) 0 // remove key 127.0.0.1:6379> DEL bar (integer)

Redis install and run

My platform is Red Hat Enterprise Linux Server release 7.3 (Maipo) download redhat-release rpm [root@msdlvd-dsnavl02 /]# rpm -Uvh https://download.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Install redis using yum [root@msdlvd-dsnavl02 /]# yum install redis -y Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos, subscription-manager This system is receiving updates from RHN Classic or Red Hat Satellite. epel/x86_64/metalink                                                                                                                                                                                    |  13 kB  00:00:00    epel                                                                                                                                                                                                    | 5.4 kB  00:00:00    (1/3): epel/x86_64/group_gz