Pages

Tuesday, June 12, 2018

Setup Redis 3.2 server in cluster mode in Windows 7 64 bit

Setup Redis 3.2 Cluster based server in windows

Steps:

  1. Download Redis 3.2 Server windows from link: the MSOpenTech version
  2. extract of install above downloaded one.
  3. Create a folder redis3.2
  4. go to folder redis3.2 
  5. create cluster node folders
    eg: node1,node2, node3
  6. copy the redis-server.exe and redis-cli.exe into redis3.2 folder from Downloaded Redis zip/installation
  7. go to each node folder and create redis.conf file and add below content
    1
    2
    3
    4
    5
    port 6380
    cluster-enabled yes
    cluster-config-file nodes.conf
    cluster-node-timeout 5000
    appendonly yes
    add the unique port number in each node for node1 6380 for node1 6381 for node1 6382
  8. Now Run each node by going to each node folder with below command:
    c:\node1>..\redis-server.exe redis.conf
    c:\node2>..\redis-server.exe redis.conf
    c:\node3>..\redis-server.exe redis.conf
    After node started you will see below message
    Redis 3.2.100 (00000000/0) 64 bit
    
    Running in cluster mode
    Port: 6380
    PID: 7096
    
    
  9. Now connect any node with redis-cli.exe
    redis-cli.exe -h <ip or host> -p 6380
  10. Run below command to make them join cluster:
    CLUSTER MEET  6380
    CLUSTER MEET  6381
    CLUSTER MEET  6382
    
  11. after run CLUSTER NODES you will see all nodes
    sample output:
    72b640cb92b054d51c89d0c28a016573e7ff3631 127.0.0.1:6380 myself,master
    above first column is nodeid which is auto generated
  12. Now all nodes are MASTER nodes
  13. now change node1 as master and rest as slaves
  14. connect to each  node except master node via redis-cli and run below command
    CLUSTER REPLICATE <master-node-id>
    master-node-id is node id of node which you want as master.
  15. Now you will see one master node and rest nodes are slaves
  16. Now allocate the slots to the master node with below command
    FOR /L %i IN (0,1,16383) DO ( redis-cli.exe -p **6380** CLUSTER ADDSLOTS %i )
    
    6380 is port of master node
Now Redis 3.2 cluster server is ready!


You can also Download the following pre setup Redis 3.2 cluster based server:
click here


Help:
  • To connect Redis node with host/port via redis-cli interface use below command:
    redis-cli -h hostname -p portnumber

Monday, June 4, 2018

Download Oracle 64 bit JDK 1.8 pre installed zip


Click below to download the Oracle JDK 1.8 pre installed zip 64 bit (No installation required)


Click here Oracle JDK 1.8

after download, unzip the pack to a folder

set JAVA_HOME and PATH environment variables

Download Oracle 64 bit JDK 1.7 pre installed zip


Click below to download the Oracle JDK 1.7 pre installed zip 64 bit (No installation required)

Click here Oracle JDK 1.7

after download, unzip the pack to a folder

set JAVA_HOME and PATH environment variables

Monday, May 28, 2018

Create Java Pre installed zip from Jdk executable


Creating a pre installed JDK in Zip package, Follow these steps:
  1. Download Latest Jdk executable from Oracle.com
  2. extract all the files from jdk-8u172-windows-x64.exe into the directory( any destination dir)
    Eg: C:\JDK
  3. Execute the following commands in cmd.exe:
    • cd C:\JDK\.rsrc\1033\JAVA_CAB10
    • extrac32 111
  4. Unpack C:\JDK\.rsrc\1033\JAVA_CAB10\tools.zip with 7-zip
  5. Execute the following commands in cmd.exe:
    • cd C:\JDK\.rsrc\1033\JAVA_CAB10\tools\
    • for /r %x in (*.pack) do .\bin\unpack200 -r "%x" "%~dx%~px%~nx.jar" (this will convert all .pack files into .jar files)
  6. Copy all contents of C:\JDK\.rsrc\1033\JAVA_CAB10\tools where you want your JDK to be