Informazioni sulla configurazione del server e del cluster

Dopo aver installato e configurato Oracle Key Vault, è necessario configurare sia il server che il cluster, come descritto in questo articolo.

Configurare il server

Sul server utilizzato per eseguire la configurazione, scaricare il pacchetto del servizio OKV RESTful come indicato di seguito.

Nota

È necessario eseguire questa operazione una volta per server che si sta configurando, in quanto il download include certificati per il server OKV.
  1. Nella directory root del server (ad esempio, [root@c3bastion tmp]#) creare e passare alla directory /tmp/okv:
    mkdir /tmp/okv
    cd /tmp/okv
    curl -Ok --tlsv1.2 https://10.122.56.16:5695/okvrestclipackage.zip

    Il sistema risponde:

    % Total    % Received    % Xferd   Average Speed    Time      Time      Time     Current
                                       Dload   Upload   Total     Spent     Left     Speed
       100          2740        100     2740        0   0 78 0  0:00:35     0:00:34  0:00:01 741
  2. Decomprimi okvrestclipackage.zip:
    unzip okvrestclipackage.zip
    Il sistema risponde:
    Archive: okvrestclipackage.zip
    creating: lib/
    creating: bin/
    inflating: bin/okv
    inflating: bin/okv.bat
    creating: conf/
    inflating: conf/okvrestcli.ini
    inflating: conf/okvrestcli_logging.properties
    inflating: lib/okvrestcli.jar
    
    Quindi passare a bin:
    cd bin
  3. Modificare bin/okv per rimuovere il segno cancelletto (#) e abilitare la seconda istruzione export:
    #!/bin/bash
    export OKV_RESTCLI_DIR=$(dirname "${0}")/..
    #export OKV_RESTCLI_CONFIG=$OKV_RESTCLI_DIR/conf/okvrestcli.ini
    if [ -z "$JAVA_HOME" ]
    then
    echo "JAVA_HOME environment variable is not set."
    exit 1
    fi
    if [ -z "$OKV_RESTCLI_CONFIG" ]
    then
    echo "OKV_RESTCLI_CONFIG environment variable is not set."
    exit 1
    fi
    export
    OKV_RESTCLI_JAR=$OKV_RESTCLI_DIR/lib/okvrestcli.jar
    $JAVA_HOME/bin/java
    jar $OKV_RESTCLI_JAR "$@"
    Le prime tre righe dovrebbero essere così:
    !/bin/bash
    export OKV_RESTCLI_DIR=$(dirname "${0}")/..
    export OKV_RESTCLI_CONFIG=$OKV_RESTCLI_DIR/conf/okvrestcli.ini
  4. Modificare conf/okvrestcli.ini e rimuovere il segno cancelletto all'inizio della quarta e della sesta riga, aggiungere l'indirizzo IP privato del primo server, aggiungere il nome utente ed eliminare la riga che inizia con password:
    #Provide absolute path for log_property, okv_client_config properties
    [Default]
    #log_property=./conf/okvrestcli_logging.properties
    #server=
    #okv_client_config=./conf/okvclient.ora
    #user=name of an OKV-administrator with the SYSADMIN privilege
    client_wallet = .
    Ora il file dovrebbe essere simile al seguente:
    #Provide absolute path for log_property, okv_client_config properties
    [Default]
    log_property=./conf/okvrestcli_logging.properties
    server=IP_address of OKV01
    okv_client_config=./conf/okvclient.ora
    user=name of an OKV-administrator with the SYSADMIN privilege
    client_wallet = .
  5. In seguito, impostare la variabile JAVA_HOME. Affinché il comando REST OKV funzioni, è necessario eseguire questa operazione.
    1. Identificare la versione di Java:
      java -version
      Il sistema risponde:
      openjdk version "1.8.0_372"
      OpenJDK Runtime Environment (build 1.8.0_372-b07)
      OpenJDK 64-Bit Server VM (build 25.372-b07, mixed mode)
    2. OpenJDK non è supportato; il programma Linux namei segue collegamenti simbolici e consente di confermare la posizione in cui è installato OpenJDK. Immettere:
      which java
      Il sistema risponde:
      /usr/bin/java
      Quindi immettere:
      namei /usr/bin/java | grep " l "
      Il sistema risponde:
      l java --> /etc/alternatives/java
      l java --> /usr/lib/jvm/java 1.8.0 openjdk 1.8.0.372.b07 1.el7_9.x86_64/jre/bin/java
    3. A questo punto, utilizzare i comandi script-friendly per scaricare Oracle Java; dalla radice del server (ad esempio, [root@c3bastion okv], immettere:
      wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
      Il sistema risponde (questo esempio è stato modificato per brevità):
      Saving to: ‘jdk-17_linux-x64_bin.rpm’
      100%[============================================================================================================>] 182,170,753 22.3MB/s in 4.9s
      2023-11-14 10:21:48 (35.5 MB/s) - ‘jdk-17_linux-x64_bin.rpm’ saved [182170753/182170753]
      Ora, utilizzare il comando yum localinstall per installare il JDK:
      yum localinstall ./jdk-17_linux-x64_bin.rpm
      Il sistema risponde:
      Loaded plugins: ulninfo
      Examining ./jdk-17_linux-x64_bin.rpm: 2000:jdk-17-17.0.9-11.x86_64
      Marking ./jdk-17_linux-x64_bin.rpm to be installed
      .
      .
      .
      Installed:
        jdk-17.x86_64 2000:17.0.9-11
      Complete!
    4. Verificare che le "alternative" siano state aggiornate dal processo di installazione di java:
      namei /usr/bin/java | grep " l "
      Il sistema risponde:
      l java --> /etc/alternatives/java
        l java --> /usr/lib/jvm/jdk 17 oracle x64/bin/java
    5. Si noti che l'output precedente identifica JAVA_HOME. Ora, esportare la variabile JAVA_HOME nel sistema:
      export JAVA_HOME=/usr/lib/jvm/jdk-17-oracle-x64
    6. Infine, per semplificare il processo di distribuzione, memorizzare la password dell'amministratore OKV con il privilegio SYSADMIN in un wallet:
      okv admin client-wallet add --client-wallet . --wallet-user name of an OKV-administrator with the SYSADMIN privilege
      Il sistema richiede una password:
      Password:
      Immettere la password di un amministratore OKV con il privilegio SYSADMIN e il sistema confermerà la corretta memorizzazione:
      {
         "result" : "Success"
      }

Configura cluster

Una volta installato e configurato il software OKV iniziale sul server, è possibile configurare il cluster.

Procedere come segue dalla riga di comando root del server (ad esempio, [root@c3bastion okv]).
  1. Convertire OKV stand alone in un nodo candidato; immettere:
    bin/okv cluster node create --cluster-name OCEAN11 --cluster-subgroup WEST_COAST --node-name OKV04
    Il sistema risponde:
    {
    "result" : "Success",
    "value" : {
      "requestId" : "26032"
    }
    }
  2. Controllare ora lo stato del nodo cluster:
    bin/okv cluster node status --pairing-request-id 26032
    Il sistema risponde:
    {
      "result" : "Success",
      "value" : {
        "status" : "IN-PROGRESS"
      }
    }
    Dopo alcuni istanti, "IN-PROGRESS" viene modificato IN "SUCCEEDED":
    {
      "result" : "Success",
      "value" : {    
        "status" : "SUCCEEDED"
    }
    }

    Una volta completato questo passo, il nodo deve essere visualizzato nella scheda Gestione cluster e monitoraggio.

  3. Ora aggiungere un secondo server OKV standalone per creare prima una coppia di lettura-scrittura. Questo comando richiede un nodeID univoco prima di aggiungere un nodo e conferma quale nodeID è già stato utilizzato:
    okv cluster info get | jq -r '.value.nodes[].nodeID'
    okv cluster node add --candidate-node-ip-address 172.20.0.33 --candidate-node-user sadmin --cluster-subgroup WEST_COAST --mode READ-WRITE --node-id 2 --node-name OKV06
    Il sistema risponde:
    Recovery Passphrase:

    Immettere la password del primo nodo OKV.

    
    Candidate Node Password: 
    Immettere la password di un amministratore OKV che dispone del privilegio SYSADMIN. Il sistema risponde:
    {
      "result" : "Success",  
      "value" : {
        "requestId" : "3060"
      }
    }
  4. Ora controlla il processo di configurazione del primo nodo:
    bin/okv cluster node status --pairing-steps TRUE --node-name OKV04
    Il sistema risponde:
    {
      "result" : "Success",
      "value" : {
        "stages" : [ {
          "step1" : "Open transport channel with the candidate node",
          "status" : "COMPLETED"
        }, {
          "step2" : "Verify the candidate node details",
          "status" : "COMPLETED"
        }, {
          "step4" : "Generate the controller node details",
          "status" : "COMPLETED"
        }, {
          "step5" : "Generate backup of the controller node for cloning",
          "status" : "COMPLETED"
        }, {
          "step6" : "Send clone bundle to the candidate node",
          "status" : ""  
        }, { 
          "step7" : "Enable data replication (downstream mining configuration) to the candidate node",
          "status" : ""
        }, {
          "step8" : "Enable data replication to other cluster nodes",
          "status" : ""
        }, {
          "step9" : "The candidate node successfully joins the cluster",
          "status" : ""
        } ]
      }
    }
  5. Ora controlla l'avanzamento del secondo nodo:
    bin/okv cluster node status --pairing-steps TRUE --candidate-node-ip-address 172.20.0.21 --candidate-node-user sadmin
    Il sistema risponde:
    Candidate Node Password
    Immettere la password e viene visualizzata la configurazione cluster:
    {
      "result" : "Success",
      "value" : {
        "stages" : [ {
          "step1" : "Send node details to the controller node",
          "status" : "COMPLETED"
        }, {
          "step2" : "Receive clone bundle from the controller node",
          "status" : "COMPLETED"   
        }, {
          "step3" : "Restore backup on the candidate node",
          "status" : "COMPLETED"
        }, {
          "step4" : "Update credentials of the candidate node",
          "status" : "COMPLETED"
        }, { 
          "step5" : "Tune the database on the candidate node",
          "status" : "COMPLETED"
        }, {
          "step6" : "Setup network configuration on the candidate node",
          "status" : "COMPLETED"
        }, {
          "step7" : "Enable data replication (downstream mining configuration) on the candidate node",
          "status" : "COMPLETED"
        }, {
         "step8" : "Enable data replication on the candidate node",
         "status" : "COMPLETED"
        } ]
      }
    }
  6. Verificare lo stato dell'associazione. Se la configurazione riesce, verrà visualizzato come Nessuno stato di associazione:
    bin/okv cluster node status --pairing-steps TRUE --node-name OKV10
    Il sistema risponde:
    {
      "result" : "Failure",
      "message" : "No pairing status"
    }
  7. Infine, verificare che la prima coppia di lettura-scrittura OKV a due nodi sia pronta per l'uso:
    bin/okv cluster info get
    Il sistema risponde:
    {
      "result" : "Success",
      "value" : {
        "clusterName" : "OCEAN11",
        "clusterSubgroups" : [ "WEST_COAST" ],
        "clusterVersion" : "21.7.0.0.0",
        "maximumDisableNodeDuration" : "24 hrs",
        "nodes" : [ {
      "nodeName" : "OKV04",
          "nodeID" : "1",
          "ipAddress" : "172.20.0.33",
          "mode" : "Read-Write",
          "status" : "ACTIVE",
          "readWritePeer" : "OKV05",    
          "clusterSubgroup" : "WEST_COAST",
          "joinDate" : "2023-11-16 20:53:25",
          "disableDate" : "",
          "version" : "21.7.0.0.0"
        }, { 
      "nodeName" : "OKV05",
          "nodeID" : "2",
          "ipAddress" : "172.20.0.21",
          "mode" : "Read-Write",
          "status" : "ACTIVE",
          "readWritePeer" : "OKV04",
          "clusterSubgroup" : "WEST_COAST",
          "joinDate" : "2023-11-16 21:02:24",
          "disableDate" : "",
          "version" : "21.7.0.0.0"
        } ]
      }
    }
Ora Oracle Key Vault deve essere installato completamente ed è possibile utilizzarlo come descritto nella documentazione di Oracle Key Vault.