ai-center
2020.10
false
AI Center
Automation CloudAutomation SuiteStandalone
Last updated 6 de jun. de 2024

2. Configurar la base de datos

Este paso implica crear las bases de datos necesarias que utilizará el instalador de AI Fabric. Hay dos opciones disponibles: crear varias bases de datos o crear una base de datos con varios esquemas.

Importante:
  • Este paso crea una base de datos y un nombre de inicio de sesión/usuario. Para completar este paso, necesitas credenciales que permitan estas acciones. En SQL Server se trata del rol de dbcreator y el rol de ddladmin, respectivamente.
  • No pueden usarse las mismas bases de datos de AI Fabric (las bases de datos creadas por este paso) en varias instancias de AI Fabric.

Configurar

  1. Abre Powershell en el rol de administrador.
  2. Descarga el script aquí; por ejemplo, utilizando Powershell:
    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/master/database/createDatabases.ps1 -outfile "createDatabases.ps1"wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/master/database/createDatabases.ps1 -outfile "createDatabases.ps1"
  3. Puedes familiarizarte con las opciones del script introduciendo lo siguiente:
    get-help .\)\)createDatabases.ps1 -fullget-help .\)\)createDatabases.ps1 -full
  4. Los parámetros predeterminados funcionarán para la mayoría de escenarios:
    <h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y"</h1><h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y"</h1>
    El parámetro sqlinstance es solo el nombre de SQL Server. Esto es exactamente lo que debes introducir en el campo Nombre del servidor si utilizas SQL Server Management Studio. Por ejemplo:

    Utilizamos varias bases de datos de forma predeterminada. Si quieres utilizar una única base de datos con varios esquemas, puedes añadir el indicador singleDatabase como Y de la siguiente manera:
    <h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y" -singleDatabase "Y"</h1><h1>If SQL Server can be accessed through Windows Authentication then:
    ./createDatabases.ps1 -sqlinstance "DESKTOP-LOUPTI1\)\)SQLEXPRESS" -windowsAuthentication "Y" -singleDatabase "Y"</h1>

El script generará como output el inicio de sesión y contraseñas para gestionar la(s) base(s) de datos creada(s).

Guarda los datos de inicio de sesión y contraseña, pues lo necesitarás al rellenar la pantalla de configuración en el paso 5. Ejecutar el instalador de la aplicación de AI Fabric. También en el mismo paso tendrás que decir si utilizaste varias bases de datos o una sola; asegúrate de seleccionar la opción correcta o las comprobaciones previas fallarán.

Importante:
  • Asegúrate de que el modo de autenticación de SQL Server está habilitado.
  • Asegúrate de que la máquina Linux proporcionada en el paso 1 se ha añadido a la lista de IP aprobadas de SQL Server.
  • Asegúrate de que las reglas del firewall permiten conexiones entrantes al puerto 1433 (el puerto predeterminado para SQL Server).

Configuración manual

Varias bases de datos

