Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1175021%22%20slang%3D%22en-US%22%3ECreate%20a%20hybrid%20Distributed%20Availability%20group%20Between%20SQL%20Windows%20and%20SQL%20Linux%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1175021%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3EThis%20article%20describes%20how%20to%20create%20a%20Hybrid%20SQL%20Server%20Distributed%20Availability%20Group%20between%20SQL%20Linux%20and%20SQL%20Windows%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3EHere%20is%20the%20topology%20of%20the%20DAG%20environment%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CTABLE%20style%3D%22background-color%3A%20transparent%3B%20border-collapse%3A%20collapse%3B%20border-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20height%3A%20147px%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20width%3A%20577px%3B%20word-spacing%3A%200px%3B%20margin%3A%2015px%200px%2015px%200px%3B%22%20border%3D%221%22%20width%3D%22496%22%20cellspacing%3D%220%22%20cellpadding%3D%222%22%3E%0A%3CTBODY%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%0A%3CTR%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%0A%3CTD%20width%3D%22286.03%22%20height%3D%2248%22%20valign%3D%22top%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20min-width%3A%2040px%3B%20width%3A%20302px%3B%20word-break%3A%20normal%3B%20padding%3A%2010px%3B%20border%3A%201px%20solid%20%23d1d1d1%3B%22%3E%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20margin-bottom%3A%200px%3B%20margin-left%3A%200px%3B%20margin-right%3A%200px%3B%20margin-top%3A%200px%3B%22%20align%3D%22center%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3EData%20Center%201%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22289.97%22%20height%3D%2248%22%20valign%3D%22top%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20min-width%3A%2040px%3B%20width%3A%20274px%3B%20word-break%3A%20normal%3B%20padding%3A%2010px%3B%20border%3A%201px%20solid%20%23d1d1d1%3B%22%3E%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20margin-bottom%3A%200px%3B%20margin-left%3A%200px%3B%20margin-right%3A%200px%3B%20margin-top%3A%200px%3B%22%20align%3D%22center%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3EData%20Center%202%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%0A%3CTD%20width%3D%22286.03%22%20height%3D%22252%22%20valign%3D%22top%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20min-width%3A%2040px%3B%20width%3A%20302px%3B%20word-break%3A%20normal%3B%20padding%3A%2010px%3B%20border%3A%201px%20solid%20%23d1d1d1%3B%22%3E%3CUL%20style%3D%22box-sizing%3A%20border-box%3B%20clear%3A%20left%3B%20list-style-image%3A%20none%3B%20list-style-position%3A%20outside%3B%20list-style-type%3A%20disc%3B%20margin-bottom%3A%2012px%3B%20margin-top%3A%200px%3B%20padding-left%3A%202.5em%3B%22%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ERed1%3A192.168.3.102%20(Primary)%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ERed2%3A192.168.3.103%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EAvailability%20group%20%3AAGLinux%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EListener%3AAGLinux-Lis%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EIP%3A192.168.3.111%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ESQL%20Server%3A%202019%20CU2%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ERHEL%208%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22289.97%22%20height%3D%22252%22%20valign%3D%22top%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20min-width%3A%2040px%3B%20width%3A%20274px%3B%20word-break%3A%20normal%3B%20padding%3A%2010px%3B%20border%3A%201px%20solid%20%23d1d1d1%3B%22%3E%3CUL%20style%3D%22box-sizing%3A%20border-box%3B%20clear%3A%20left%3B%20list-style-image%3A%20none%3B%20list-style-position%3A%20outside%3B%20list-style-type%3A%20disc%3B%20margin-bottom%3A%2012px%3B%20margin-top%3A%200px%3B%20padding-left%3A%202.5em%3B%22%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ENode1%3A192.168.2.101(Forwarder)%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ENode2%3A192.168.2.102%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EAvailability%20group%20%3AAGWindows%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EListener%3AAGWindows-Lis%3A%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EIP%3A192.168.2.111%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3ESQL%20Server%3A%202019%20CU2%3C%2FLI%3E%0A%3CLI%20style%3D%22box-sizing%3A%20border-box%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EWindows%202016%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3EDistributed%20Availability%20group%3ADAGHybrid%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3EPlease%20make%20use%20following%20ports%20are%20opened%20on%20all%20the%20servers%20in%20both%20datacenters.%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3ETCP%3A5022%2C2224%2C3123%2C21064%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3EUDP%3A5405%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20display%3A%20inline%3B%20float%3A%20none%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EFor%20RHEL%2C%20you%20need%20to%20have%20the%20'high%20availability%20subscription'%20enabled.%20Please%20refer%20%3C%2FSPAN%3E%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23146cac%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20underline%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Flinux%2Fsql-server-linux-availability-group-cluster-rhel%3Fview%3Dsql-server-ver15%23configure-high-availability-for-rhel%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Flinux%2Fsql-server-linux-availability-group-cluster-rhel%3Fview%3Dsql...%3C%2FA%3E%3CSPAN%20style%3D%22background-color%3A%20%23ffffff%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20display%3A%20inline%3B%20float%3A%20none%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%20for%20detail.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH6%20id%3D%22toc-hId--7723561%22%20id%3D%22toc-hId--7723561%22%3E%3CSTRONG%3E%3CFONT%20size%3D%226%22%3ESection%201%3ACreate%20Availability%20group%20in%20datacenter1%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FH6%3E%0A%3CP%3E1.%20Updates%20%2Fetc%2Fhosts%20on%20all%20the%20nodes%20Datacenter1%2C%20add%20IP%20%2C%20replica%20name%20and%20AG%20Listeners.%3C%2FP%3E%0A%3CP%3EHere%20is%20a%20screenshot.%20All%20servers%20in%20the%20datacenter1%20should%20have%20same%20setting.(Although%20the%20IP%20resources%20of%20Listeners%20will%20be%20created%20in%20later%20steps%2C%20it%E2%80%99s%20ok%20to%20add%20at%20the%20very%20beginning)%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLiwei_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hostx.png%22%20style%3D%22width%3A%20638px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171883i3F458CAFA77F6BB9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22hostx.png%22%20alt%3D%22hostx.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2.%20Run%20following%20bash%20commands%20on%20all%20servers%20in%20datacenter1%20to%20enable%20Alwayson%20Feature.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ebin%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Econf%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eset%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ehadr%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ehadrenabled%201%0Asudo%20systemctl%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Erestart%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eserver%20%20%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E3.Run%20following%20T-SQL%20to%20Enable%20Always%20On%20Health%20check%20event%20session%20on%20all%20the%20servers%20in%20datacenter1.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20EVENT%20SESSION%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EAlwaysOn_health%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EON%20SERVER%20WITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3ESTARTUP_STATE%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EON%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.Create%20a%20certificate%2C%20run%20the%20query%20on%20primary%20replica%20in%20datacenter1(red1%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Euse%20master%0Ago%0ACREATE%20MASTER%20KEY%20ENCRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CMASTER_KEY_PASSWORD%3E**'%3C%2FMASTER_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0ACREATE%20CERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20SUBJECT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'dbm'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0ABACKUP%20CERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ETO%20FILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'%2Fvar%2Fopt%2Fmssql%2Fdata%2Fdbm_certificate.cer'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20PRIVATE%20KEY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'%2Fvar%2Fopt%2Fmssql%2Fdata%2Fdbm_certificate.pvk'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENCRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CPRIVATE_KEY_PASSWORD%3E**'%0A%3C%2FPRIVATE_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E5.%20Copy%20the%20certificate%20to%20rest%20of%20the%20servers%20in%20datacenter1(red2%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ecd%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Edata%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Escp%20dbm_certificate%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E.*%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%3CA%3Eroot%40%3C%2FA%3E%3C%2FSPAN%3E%3CA%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E**%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EnodeName%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%26gt%3B**%3A%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Edata%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3CA%3E%2F%3C%2FA%3E%20%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CDIV%20id%3D%22tinyMceEditorLiwei_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E6.%20Give%20permission%20to%20the%20mssql%20user%20to%20access%20the%20certificate%20files%20in%20rest%20of%20the%20servers(red2%20in%20this%20case).Run%20following%20bash%20command%20in%20red2.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ecd%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Edata%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Echown%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Emssql%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%20dbm_certificate%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E.*%20%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E7.%20Create%20the%20certificate%20on%20rest%20of%20the%20servers%20by%20restoring%20the%20certificate%20backup(red2%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Euse%20master%0Ago%0ACREATE%20MASTER%20KEY%20ENCRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CMASTER_KEY_PASSWORD%3E**'%0A%3C%2FMASTER_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0ACREATE%20CERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFROM%20FILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'%2Fvar%2Fopt%2Fmssql%2Fdata%2Fdbm_certificate.cer'%20%20%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20PRIVATE%20KEY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'%2Fvar%2Fopt%2Fmssql%2Fdata%2Fdbm_certificate.pvk'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDECRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CPRIVATE_KEY_PASSWORD%3E**'%0A%3C%2FPRIVATE_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E8.Create%20endpoint%20on%20all%20servers%20in%20datacenter1.%20The%20port%205022%20is%20used.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20ENDPOINT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BHadr_endpoint%5D%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAS%20TCP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_PORT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E5022%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFOR%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20lime%3B%22%3EDATABASE_MIRRORING%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EROLE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20ALL%2C%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTHENTICATION%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENCRYPTION%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EREQUIRED%20ALGORITHM%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EAES%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20ENDPOINT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BHadr_endpoint%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESTATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESTARTED%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E9.Create%20AG%20with%202%20synchronous%20replicas%20in%20datacenter1.%20Run%20following%20query%20on%20primary%20replica%20(red1%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDB_FAILOVER%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EON%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECLUSTER_TYPE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EEXTERNAL%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFOR%20REPLICA%20ON%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'red1'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENDPOINT_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'tcp%3A%2F%2Fred1%3A5022'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESYNCHRONOUS_COMMIT%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EEXTERNAL%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%2C%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'red2'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENDPOINT_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'tcp%3A%2F%2Fred2%3A5022'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESYNCHRONOUS_COMMIT%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EEXTERNAL%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0AALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGRANT%20CREATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EANY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDATABASE%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20green%3B%22%3E--grant%20create%20any%20database%20permission%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E10.Join%20the%20AG%20group%2C%20run%20the%20following%20T-SQL%20queries%20on%20all%20the%20secondary%20servers%20in%20datacenter1(red4%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EJOIN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECLUSTER_TYPE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EEXTERNAL%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGRANT%20CREATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EANY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDATABASE%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E11.Create%20database%20and%20add%20to%20AG%20group%20on%20primary%20replica.(red1%20in%20this%20case).%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20DATABASE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bdb2%5D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20DATABASE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bdb2%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESET%20RECOVERY%20FULL%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EBACKUP%20DATABASE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bdb2%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ETO%20DISK%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'db2.bak'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EBACKUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Elog%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bdb2%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ETO%20DISK%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'db2.trn'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGO%0AALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EADD%20DATABASE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bdb2%5D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CDIV%20id%3D%22tinyMceEditorLiwei_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E12.Create%20SQL%20login%20pacemaker%20on%20all%20servers%20in%20datacenter1%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20LOGIN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BpacemakerLogin%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ewith%20PASSWORD%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'ComplexP%40%24%24w0rd!'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGO%0AALTER%20SERVER%20ROLE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5Bsysadmin%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EADD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EMEMBER%20%5BpacemakerLogin%5D%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGO%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E13.Install%20pacemaker.Run%20the%20following%20bash%20command%20on%20all%20servers%20in%20datacenter1.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20yum%20install%20pacemaker%20pcs%20fence%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eagents%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-all%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eresource%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eagents%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E14.Install%20SQL%20Server%20resource%20agent%20for%20SQL%20Server.%20Run%20the%20following%20bash%20command%20on%20all%20servers%20in%20datacenter1.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20yum%20install%20mssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eserver%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eha%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E15.Set%20the%20password%20for%20the%20default%20user%20that%20is%20created%20when%20installing%20Pacemaker%20and%20Corosync%20packages.%20Run%20following%20command%20on%20all%20servers%20in%20datacenter1(This%20command%20asks%20for%20password.%20The%20password%20should%20be%20same%20for%20the%20servers%20in%20same%20datacenter)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20passwd%20hacluster%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E16.To%20allow%20nodes%20to%20rejoin%20the%20cluster%20after%20the%20reboot%2C%20enable%20and%20start%20pcsd%20service%20and%20Pacemaker.%20Run%20the%20following%20commands%20on%20all%20servers%20in%20datacenter1.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20systemctl%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eenable%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epcsd%0Asudo%20systemctl%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Estart%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epcsd%0Asudo%20systemctl%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eenable%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epacemaker%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E17.Create%20a%20cluster%20in%20datacenter1.%20Run%20following%20commands%20on%20any%20one%20of%20the%20nodes%20in%20datacenter1(just%20on%20one%20server%2C%20and%20just%20one%20time).%20You%20will%20be%20asked%20to%20provide%20the%20username%20and%20password%20you%26nbsp%3B%20specified%20in%20step%2015.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20host%20auth%20red1%20red2%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%0Asudo%20pcs%20cluster%20setup%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20green%3B%22%3E%20cluster1%20red1%20red2%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20cluster%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Estart%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20green%3B%22%3E--all%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20cluster%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eenable%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20green%3B%22%3E--all%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22pcshost.png%22%20style%3D%22width%3A%20544px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171762iD580D8122524BB92%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22pcshost.png%22%20alt%3D%22pcshost.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E18.Because%20the%20node%20level%20fencing%20configuration%20depends%20heavily%20on%20your%20environment%2C%20disable%20it%20for%20this%20tutorial%20(it%20can%20be%20configured%20later.%20In%20my%20test%2C%20if%20this%20value%20is%20not%20set%20to%20false%2C%20you%20can%E2%80%99t%20failover%2C%20and%20IP%20resource%20may%20fail).%20The%20following%20script%20disables%20node%20level%20fencing(run%20it%20on%20any%20nodes%20in%20datacenter1)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20property%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eset%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Estonith%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eenabled%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Efalse%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E20.On%20all%20SQL%20Server%20Linux%20servers%20in%20datacenter1%20%2C%20save%20the%20credentials%20for%20the%20SQL%20Server%20login.(Use%20the%20same%20user%20name%20and%20password%20created%20in%20step12)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eecho%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'pacemakerLogin'%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%26gt%3B%26gt%3B%20~%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epacemaker%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%0Aecho%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'ComplexP%40%24%24w0rd!'%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%26gt%3B%26gt%3B%20~%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epacemaker%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%0Asudo%20mv%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E~%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epacemaker%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esecrets%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%0Asudo%20chown%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eroot%3Aroot%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esecrets%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%0Asudo%20chmod%20400%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Evar%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eopt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Emssql%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esecrets%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epasswd%20%23%20Only%20readable%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eby%20root%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E21.Create%20availability%20group%20resource%20at%20OS%20level%20in%20datacenter1%2C%20run%20following%20command%20on%20any%20one%20of%20the%20nodes%20in%20datacenter1(just%20on%20one%20node%2C%20and%20just%20one%20time)Here%20are%20the%20resource%20and%20constraint%20before%20creating%20the%20resource(no%20resource%2Fconstraint)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eresource%20create%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eag_cluster%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eocf%3Amssql%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eag%20ag_name%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EAGLinux%20meta%20failure%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Etimeout%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E60s%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Epromotable%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Enotify%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Etrue%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22pcsresource.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171768i2EC8755FEC28EFFC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22pcsresource.png%22%20alt%3D%22pcsresource.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E22.Create%20virtual%20IP%20resource.%20The%20resource%20name%20is%20%E2%80%98virtualip1%E2%80%99%2C%20and%20IP%20Address%20is%20192.168.3.111%20in%20this%20demonstration.%20This%20is%20the%20IP%20Address%20for%20the%20AG%20Listener.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eresource%20create%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Evirtualip1%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eocf%3Aheartbeat%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EIPaddr2%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eip%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E192.168.3.111%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E23.Create%20Availability%20group%20listener%20for%20Availability%20group%20ag1.%20Run%20following%20T-SQL%20query%20in%20primary%20replica(red1%20in%20this%20case).%20The%20ip%20address%20should%20be%20as%20same%20as%20the%20IP%20in%20step%2022.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGLinux%5D%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EADD%20LISTENER%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGLinux-Lis'%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20IP%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'192.168.3.111%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20red%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E'%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'255.255.255.0'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E))%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EPORT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E1433%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3Ea)It%E2%80%99s%20fine%20if%20you%20run%20step%2023%20before%20the%20step%2022%2C%20however%2C%3CSTRONG%3E%20you%20can%E2%80%99t%20use%20the%20IP%20Address%20to%20connect%20SQL%20Server%20until%20the%20resource%20in%20Pacemaker%20is%20created.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3Eb)There%20is%20a%20bug%20in%20DMV%20sys.availability_group_listener_ip_addresses%20showing%20the%20state%20is%3CSTRONG%3E%20offline%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E24.Add%20colocation%20constraint.%20Please%20note%2C%20without%20the%20constraint%2C%20the%20ip%20resource%20does%20not%20failover%20when%20the%20AG%20resource%20failover.%20Hence%20we%20need%20to%20create%20a%20constraint%20to%20guarantee%20that%20the%20IP%20will%20failover%20when%20cluster%20resource%20failover.%20Run%20following%20command%20on%20any%20servers%20in%20datacenter1(just%20on%20one%20server%2C%20and%20just%20one%20time)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Econstraint%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ecolocation%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eadd%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Evirtualip1%20with%20master%20ag_cluster%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-clone%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EINFINITY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ewith%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ersc%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Erole%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EMaster%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E25.Add%20ordering%20constraint%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Econstraint%20order%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Epromote%20ag_cluster-clone%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3E%20then%20start%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Evirtualip1%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22constraint.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171780iBD0C09AD6BB17E84%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22constraint.png%22%20alt%3D%22constraint.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E25.To%20update%20the%20property%20value%20to%202%20minutes%20run.%20Run%20following%20bash%20command%26nbsp%3B%20on%20any%20node(just%20one%20time)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20property%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eset%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Ecluster%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Erecheck%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Einterval%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E2%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Emin%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Esudo%20pcs%20property%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eset%20start%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Efailure%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-is-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Efatal%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Etrue%0Apcs%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eresource%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20magenta%3B%22%3Eupdate%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Eag_cluster%20meta%20failure%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Etimeout%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E60s%20%20%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%226%22%3ESection%202%3ACreate%20Availability%20group%20in%20datacenter2%3C%2FFONT%3E(Actually%2C%20you%20can%20run%20this%20section%20first%20as%20long%20as%20the%20certificate%20is%20as%20same%20as%20the%20one%20used%20in%20Section1).%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ESteps%20in%20Section%202%20is%20exactly%20same%20to%20regular%20SQL%20Server%20AG%20in%20Windows%2C%20the%20only%20thing%20I%E2%80%99d%20like%20to%20highlight%20is%20that%20you%20have%20to%20create%20the%20endPoint%20authenticated%20by%20certificate%2C%20which%20is%20the%20same%20certificate%20you%20used%20in%20SQL%20Linux.%3C%2FP%3E%0A%3CP%3E1.Copy%20certificate%20backup%20in%20SQL%20Linux%20to%20the%20two%20Windows%20servers.%3C%2FP%3E%0A%3CP%3E2.Run%20following%20queries%20to%20create%20master%20key%20%2Ccertificate%20and%20endpoint%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20MASTER%20KEY%20ENCRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CMASTER_KEY_PASSWORD%3E**'%0A%3C%2FMASTER_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0ACREATE%20CERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFROM%20FILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'C%3A%5CBackup%5Cdbm_certificate.cer'%20%20%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20PRIVATE%20KEY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFILE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'C%3A%5CBackup%5Cdbm_certificate.pvk'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDECRYPTION%20BY%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'**%3CPRIVATE_KEY_PASSWORD%3E**'%0A%3C%2FPRIVATE_KEY_PASSWORD%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0Acreate%20ENDPOINT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BHadr_endpoint%5D%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAS%20TCP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_PORT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E5022%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFOR%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20lime%3B%22%3EDATABASE_MIRRORING%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EROLE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20ALL%2C%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTHENTICATION%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECERTIFICATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENCRYPTION%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EREQUIRED%20ALGORITHM%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EAES%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20ENDPOINT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BHadr_endpoint%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESTATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESTARTED%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E3.Create%20login%20and%20grant%20permission%20to%20access%20the%20endpoint.%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20LOGIN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EInstanceA_Login%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20PASSWORD%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'Strong%20Passworsdfg1%23d'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20USER%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EInstanceA_User%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFOR%20LOGIN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EInstanceA_Login%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Ego%0Aalter%20authorization%20on%20CERTIFICATE%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3Edbm_certificate%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3Eto%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EInstanceA_User%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGO%0AGRANT%20CONNECT%20ON%20ENDPOINT%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BHadr_endpoint%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ETO%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3EInstanceA_Login%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E4.Create%20Availability%20group%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGWindows%5D%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFOR%20%0AREPLICA%20ON%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'node1'%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENDPOINT_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'TCP%3A%2F%2Fnode1%3A5022'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESYNCHRONOUS_COMMIT%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%2C%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'node2'%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EENDPOINT_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3EN'TCP%3A%2F%2Fnode2%3A5022'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%0A%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESYNCHRONOUS_COMMIT%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E5.Create%20Listener%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGWindows%5D%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EADD%20LISTENER%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGWindows-Lis'%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20IP%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E((%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'192.168.2.111%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20red%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E'%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'255.255.255.0'%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E))%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EPORT%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E1433%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E6.Run%20following%20T-SQL%20to%20connect%20the%20primary%20replica%20on%20all%20replicas(node2%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGWindows%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EJOIN%20%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGO%0AALTER%20AVAILABILITY%20GROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BAGWindows%5D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EGRANT%20CREATE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EANY%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDATABASE%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CDIV%20id%3D%22tinyMceEditorLiwei_4%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E7.Edit%20the%20hosts%20file%20on%20two%20windows%20servers%2C%20make%20sure%20they%20are%20able%20to%20access%20the%20listener%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EAGLinux-Lis.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%226%22%3ESection%203%3ACreate%20Hybrid%20Distributed%20Availability%20group%26nbsp%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E1.Create%20distributed%20availability%20group%20in%20datacenter1.%20Run%20following%20query%20in%20primary%20replica%20in%20datacenter1(%20red1%20in%20this%20case)%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ECREATE%20AVAILABILITY%0AGROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BDAGHybrid%5D%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EDISTRIBUTED%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY%0AGROUP%20ON%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGLinux'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'tcp%3A%2F%2FAGLinux-lis%3A5022'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EASYNCHRONOUS_COMMIT%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EMANUAL%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%0A%20%20%20%20%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGWindows'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'tcp%3A%2F%2FAGWindows-Lis%3A5022'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EASYNCHRONOUS_COMMIT%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EMANUAL%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CP%3E2.Run%20following%20query%20on%20the%20forward%20to%20join%20the%20Distributed%20AG%3C%2FP%3E%0A%3CPRE%20class%3D%22code%22%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EALTER%20AVAILABILITY%0AGROUP%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%22%3E%5BDAGHybrid%5D%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3EJOIN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY%0AGROUP%20ON%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGLinux'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'tcp%3A%2F%2FAGLinux-lis%3A5022'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EASYNCHRONOUS_COMMIT%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EMANUAL%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%2C%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'AGWindows'%0A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EWITH%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E(%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ELISTENER_URL%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20red%3B%22%3E'tcp%3A%2F%2FAGWindows-Lis%3A5022'%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAVAILABILITY_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EASYNCHRONOUS_COMMIT%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EFAILOVER_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EMANUAL%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3ESEEDING_MODE%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E%3D%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20blue%3B%22%3EAUTOMATIC%0A%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20gray%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FPRE%3E%0A%3CDIV%20id%3D%22tinyMceEditorLiwei_5%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22pcsresource.png%22%20style%3D%22width%3A%20329px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171821i975FAC92A274841B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22pcsresource.png%22%20alt%3D%22pcsresource.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20article%20for%20RHEL%207.6%20is%20here%3A%3CA%20href%3D%22https%3A%2F%2Fsqlserver.code.blog%2F2020%2F02%2F14%2Fcreate-a-hybrid-distributed-availability-group-between-sql-windows-and-sql-linux%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3Ehttps%3A%2F%2Fsqlserver.code.blog%2F2020%2F02%2F14%2Fcreate-a-hybrid-distributed-availability-group-between-sql-windows-and-sql-linux%2F%3C%2FFONT%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1175021%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22sql-loves-linux_2_twitter-002-640x358-100648879-large.png%22%20style%3D%22width%3A%20579px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F171322iB774B65ACEF531EE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22sql-loves-linux_2_twitter-002-640x358-100648879-large.png%22%20alt%3D%22sql-loves-linux_2_twitter-002-640x358-100648879-large.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1175021%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHigh%20Availability%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQL%202019%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

This article describes how to create a Hybrid SQL Server Distributed Availability Group between SQL Linux and SQL Windows

 

Here is the topology of the DAG environment

Data Center 1

Data Center 2

  • Red1:192.168.3.102 (Primary)
  • Red2:192.168.3.103
  • Availability group :AGLinux
  • Listener:AGLinux-Lis
  • IP:192.168.3.111
  • SQL Server: 2019 CU2
  • RHEL 8
  • Node1:192.168.2.101(Forwarder)
  • Node2:192.168.2.102
  • Availability group :AGWindows
  • Listener:AGWindows-Lis:
  • IP:192.168.2.111
  • SQL Server: 2019 CU2
  • Windows 2016

Distributed Availability group:DAGHybrid

Please make use following ports are opened on all the servers in both datacenters.

TCP:5022,2224,3123,21064

UDP:5405

 

For RHEL, you need to have the 'high availability subscription' enabled. Please refer https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-availability-group-cluster-rhel?view=sql... for detail.

Section 1:Create Availability group in datacenter1

1. Updates /etc/hosts on all the nodes Datacenter1, add IP , replica name and AG Listeners.

Here is a screenshot. All servers in the datacenter1 should have same setting.(Although the IP resources of Listeners will be created in later steps, it’s ok to add at the very beginning)

 

hostx.png

2. Run following bash commands on all servers in datacenter1 to enable Alwayson Feature.

sudo /opt/mssql/bin/mssql-conf set hadr.hadrenabled 1
sudo systemctl restart mssql-server  

3.Run following T-SQL to Enable Always On Health check event session on all the servers in datacenter1.

 

ALTER EVENT SESSION AlwaysOn_health ON SERVER WITH (STARTUP_STATE=ON);

 

4.Create a certificate, run the query on primary replica in datacenter1(red1 in this case)

use master
go
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '**<Master_Key_Password>**';
go
CREATE CERTIFICATE dbm_certificate WITH SUBJECT = 'dbm';
go
BACKUP CERTIFICATE dbm_certificate TO FILE = '/var/opt/mssql/data/dbm_certificate.cer'
WITH PRIVATE KEY (
FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
ENCRYPTION BY PASSWORD = '**<Private_Key_Password>**'
);

5. Copy the certificate to rest of the servers in datacenter1(red2 in this case)

cd /var/opt/mssql/data
scp dbm_certificate.* root@**<nodeName>**:/var/opt/mssql/data/ 
 

 

6. Give permission to the mssql user to access the certificate files in rest of the servers(red2 in this case).Run following bash command in red2.

cd /var/opt/mssql/data
chown mssql:mssql dbm_certificate.* 

7. Create the certificate on rest of the servers by restoring the certificate backup(red2 in this case)

use master
go
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '**<Master_Key_Password>**'
go
CREATE CERTIFICATE dbm_certificate
   FROM FILE = '/var/opt/mssql/data/dbm_certificate.cer'  
   WITH PRIVATE KEY (
   FILE = '/var/opt/mssql/data/dbm_certificate.pvk',
   DECRYPTION BY PASSWORD = '**<Private_Key_Password>**'
)

8.Create endpoint on all servers in datacenter1. The port 5022 is used.

CREATE ENDPOINT [Hadr_endpoint]
    AS TCP (LISTENER_PORT = 5022)
    FOR DATABASE_MIRRORING (
    ROLE = ALL,
    AUTHENTICATION = CERTIFICATE dbm_certificate,
    ENCRYPTION = REQUIRED ALGORITHM AES
);
ALTER ENDPOINT [Hadr_endpoint] STATE = STARTED;

9.Create AG with 2 synchronous replicas in datacenter1. Run following query on primary replica (red1 in this case)

CREATE AVAILABILITY GROUP [AGLinux]
    WITH (DB_FAILOVER = ON, CLUSTER_TYPE = EXTERNAL)
    FOR REPLICA ON
    N'red1'
        WITH (
        ENDPOINT_URL = N'tcp://red1:5022',
        AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
        FAILOVER_MODE = EXTERNAL,
        SEEDING_MODE = AUTOMATIC),
    N'red2'
        WITH (
        ENDPOINT_URL = N'tcp://red2:5022',
        AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
        FAILOVER_MODE = EXTERNAL,
        SEEDING_MODE = AUTOMATIC) 
go
ALTER AVAILABILITY GROUP [AGLinux] GRANT CREATE ANY DATABASE;--grant create any database permission

10.Join the AG group, run the following T-SQL queries on all the secondary servers in datacenter1(red4 in this case)

ALTER AVAILABILITY GROUP [AGLinux] JOIN WITH (CLUSTER_TYPE = EXTERNAL);
ALTER AVAILABILITY GROUP [AGLinux] GRANT CREATE ANY DATABASE

 

11.Create database and add to AG group on primary replica.(red1 in this case).

CREATE DATABASE [db2];
ALTER DATABASE [db2] SET RECOVERY FULL;
BACKUP DATABASE [db2] TO DISK = N'db2.bak';
BACKUP log [db2] TO DISK = N'db2.trn';
GO
ALTER AVAILABILITY GROUP [AGLinux] ADD DATABASE [db2];
 

 

12.Create SQL login pacemaker on all servers in datacenter1

CREATE LOGIN [pacemakerLogin] with PASSWORD= N'ComplexP@$$w0rd!'
GO
ALTER SERVER ROLE [sysadmin] ADD MEMBER [pacemakerLogin]
GO

13.Install pacemaker.Run the following bash command on all servers in datacenter1.

sudo yum install pacemaker pcs fence-agents-all resource-agents

14.Install SQL Server resource agent for SQL Server. Run the following bash command on all servers in datacenter1.

sudo yum install mssql-server-ha

15.Set the password for the default user that is created when installing Pacemaker and Corosync packages. Run following command on all servers in datacenter1(This command asks for password. The password should be same for the servers in same datacenter)

sudo passwd hacluster

16.To allow nodes to rejoin the cluster after the reboot, enable and start pcsd service and Pacemaker. Run the following commands on all servers in datacenter1.

sudo systemctl enable pcsd
sudo systemctl start pcsd
sudo systemctl enable pacemaker

17.Create a cluster in datacenter1. Run following commands on any one of the nodes in datacenter1(just on one server, and just one time). You will be asked to provide the username and password you  specified in step 15.

sudo pcs host auth red1 red2
sudo pcs cluster setup  cluster1 red1 red2
sudo pcs cluster start --all
sudo pcs cluster enable --all

pcshost.png

18.Because the node level fencing configuration depends heavily on your environment, disable it for this tutorial (it can be configured later. In my test, if this value is not set to false, you can’t failover, and IP resource may fail). The following script disables node level fencing(run it on any nodes in datacenter1)

sudo pcs property set stonith-enabled=false

20.On all SQL Server Linux servers in datacenter1 , save the credentials for the SQL Server login.(Use the same user name and password created in step12)

echo 'pacemakerLogin' >> ~/pacemaker-passwd 
echo 'ComplexP@$$w0rd!' >> ~/pacemaker-passwd 
sudo mv ~/pacemaker-passwd /var/opt/mssql/secrets/passwd 
sudo chown root:root /var/opt/mssql/secrets/passwd 
sudo chmod 400 /var/opt/mssql/secrets/passwd # Only readable by root

21.Create availability group resource at OS level in datacenter1, run following command on any one of the nodes in datacenter1(just on one node, and just one time)Here are the resource and constraint before creating the resource(no resource/constraint)

sudo pcs resource create ag_cluster ocf:mssql:ag ag_name=AGLinux meta failure-timeout=60s promotable notify=true

pcsresource.png

22.Create virtual IP resource. The resource name is ‘virtualip1’, and IP Address is 192.168.3.111 in this demonstration. This is the IP Address for the AG Listener.

sudo pcs resource create virtualip1 ocf:heartbeat:IPaddr2 ip=192.168.3.111

 

23.Create Availability group listener for Availability group ag1. Run following T-SQL query in primary replica(red1 in this case). The ip address should be as same as the IP in step 22.

ALTER AVAILABILITY GROUP [AGLinux] 
ADD LISTENER 'AGLinux-Lis' (WITH IP(('192.168.3.111','255.255.255.0')),PORT = 1433);

a)It’s fine if you run step 23 before the step 22, however, you can’t use the IP Address to connect SQL Server until the resource in Pacemaker is created.

b)There is a bug in DMV sys.availability_group_listener_ip_addresses showing the state is offline

24.Add colocation constraint. Please note, without the constraint, the ip resource does not failover when the AG resource failover. Hence we need to create a constraint to guarantee that the IP will failover when cluster resource failover. Run following command on any servers in datacenter1(just on one server, and just one time)

sudo pcs constraint colocation add virtualip1 with master ag_cluster-clone INFINITY with-rsc-role=Master

25.Add ordering constraint

sudo pcs constraint order promote ag_cluster-clone then start virtualip1

constraint.png

25.To update the property value to 2 minutes run. Run following bash command  on any node(just one time)

sudo pcs property set cluster-recheck-interval=2min
sudo pcs property set start-failure-is-fatal=true
pcs resource update ag_cluster meta failure-timeout=60s  

Section 2:Create Availability group in datacenter2(Actually, you can run this section first as long as the certificate is as same as the one used in Section1).

Steps in Section 2 is exactly same to regular SQL Server AG in Windows, the only thing I’d like to highlight is that you have to create the endPoint authenticated by certificate, which is the same certificate you used in SQL Linux.

1.Copy certificate backup in SQL Linux to the two Windows servers.

2.Run following queries to create master key ,certificate and endpoint

CREATE MASTER KEY ENCRYPTION BY PASSWORD = '**<Master_Key_Password>**'
go
CREATE CERTIFICATE dbm_certificate
   FROM FILE = 'C:\Backup\dbm_certificate.cer'  
   WITH PRIVATE KEY (
   FILE = 'C:\Backup\dbm_certificate.pvk',
   DECRYPTION BY PASSWORD = '**<Private_Key_Password>**'
)
go
create ENDPOINT [Hadr_endpoint]
    AS TCP (LISTENER_PORT = 5022)
    FOR DATABASE_MIRRORING (
    ROLE = ALL,
    AUTHENTICATION = CERTIFICATE dbm_certificate,
    ENCRYPTION = REQUIRED ALGORITHM AES
);
ALTER ENDPOINT [Hadr_endpoint] STATE = STARTED;

3.Create login and grant permission to access the endpoint.

CREATE LOGIN InstanceA_Login WITH PASSWORD = 'Strong Passworsdfg1#d';
CREATE USER InstanceA_User FOR LOGIN InstanceA_Login;
go
alter authorization on CERTIFICATE::dbm_certificate to InstanceA_User
GO
GRANT CONNECT ON ENDPOINT::[Hadr_endpoint] TO InstanceA_Login;

4.Create Availability group

 

CREATE AVAILABILITY GROUP [AGWindows]
FOR 
REPLICA ON N'node1' 
WITH
(
    ENDPOINT_URL = N'TCP://node1:5022', 
    FAILOVER_MODE = AUTOMATIC, AVAILABILITY_MODE = SYNCHRONOUS_COMMIT, SEEDING_MODE = AUTOMATIC
), 
N'node2' 
WITH 
(
    ENDPOINT_URL = N'TCP://node2:5022', 
    FAILOVER_MODE = AUTOMATIC, AVAILABILITY_MODE = SYNCHRONOUS_COMMIT, SEEDING_MODE = AUTOMATIC
)

 

5.Create Listener

ALTER AVAILABILITY GROUP [AGWindows] 
ADD LISTENER 'AGWindows-Lis' (WITH IP(('192.168.2.111','255.255.255.0')),PORT = 1433);

6.Run following T-SQL to connect the primary replica on all replicas(node2 in this case)

ALTER AVAILABILITY GROUP [AGWindows] JOIN 
GO
ALTER AVAILABILITY GROUP [AGWindows] GRANT CREATE ANY DATABASE;
 

7.Edit the hosts file on two windows servers, make sure they are able to access the listener AGLinux-Lis.

 

 

Section 3:Create Hybrid Distributed Availability group 

1.Create distributed availability group in datacenter1. Run following query in primary replica in datacenter1( red1 in this case)

CREATE AVAILABILITY
GROUP [DAGHybrid]
WITH (DISTRIBUTED) AVAILABILITY
GROUP ON 'AGLinux'
WITH (
        LISTENER_URL = 'tcp://AGLinux-lis:5022'
        ,AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT
        ,FAILOVER_MODE = MANUAL
        ,SEEDING_MODE = AUTOMATIC
        )
    ,'AGWindows'
WITH (
        LISTENER_URL = 'tcp://AGWindows-Lis:5022'
        ,AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT
        ,FAILOVER_MODE = MANUAL
        ,SEEDING_MODE = AUTOMATIC
        );

2.Run following query on the forward to join the Distributed AG

ALTER AVAILABILITY
GROUP [DAGHybrid]
JOIN AVAILABILITY
GROUP ON 'AGLinux'
WITH (
        LISTENER_URL = 'tcp://AGLinux-lis:5022'
        ,AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT
        ,FAILOVER_MODE = MANUAL
        ,SEEDING_MODE = AUTOMATIC
        ),
'AGWindows'
WITH (
        LISTENER_URL = 'tcp://AGWindows-Lis:5022'
        ,AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT
        ,FAILOVER_MODE = MANUAL
        ,SEEDING_MODE = AUTOMATIC
        );
 

pcsresource.png

 

The article for RHEL 7.6 is here:https://sqlserver.code.blog/2020/02/14/create-a-hybrid-distributed-availability-group-between-sql-wi...