Azure SQL Data Sync
2019 3 8일 금요일
오후 2:32
Azure SQL Data Sync
 
 
온프레미스 MS SQL DB Azure PaaS SQLdatabase sync
Sync type : 양방향, -> , <- 모두 가능함.
Sync 테이블, 컬럼 상세하게 지정가능함.
 
중간에 허브데이터베이스가 존재함.
온프렘 DB ---- Azure 허브 DB ---- Azure SQL DB
 
시작은 한번에 하나의 소스 데이터베이스만...
동기화 그룹을 만들 때 단 하나의 데이터베이스에 있는 데이터부터 시작합니다. 여러 데이터베이스에 데이터가 있으면 SQL 데이터 동기화는 각 행을 해결해야 하는 충돌로 처리합니다. 이 충돌 해결이 초기 동기화를 느리게 만드는 원인입니다. 여러 데이터베이스에 데이터가 있으면 데이터베이스 크기에 따라 초기 동기화가 며칠부터 몇 달까지 걸릴 수 있습니다.
 
변경 내용이 전파되지 않으면 어떻게 될까요?
·         동기화 그룹이 경고 상태로 표시됩니다.
·         세부 정보는 포털 UI 로그 뷰어에 표시됩니다.
·         문제를 45일 내 해결하지 않으면 데이터베이스가 만료됩니다. (45일 이상 오프라인일 경우 만료로 설정)
 
기본 키
동기화 그룹의 각 테이블에는 기본 키가 있어야 합니다. SQL 데이터 동기화 서비스는 기본 키가 없는 테이블을 동기화 할 수 없습니다.
 
