Last updated

About Linked Server RPC and RPC OUT option

These settings are required when you install Nodinite in a distributed environment. For consistency and to avoid future support incidents we recommend that you follow this article for all types of installations.

Nodinite relies on the SQL Server concept of Linked Servers to connect with SQL Server databases. Nodinite ALSO uses the linked server to join data between the Configuration Database and the Log Databases even for local installations.

graph LR subgraph "Nodinite" roNS[fal:fa-code-commit Nodinite Core Services] end subgraph "SQL Server Instance" roConfigDatabase(fal:fa-database Configuration database) --- |Linked Server| roLogDatabase(fal:fa-database fal:fa-database fal:fa-database Log databases) roNS --> roConfigDatabase end subgraph "BizTalk SQL Servers" roConfigDatabase -.-> |Linked Server| roBT(fal:fa-database BizTalk Databases) end subgraph "Other SQL Server Instance" roConfigDatabase -.-> |Linked Server| roLogDatabases(fal:fa-database fal:fa-database fal:fa-database Log databases) end

Microsoft has documented the concept of Linked Servers here

To add a linked server with the RPC and RPC Out settings to true (mandatory for distributed Nodinite installations), simply execute the following command:

EXEC sp_addlinkedserver @server = 'LOCALHOST\instance';
EXEC sp_serveroption 'LOCALHOST\instance', 'rpc', true;
EXEC sp_serveroption 'LOCALHOST\instance', 'rpc out', true;

Replace 'LOCALHOST\instance' according to your environment

RPC

RPC is disabled by default in SQL Server. This configuration enhances the security of your server by reducing its attackable surface area.

The RPC setting is documented here.

RPC
RPC option set as recommended to True

Nodinite uses remote servers and the RPC setting enables a certain security feature. If this option is turned off when the second server (the one receiving the login attempt from the first server to which the client connected) tries to validate the remote login, it fails with the following error (example):


18482 "Could not connect to server '%.*ls' because '%.*ls' is not defined as a remote server. Verify that you have specified the correct server name. %.*ls."

You can also set this option to either True or False in the linked server's properties by right-clicking on the Linked Server Name in SQL Server Management Studio (SSMS) or you can use the following example script to enable RPC


EXEC master.dbo.sp_serveroption @server=N'LOCALHOST\instance', @optname=N'rpc', @optvalue=N'true' 

Replace 'LOCALHOST\instance' according to your environment

RPC OUT

The RPC OUT setting is very much needed when working with linked servers (which Nodinite does a lot...).

RPC Out
RPC Out option set as recommended to True

The RPC (Remote Procedure Call) is the stored procedure/ad hoc sql statement being run remotely from source SQL Server to the other SQL Server using the Linked Server.

Below are some syntax examples:

Syntax Example
servername.databasename.schemaname.procedurename EXEC [LOCALHOST\instance].master.dbo.sp_who2
EXECUTE(databasename.schemaname.procedurename ) AT %%LINKEDSERVERNAME%% EXEC ('master.dbo.sp_who2') AT [LOCALHOST\instance]

Replace 'LOCALHOST\instance' according to your environment

These kind of "RPC" calls will be blocked unless RPC Out option is set to True on the Linked Server.


Msg 7411, Level 16, State 1, Line 1  Server 'LOCALHOST\instance' is not configured for RPC.

You can also set this option to either True or False in the linked server's properties by right-clicking on the Linked Server Name in SQL Server Management Studio (SSMS) or you can use the following example script to enable RPC Out


EXEC master.dbo.sp_serveroption @server=N'LOCALHOST\instance', @optname=N'rpc out', @optvalue=N'false'

Replace 'LOCALHOST\instance' according to your environment