Install second OCR server
The guide describes the process of installation of another Linux or Windows OCR instance on existing SPA.
Note that this is not OCR scaling procedure.
Prepare
important
Run all commands as installation-user.
To prepare for remore installation of an additional OCR server:
Connect to the INT server via SSH.
To prepare the environment, run the following commands:
$ cd /opt/workfusion/wf_installer $ export ANSIBLE_REMOTE_USER="ec2-user" $ export ANSIBLE_PRIVATE_KEY_FILE="id_rsa"Here,
/opt/workfusion/wf_installer: the path to the Workfusion Installer that contains the main installation script install.sh.export ANSIBLE_REMOTE_USER="ec2-user": the ec2-user user is used for the remote access to the OCR Linux machine. Depending on the selected OCR platform:- OCR Linux: the user must be specified in file sudoers without password
- OCR Windows: the user must have permissions to connect remotely, and be in the Administrators group.
export ANSIBLE_PRIVATE_KEY_FILE="id_rsa": the id_rsa private key is applied for ec2-user. The public key must be located in the .ssh/authorized_keys file in the home directory of the user on the remote OCR machine.
Verify the user:
$ ls -la id_rsaWhen installing an additional instance of OCR Windows, make sure that the winOCR installer is located in /opt/workfusion/wf_installer/sources/.
$ curl "link_to_ocrWin_package" -o /opt/workfusion/wf_installer/sources/OCRInstaller-10.0.0.0-X.zip
Install
tip
vi/vim commands:
- To open a file in the edit mode, in the vi/vim editor, press 'i'.
- To exit the edit mode in vi/vim, click Escape, and then type without quotes ':wq' + Enter.
- To exit without changes, click Escape, then type ':q!' + Enter
To install the second OCR server:
In the hosts.yml file, change the
ocr_hostname/ocrwin_hostnameparameter with OCR Linux or Windows hostname, according to the selected OCR platform.$ vi hosts.ymlIn the config.yml file, change the MS SQL credentials and RabbitMQ password for the new OCR environment.
$ vi config.ymlThe following parameters are to be changed:
rabbitmq_ocr_pass: ********ocr_platform: 'windows' (according to the type of the additional OCR platform)mssql_ocr_user: ocr2mssql_ocr_pass: ********
If config.yml is encrypted, run the following command.
$ ./install.sh edit_config intWhen the prompt appears, enter the password for Secrets Vault. Note that the entered password is not displayed.
Use the same commands to update windows_installation_user and windows_installation_pass.
Modify the MS SQL OCR schema name.
$ vi group_vars/all/vars.ymlThe following parameters are to be changed:
rabbitmq_ocr_user: 'ocr2'mssql_ocr_schema_name: ocr2
Change the OCR Linux templates.
$ vi roles/ocr2/templates/properties/ocr-worker.yml.j2 $ vi roles/ocr2/templates/properties/ocr-rest.yml.j2The following parameters are be changed:
spring.rabbitmq.username: ${sms.ocr.spring.rabbitmq.username2}spring.rabbitmq.password: ${sms.ocr.spring.rabbitmq.password2}spring.rabbitmq.virtualHost: ocr2spring.datasource.username: ${sms.ocr.spring.datasource.username2}spring.datasource.password: ${sms.ocr.spring.datasource.password2}
Change the RabbitMQ OCR username and the vhost name:
$ vi roles/rabbitmq/defaults/main.ymlThe following parameters are to be changed:
rabbitmq_ocr_user: ocr2rabbitmq_ocr_pass: NewPWDveryStrongocr:vhost: ocr2
Note: skip this step, if the user in DB was not created in advance.
Temporary disable all other MS SQL user credentials (except for mssql_ocr_user) with the "#" symbol to prevent users and tables recreation.
$ vi roles/mssql-win/tasks/create-users.ymlFor example:
with_items: # - {user: '{{ mssql_ct_user }}', pass: '{{ mssql_ct_pass }}', schema: '{{ mssql_ct_schema_name }}' } # - {user: '{{ mssql_ws_user }}', pass: '{{ mssql_ws_pass }}', schema: '{{ mssql_ws_schema_name }}' } # - {user: '{{ mssql_sqc_user }}', pass: '{{ mssql_sqc_pass }}', schema: '{{ mssql_sqc_schema_name }}' } # - {user: '{{ mssql_rpa_user }}', pass: '{{ mssql_rpa_pass }}', schema: '{{ mssql_rpa_schema_name }}' } # - {user: '{{ mssql_pm_user }}', pass: '{{ mssql_pm_pass }}', schema: '{{ mssql_pm_schema_name }}' } # - {user: '{{ mssql_dm_user }}', pass: '{{ mssql_dm_pass }}', schema: '{{ mssql_dm_schema_name }}' } - {user: '{{ mssql_ocr_user }}', pass: '{{ mssql_ocr_pass }}', schema: '{{ mssql_ocr_schema_name }}' } # - {user: '{{ mssql_ds_user }}', pass: '{{ mssql_ds_pass }}', schema: '{{ mssql_ds_schema_name }}' } # - {user: '{{ mssql_rapi_user }}', pass: '{{ mssql_rapi_pass }}', schema: '{{ mssql_rapi_v1_schema_name }}'}Add new credentials to Secrets Vault.
For WinOCR
$ vi roles/ocr-config-win/templates/properties/ocr-rest-secure.properties.j2 $ vi roles/ocr-config-win/templates/properties/ocr-worker-secure.properties.j2For OCR Linux
$ vi roles/ocr2/templates/properties/ocr-rest-secure.properties.j2 $ vi roles/ocr2/templates/properties/ocr-worker-secure.properties.j2The following parameters are to be changed:
ocr.spring.datasource.username2={{ mssql_ocr_user }}ocr.spring.datasource.password2={{ mssql_ocr_pass }}ocr.spring.rabbitmq.username2={{ rabbitmq_ocr_user }}ocr.spring.rabbitmq.password2={{ rabbitmq_ocr_pass }}
Change the following parameters (for Windows OCR only):
vi roles/ocr-win/templates/ocr_conf.ini.j2The following parameters are to be changed:
spring.datasource.username=${sms.ocr.spring.datasource.username2}spring.datasource.password=${sms.ocr.spring.datasource.password2}spring.rabbitmq.password=${sms.ocr.spring.rabbitmq.password2}spring.rabbitmq.username=${sms.ocr.spring.rabbitmq.username2}spring.rabbitmq.virtualHost=ocr2
Run the following commands.
Note: the second command in the section must be run, only if step 6 has been done.
$ ./install.sh configure rabbitmq -e @config_overrides.yml $ ./install.sh install mssql -e @config_overrides.ymlPerform the following operation, according to the chosen OCR platfrom:
For additional Windows OCR:
Run the following commands:
$ ./install.sh preinstall ocrwin -e @config_overrides.yml $ ./install.sh configure ocrwin -e @config_overrides.yml $ ./install.sh install ocrwin -e @config_overrides.ymlIf the installation is successful, WinOCR starts automatically. Still, you need to add parameters to the ocr-rest.yml and ocr-worker.yml files.
For that:
Log in to WinOCR VM, and edit the following files: C:\workfusion\OCR\etc\ocr-rest.yml and C:\workfusion\OCR\etc\ocr-worker.yml.
The following lines should be added:spring.datasource.username: ${sms.ocr.spring.datasource.username2}spring.datasource.password: ${sms.ocr.spring.datasource.password2}spring.jpa.properties.hibernate.default_schema: ocr2
Server restart is required.
On Windows Server, in cmd, run the following commands to prepare a license for correct license generation:
cd /d "path to ocr folder" curl -X POST http://127.0.0.1:9002/api/v1/cloud/prepareLicense > license_request.txt
For additional Linux OCR:
Verify that SSH connection to Linux server is successful.
$ ./install.sh preinstall ocr -e @config_overrides.yml $ ./install.sh install ocr -e @config_overrides.yml $ ./install.sh check ocr -e @config_overrides.ymlCheck that everything (except for the license) is fine, wait for one minute after the service restart, and then in your browser, open the https://your.newocr.hostname/api/v1/health-check.