·         전체 자릿수가 28보다 큰 소수 또는 숫자 열이 있는 경우, SQL 데이터 동기화에서 동기화 중에 전환 오버플로 문제가 발생할 수 있습니다. 소수 또는 숫자 열의 전체 자릿수를 28 이하로 제한하는 것이 좋습니다.
 
 
Requirements • Each table must have a primary key. • A table cannot have an identity column that is not the primary key. • The names of objects (databases, tables, and columns) cannot contain the printable characters period (.), left square bracket ([), or right square bracket (J).
 
 
Summary • Start with an Azure SQL DB • Go to the "Sync to other databases" blade • Set up a Sync group • Set your sync frequency and conflict resolution • Add sync members (another Azure SQL DB and\or on-prem Instance) • Install sync agent for on-prem instance • Submit agent key (aka copy Azure key to your on-prem agent) Register your local instance • Define which tables should be kept in sync
 
 
시스템 생성 대체 텍스트:
 
 
New sync group Create Not Completed Add sync members Configure group Not Complete X Create Data Sync Group Sync Group Narne Sync Database ContactManagaDb (Sen«•. cmsglser•verviw Automatic Sync on Off Sync Frequerxy ' Conflict Resolution Member win Minutes
 
 
양방향으로 선택 
New sync group 1 Create sync group None Selected 3 Configure group Not Complete X Select sync members Cont.actManag«Db Montrr Add an Azure Database NO Azure SQL database available Add an On—premises Database No On-premises database available X -1 Configure Azure Database Sync Memb« Narne Microsoft Azure Internal Consumption • SQL Server • Azure SQL Database • Syrx Directions Bi-directional Sync To the Hub From the Hub
 
 
온프레미스 DB 선택, 에이전트 설치
New sync group I Create group None Selected 3 Not Complete X Select sync members ContactMan"erDb Montrr Add an Azure Database AzureDB Add an On—premises Database No On-premises database available X Configure On-Premises Choose the Sync Agent Gateway Sync Gateway installation is requim • Select the Database Notyet selected X Select Sync Agent Existing "ents O Create a ag<nt Client Sync Agent 1 ft is rkcessary to install the sync agent client to allow the on premises database connect to Azure database. Download Name 2 Generate agent key 3 Use this kW instaued sync agent to register x a -1
 
에이전트
설치 시 Requirement 잘 확인
Choose the download you want File Name DataSyncAgent_LicenseTerrns.rtf en- us\SQLDataSyncAgent-2.O-x86- ENU.msi 87 KB go MB
 
 
kirbyslocalagent Create Sync Agent kirbyslocalagent created. Client Sync Agent It is necessary to install the »•nc agent client to allow the on premises database connect to your Azure database. Download 2 and Generate an agent key 3 Use this key in insta"ed "c agent to register this agent.
 
에이전트키를 복사해와서,
실제 에이전트 구동하여 넣어줄것
Microsoft SQL Data Sync 2.0 Microsoft SQL Data Sync 2.0 Su it Age Configuration Please enter a valid agent key to proceed. The key nust be generated from SQL Data Sync web Databases State Agent Gy Message
 
Microsoft SQL Data Sync 2.0 Sync Metadata Database Configuration lajRpLmRhdGFiYXNlLndpbmRvd3Mubm HQ29udGFjdE1hbmFnZXJEYg Login krepko
 
 
성공 후 온프렘 DB register
Microsoft SQL Data Sync 2.0 Microsoft SQL Data Sync 2.0 Reg Databases Unregister Edit Credentials Submit Agent Key Configuration Ping Sync Service SQL Sync Connected Agent
 
Sync 2.0 SQL Server Configuration I 16\kirby cont*tmanagerdb
 
온프렘 DB 등록됨.
O Microsoft SQL Data Sync 2.0 Microsoft SQL Data Sync 2.0 Register Unregister Credentials Machine kirbrOI 1816\kir Submit Agent Key Reachable Ang Sync Service Message contactmanagerdb SQL Sync Connected
 
 
다시 Azure로 돌아와서…
온프레미스 DB 상세 선택
Configure On-Premises Choose the Sync Agent Gateway kirbyslocalagent Select the Database Not yet selected > SelectDatabase Men ber Name Orrp!ggmises databases connected kirby-Ol Bi-directional Syru x
 
 
 
다 되고나서,
테이블을 눌러보면.
kirbysdemogroup Sync Stop Properties Tables X Delete Filter Logs Refrgh Logs Schema information obtained successfully. Database provisioning failed with the exc+tion Error cw Sctwna information obtained successfully. Database provisioning failed with the exception •Invahd column Database provisioning failed with the exception •Invalid column Database failed With the exception •Invahd dumn Tables Select a database Hub base Select tables to sync (tables without primary key are rut supported) d bo dbo.Acrne_ltems dboAspNetR01es dbo.AspNet1JserC1aims dboAspNetus«Logins dboAspNetUserR01es dbo AspNetUs«s dba Contacts dbo.ContactsLoad dbo 4 2 4 3 2 12 8 9 8 6 Refresh Schema elect fields to ync dbo.Contacts Zip DATA TYPE Primary Key nvarchar( 128) Error 07/21/17123553 PM 12:3521 PM 07/21/17 12:3409 PM 07/21/17 12:3303 PM PM 07/21/1712:23:17 PM MEMBER DATABASE Co ntactMa nagerDb/cmsm co ntactma ContactManagerDb/cmsw ContactManager co n tactMa
 
Select a database AzureD3 Select tables to sync (tables without primary key are rut supported) Refresh Schema elect fields to ync dboContacts dba ._MigrationHistory dboAspNetR01es dbo.AspNetUserLogins dboÄspNetUs&R01es dba Contacts dba. Dim Employe dba Store 4 2 4 3 2 30 DATA Primary Key nvarchar(max) nvarchar(128)
 
 
 
kirbysdemogroup X Proper-ties Sync Stop X filter Logs Refreh Logs Select sync members Hub ContactManagerDb Add an Azure Database AzureDB Add an On-Premises Database onpremsql x Databases Tables
 
 
 
ContactManagerDb - Sync to other databases Ill Search (Ctrl*" Overview Activity Tags Diagnose and solve problems Quick start tier (scale DTUs) Geo—Replication Auditing & Threat Detection Dynamic Data Masking Transparent data encryption Syru to other databases Properties New Sync Group Refresh Data Sync wd' be retired from the classic portal on July 1st. Existing Data Sync will be migrated. Click here for information on what you need to do next. Sync Group STATtß Sync Agent
 
 
 
 
Microsoft OneNote 2016에서 작성





Azure Blob Shared Access Signature (SAS), Soft Delete
2019 3 8일 금요일
오전 8:29
Blob Storage
SAS
Shared Access Signature
 
저장소계정 액세스하려면 "액세스키"가 필요(갱신가능)
키를 이용한 관리자권한 부여형태
보호해야됨. 아님 정기적으로 변경해줘야됨.
 
-> SAS를 이용하면 "임시" 액세스 권한을 줄 수 있다.
SAS URL이다. 혹은 URL의 일부다
예를들어 1시간안에 만료되는 SAS를 만들 수 있다.
 
 
취소가능하다는데,
기존 생성한 리스트는 어떻게 안보임???
 
 
 
 
아무것도 손안대고, 클릭클릭 시 기본 8시간
격目스 ,•력寸는 특그~ :to竊고e 티스스이 다하 다스 권한을 1|구하늫 u국Ⅰ입니二h 스토리기 계정 키트 하1 달치한 특정 스트三ⅠTⅠ 리소스이 다한 국*Ⅰ스 권하을 우딯하려늫 들三卜0전틔거Ⅰ 구유 덕격Ⅰ스 수 일습 니다 이러한 들라0전트에 구유 덕격|스 u국Ⅰ를 화로할으트써 특정 기간 들한 EⅠ스스이 다한 다스 권한을 부들:수Ll二h 지정 수준 로드는 톻三i 스토리치 서비스를: 310b 화일 EH|0Ⅰ를1에 다한 덕!1스 권한을 우Ⅰ일할 수 8.1습니二h 자장크 다스 정격은 현자 지정 수준 로드이셔 최원코자 구;을을 우으하)1크 자)1한 점보 t|용크는 서비스 0 目크Ⅰ。s t|용크는 리소스 좋부 0 目 서비스 건의이너 目 가체 권한 0 目 읽기 쓰기 目 삭제 독특 주가 目 한들기 口 톁데이트 口 프로세스 시작 및 한로 날짜/시간 0 시챀 2019-03-03 2019-0 -03 (UTC 05乙이 - 현자 표준 시간다 화용크는 |국 주소 0 159 까도SS - 169 까5-SS- 76로 1 70 화용 크는 프로트들 0 (十) *TVS? 사용 (1) *TVS 및 HTV SAS 및 연결 문자열 생성 言 전 7
 
 
생성 시
SAS gg 231231 231231 LIRL h 12312312312
 
 
 
 
개발에서 사용하는 방법
저장공간 관련하여 전반적인 개발 예제 코드가 있음
 
개발에서는 SAS를 무조건 써야될까
 
 
Windows Azure 저장소가 여전히 CORS (Cross-Origin Resource Sharing) 지원하지 않는다는  입니다,  응용 프로그램과 BLOB 저장소가 동일한 도메인에 있어야한다는 것입니다 문제를 해결하려면 사용자가 파일을 업로드하려는저장소 계정의 공용 BLOB 컨테이너에 HTML 응용 프로그램 호스팅해야합니다. CORS 지원이 Windows Azure Storage에서  제공  것이라는 말을 들었습니다.
 
 
 
-> 지원함!!!
2013-08-15 버전부터 Azure 저장소 서비스는 Blob, 테이블, 큐 및 파일 서비스에 대해 CORS(원본 간 리소스 공유)를 지원합니다. CORS는 특정 도메인에서 실행되는 웹 애플리케이션이 다른 도메인의 자원에 액세스할 수 있도록 하는 HTTP 기능입니다
 
 
 
 
 
다른예제
대용량파일을 청킹해서 업로드 예제
HTML 5 File 인터페이스 에서 사용할  있는 슬라이싱 "기능이 있습니다 .  슬라이스 기능의 기능은 파일의 일부를 비동기 적으로 읽고 해당 데이터를 반환한다는  입니다
 
 
ì˜ìƒ
 
 
 
Soft Delete 기능이 있음.
Blob 지워도, 복구가능, 휴지통 기능?
, 기본값 비활성화임. 활성화 필요함.
활성화 시 Retention 기간 설정함.
Home testi2312312312 - Soft delete on. soft to E ' u rypt& sign—tuæ of mritE_ more Soft Retention policies Fi—lls virtusl Ret—in O wipt lob Custom Som.in Soft CDN
 
아래와 같이 체크박스가 보여짐.
 
Home StOAge Settings po [icy bdbs by Getting Things Ton Acquire MODIFIED ACCESS TIER BLOB TYPE blob blob LEASE STATE Deleted
 
주의할 것은.
저장공간 요금은 똑같이 빌링됨.
대신, 트랜잭션 과금은 작음.
자동생성 트랜잭션은 과금 X ,  대신 쓰기동작에만 과금됨.
You will not be billed for the transactions related to the automatic generation of snapshots. You will be billed for Undelete Blob transactions at the "Write Operations" rate.
 
 
Microsoft OneNote 2016에서 작성




'기술(Azure 만...) > [MS]Azure' 카테고리의 다른 글

Azure DSVM, DLVM 이미지  (0) 2019.04.05
Azure SQL Data Sync  (0) 2019.03.10
Function 조금, Cognitive service 조금  (0) 2019.03.10
ACI (Azure Container Instance)  (0) 2019.03.04
Luis Bot service on Azure Test결과  (0) 2019.01.25
Function 조금, Cognitive service 조금
2019 3 8일 금요일
오전 8:33
Function 조금, Cognitive service 조금

Cognitive service  한글은 계획이 엄꼬.

시스템 설계 시 참고할만 한 정도의 내용 
핵심은. 아래와 같은 구조를 서비스형태로 가져다 쓸 수 있음. SaaS
굳이 텍스트 감정검색이 아니라도. 직접 개발된 로직을 써도됨.
앞뒤로 큐를 놓고, 큐 뒤에 또 function을 둘수있음.(트리거는 마찬가지로 신규 데이터in )
피드백 정렬 아키텍처의 개념적 다이어그램
 
 
Cognitive Services 디렉터리
 
 
마켓플레이스 - 텍스트분석 찾아서 생성, 그리고 키 생성함.
대한민국 중부 리전이 있으나, 한글은 지원안함. 언어를 en으로 지정하면 에러는 나지 않지만.. 제대로 되지 않음
Supplied language is not supported. Pass in one of: ar,da,de,el,en,es,fi,fr,it,ja,nl,no,pl,pt-PT,ru,sv,tr,zh-Hans.
 
 
아래 개발 API안내 URL로 가서, 해당 생성된 키를 입력하여 테스트 가능.
텍스트 분석 API에서 호출할 수 있는 POST 메서드
이러한 엔드포인트는 언어 검색엔터티핵심 문구  감정


감정
 
아래와 같이 POST send 할 수 있음.
 

Content-Type: application/json
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••
{
 "documents": [
    {
      "language": "en",
      "id": "1",
      "text": "i can not make love."
    },
    {
      "language": "ko",
      "id": "2",
      "text": "아프다 너도 아프냐"
    },
    {
      "language": "es",
      "id": "3",
      "text": "La carretera estaba atascada. Había mucho tráfico el día de ayer."
    }
 ]
}
 

결과Response
Transfer-Encoding: chunked
x-ms-transaction-count: 2
CSP-Billing-Usage: CognitiveServices.TextAnalytics.BatchScoring|2
x-aml-ta-request-id: cd6f5fde-c872-4afd-bf73-c0dda5f22070
X-Content-Type-Options: nosniff
apim-request-id: 62d92304-b7cf-4182-8d47-19de15955aef
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Date: Mon, 04 Mar 2019 23:02:21 GMT
Content-Type: application/json; charset=utf-8

{
 "documents": [{
    "id": "1",
    "score": 0.11315375566482544
 }, {
    "id": "3",
    "score": 0.334433376789093
 }],
 "errors": [{
    "id": "2",
    "message": "Supplied language is not supported. Pass in one of: ar,da,de,el,en,es,fi,fr,it,ja,nl,no,pl,pt-PT,ru,sv,tr,zh-Hans. Seehttps://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview for the complete list of support languages."
 }]
}
 
 
 
Pricing tier
5K 9/30N Entity Extraction 0.00 S Standard Calls per minute Entity Extraction 2.00 usonooo TEXT RE. so 25K Entity Extraction 300USD/1K 74.71
 
100K Entity Extraction 250USD/1K 249.86 500K 9/30N Entity Extraction 200USD/1K 999.75 2.5M Entity Extraction 1 musD/1K 2499.84
 
10M Entity Extraction o_50USD/1K 4,999.99
 
 
 
 
혹시 지원되는 언어라면 아래와 같은 서버리스 리소스를 이용 구성가능
 Azure Queue Storage, Azure Functions, Azure Cognitive Services 사용
 
피드백 정렬 아키텍처의 개념적 다이어그램
 
 
 
Function의 트리거가  앞단 큐에 데이터가 들어왔을 때
 
Function의 로직은 아래와 같음
감정에 따라 텍스트 문서를 출력 큐로 정렬하는 Azure 함수 내부의 논리 순서도.
 
 
Function 만들고 -> 함수 추가
템플릿 더보기 선택 -> 템플릿 완료 후 보기 선택
-> Queue Trigger 추가 하니, 확장설치하라함.
Timer trigger 자접된 팉접으트 실할三Ⅰ든 함수입LⅠ二\Ⅰ Azure Qu은u은 Storage tngger 자접된 之」•든 호:r트;든 「화시iⅠ가 즈가들 :수二卜二\ 슽 는 할수힡니二卜Ⅰ A간」r은 Queue 5t0드§e trigger 확장이 설치되지 않았 습니다. 이 원들릿하는 二卜을의 화장이 들요합Ll二卜l Mi그050t 쏠지 확장 혈지 문제 하결를 자Ail즤 할아보려 여기를 클릭하kl요l
 
 
A간」r은 Queue 5t0드§e trigger 확장을 설치 했습니다. 계속 Timer trigger 자접된 팉접으트 실할三Ⅰ든 함수입LⅠ二\Ⅰ Azure Qu은u은 Storage tngger 자접된 之」•든 호:r트;든 「화시iⅠ가 즈가들 :수二卜二\ 슽 는 할수힡LⅠ二卜Ⅰ
 
Microsoft OneNote 2016에서 작성




+ Recent posts