--- title: Configure a SQL Server Availability Group for read-scale on Linux | Microsoft Docs description: author: MikeRayMSFT ms.author: mikeray manager: jhubbard ms.date: 10/20/2017 ms.topic: article ms.prod: "sql-non-specified" ms.prod_service: "database-engine" ms.service: "" ms.component: sql-linux ms.suite: "sql" ms.custom: "" ms.technology: database-engine ms.assetid: ms.workload: "Inactive" --- # Configure a SQL Server Availability Group for read-scale on Linux [!INCLUDE[tsql-appliesto-sslinux-only](../includes/tsql-appliesto-sslinux-only.md)] You can configure a SQL Server Always On Availability Group for read-scale workloads on Linux. There are two types of architectures for Availability Groups. A architecture for high availability uses a cluster manager to provide improved business continuity. This architecture also can include read-scale replicas. To create the high-availability architecture, see [Configure SQL Server Always On Availability Group for high availability on Linux](sql-server-linux-availability-group-configure-ha.md). The other architecture supports only read-scale workloads. This article explains how to create an Availability Group without a cluster manager for read-scale workloads. This architecture provides read-scale only. It doesn't provide high availability. [!INCLUDE [Create prerequisites](../includes/ss-linux-cluster-availability-group-create-prereq.md)] ## Create the Availability Group Create the Availability Group. Set `CLUSTER_TYPE = NONE`. In addition, set each replica with `FAILOVER_MODE = NONE`. Client applications running analytics or reporting workloads can directly connect to the secondary databases. You also can create a read-only routing list. Connections to the primary replica forward read connection requests to each of the secondary replicas from the routing list in a round-robin fashion. The following Transact-SQL script creates an Availability Group named `ag1`. The script configures the Availability Group replicas with `SEEDING_MODE = AUTOMATIC`. This setting causes SQL Server to automatically create the database on each secondary server after it is added to the Availability Group. Update the following script for your environment. Replace the `****` and `****` values with the names of the SQL Server instances that host the replicas. Replace the `**<5022>**` value with the port you set for the endpoint. Run the following Transact-SQL script on the primary SQL Server replica: ```SQL CREATE AVAILABILITY GROUP [ag1] WITH (CLUSTER_TYPE = NONE) FOR REPLICA ON N'****' WITH ( ENDPOINT_URL = N'tcp://**:**<5022>**', AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT, FAILOVER_MODE = MANUAL, SEEDING_MODE = AUTOMATIC,    SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL) ), N'****' WITH ( ENDPOINT_URL = N'tcp://****:**<5022>**', AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT, FAILOVER_MODE = MANUAL, SEEDING_MODE = AUTOMATIC, SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL) ); ALTER AVAILABILITY GROUP [ag1] GRANT CREATE ANY DATABASE; ``` ### Join secondary SQL Servers to the Availability Group The following Transact-SQL script joins a server to an Availability Group named `ag1`. Update the script for your environment. On each secondary SQL Server replica, run the following Transact-SQL script to join the Availability Group: ```SQL ALTER AVAILABILITY GROUP [ag1] JOIN WITH (CLUSTER_TYPE = NONE); ALTER AVAILABILITY GROUP [ag1] GRANT CREATE ANY DATABASE; ``` [!INCLUDE [Create post](../includes/ss-linux-cluster-availability-group-create-post.md)] This Availability Group isn't a high-availability configuration. If you need high availability, follow the instructions at [Configure an Always On Availability Group for SQL Server on Linux](sql-server-linux-availability-group-configure-ha.md). Specifically, create the Availability Group with `CLUSTER_TYPE=WSFC` (in Windows) or `CLUSTER_TYPE=EXTERNAL` (in Linux). Then integrate with a cluster manager by using either Windows Server failover clustering on Windows or Pacemaker on Linux. ## Connect to read-only secondary replicas There are two ways to connect to read-only secondary replicas. Applications can connect directly to the SQL Server instance that hosts the secondary replica and query the databases. They also can use read-only routing, which requires a listener. * [Readable secondary replicas](../database-engine/availability-groups/windows/active-secondaries-readable-secondary-replicas-always-on-availability-groups.md) * [Read-only routing](../database-engine/availability-groups/windows/listeners-client-connectivity-application-failover.md#ConnectToSecondary) ## Fail over the primary replica on a read-scale Availability Group [!INCLUDE[Force failover](../includes/ss-force-failover-read-scale-out.md)] ## Next steps * [Configure a distributed Availability Group](..\database-engine\availability-groups\windows\distributed-availability-groups-always-on-availability-groups.md) * [Learn more about availability groups](..\database-engine\availability-groups\windows\overview-of-always-on-availability-groups-sql-server.md) * [Perform a forced manual failover](../database-engine/availability-groups/windows/perform-a-forced-manual-failover-of-an-availability-group-sql-server.md)