Las bases de datos y los roles también pueden crearse utilizando el siguiente script a mano. Modifica el campo de la contraseña para el nuevo inicio de sesión aifadmin, pero no añadas comillas simples o dobles para la contraseña:
--Create Databases:
create database ai_deployer;
create database ai_trainer;
create database ai_helper;
create database ai_pkgmanager;
create database ai_appmanager;
USE [master]
GO
CREATE LOGIN [aifadmin] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- create the user on the target database i.e ai_deployer for the login
USE [ai_deployer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_deployer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_helper for the login
USE [ai_helper]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_helper]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_trainer for the login
USE [ai_trainer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_trainer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_pkgmanager for the login
USE [ai_pkgmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_pkgmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_appmanager for the login
USE [ai_appmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_appmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO--Create Databases:
create database ai_deployer;
create database ai_trainer;
create database ai_helper;
create database ai_pkgmanager;
create database ai_appmanager;
USE [master]
GO
CREATE LOGIN [aifadmin] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- create the user on the target database i.e ai_deployer for the login
USE [ai_deployer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_deployer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_helper for the login
USE [ai_helper]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_helper]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_trainer for the login
USE [ai_trainer]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_trainer]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_pkgmanager for the login
USE [ai_pkgmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_pkgmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO
-- create the user on the target database i.e ai_appmanager for the login
USE [ai_appmanager]
GO
CREATE USER [aifadmin] FOR LOGIN [aifadmin]
GO
-- add the user to the desired role
USE [ai_appmanager]
GO
ALTER ROLE [db_owner] ADD MEMBER [aifadmin]
GO

Una única base de datos

La base de datos y los roles también pueden crearse utilizando el siguiente script a mano. Modifica el campo de la contraseña, pero mantén la misma para todos los usuarios y no añadas comillas simples o dobles. También puedes cambiar el nombre de usuario, pero debes mantener el mismo esquema con _schemaName al final, de la siguiente manera:

//Create Database
create database aifabric
//Create 5 logins
USE [master]
GO
CREATE LOGIN [aifadmin_helper] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE LOGIN [aifadmin_pkgmanager] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_deployer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_trainer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_appmanager] WITH PASSWORD=N'Admin@123!'
GO
//Map login to user and associate default schema with the user and grant db_ddladmin role to the user 
USE [aifabric]
GO
CREATE USER [aifadmin_helper]  FOR LOGIN  [aifadmin_helper] WITH DEFAULT_SCHEMA = ai_helper
GO
CREATE SCHEMA ai_helper AUTHORIZATION [aifadmin_helper]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_helper';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_pkgmanager] FOR LOGIN  [aifadmin_pkgmanager] WITH DEFAULT_SCHEMA = ai_pkgmanager
GO
CREATE SCHEMA ai_pkgmanager AUTHORIZATION [aifadmin_pkgmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_pkgmanager';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_deployer]   FOR LOGIN  [aifadmin_deployer] WITH DEFAULT_SCHEMA = ai_deployer
GO
CREATE SCHEMA ai_deployer AUTHORIZATION [aifadmin_deployer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_deployer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_trainer]    FOR LOGIN  [aifadmin_trainer] WITH DEFAULT_SCHEMA = ai_trainer
GO
CREATE SCHEMA ai_trainer AUTHORIZATION [aifadmin_trainer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_trainer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_appmanager] FOR LOGIN  [aifadmin_appmanager] WITH DEFAULT_SCHEMA = ai_appmanager
GO
CREATE SCHEMA ai_appmanager AUTHORIZATION [aifadmin_appmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_appmanager';
GO//Create Database
create database aifabric
//Create 5 logins
USE [master]
GO
CREATE LOGIN [aifadmin_helper] WITH PASSWORD=N'Admin@123!'  -- (Change the Password as per your requirement )
CREATE LOGIN [aifadmin_pkgmanager] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_deployer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_trainer] WITH PASSWORD=N'Admin@123!'
CREATE LOGIN [aifadmin_appmanager] WITH PASSWORD=N'Admin@123!'
GO
//Map login to user and associate default schema with the user and grant db_ddladmin role to the user 
USE [aifabric]
GO
CREATE USER [aifadmin_helper]  FOR LOGIN  [aifadmin_helper] WITH DEFAULT_SCHEMA = ai_helper
GO
CREATE SCHEMA ai_helper AUTHORIZATION [aifadmin_helper]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_helper';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_pkgmanager] FOR LOGIN  [aifadmin_pkgmanager] WITH DEFAULT_SCHEMA = ai_pkgmanager
GO
CREATE SCHEMA ai_pkgmanager AUTHORIZATION [aifadmin_pkgmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_pkgmanager';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_deployer]   FOR LOGIN  [aifadmin_deployer] WITH DEFAULT_SCHEMA = ai_deployer
GO
CREATE SCHEMA ai_deployer AUTHORIZATION [aifadmin_deployer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_deployer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_trainer]    FOR LOGIN  [aifadmin_trainer] WITH DEFAULT_SCHEMA = ai_trainer
GO
CREATE SCHEMA ai_trainer AUTHORIZATION [aifadmin_trainer]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_trainer';
GO
USE [aifabric]
GO
CREATE USER [aifadmin_appmanager] FOR LOGIN  [aifadmin_appmanager] WITH DEFAULT_SCHEMA = ai_appmanager
GO
CREATE SCHEMA ai_appmanager AUTHORIZATION [aifadmin_appmanager]
GO
EXEC sp_addrolemember 'db_ddladmin', 'aifadmin_appmanager';
GO
  • Configurar
  • Configuración manual
  • Varias bases de datos
  • Una única base de datos

¿Te ha resultado útil esta página?

Obtén la ayuda que necesitas
RPA para el aprendizaje - Cursos de automatización
Foro de la comunidad UiPath
Uipath Logo White
Confianza y seguridad
© 2005-2024 UiPath. Todos los derechos reservados.