1660969080
本文演示瞭如何使用 Ansible 自動化在 Microsoft Azure 上部署 Red Hat JBoss Enterprise Application Platform (JBoss EAP)。目前,Red Hat 提供 JBoss EAP 的 Microsoft Azure Marketplace 產品,但它只能通過相對複雜的自帶訂閱 (BYOS) 模型獲得。本文使用 Ansible Collections for Azure 創建 Azure 資源,然後使用 Ansible Middleware 項目提供的 WildFly 服務部署 JBoss EAP。
我們將使用 azure-eap-demo 作為本文的示例應用程序。使用這個應用程序,我們將在運行 Red Hat Enterprise Linux 的 Azure 虛擬機上自動化和部署 JBoss EAP 實例。
要運行示例應用程序,請滿足以下要求:
解壓azure-eap-demo
應用程序後,切換到存儲庫的頂級目錄,然後運行以下命令:
$ ansible-galaxy collection install -r requirements.yml
我們正在使用 Azure 提供的動態清單。創建實例後,您可以使用以下命令查看清單:
$ ansible-inventory -i inventory/myazure_rm.yml --graph
您需要在 playbook 中提供憑據,以便它可以從 Red Hat 客戶門戶下載軟件。在變量中指定您的 Red Hat 帳戶名並在rhn_username
變量中指定您的密碼rhn_password
。
此外,您必須在jboss_eap_rhn_id
變量中指定 JBoss EAP 的 Red Hat Subscription Management 授權。這個變量允許你指定你想要安裝的 JBoss EAP(Red Hat 支持)的版本。或者,您可以從 Red Hat 客戶門戶下載並安裝 JBoss EAP ZIP 文件。
所有這些變量都可以存儲在一個 YAML 文件中,您可以在 Ansible playbook 中名為vars_files
.
現在運行 Ansible playbook,在 create-demo-setup.yml
其中創建 Azure 資源並部署 JBoss EAP:
$ ansible-playbook -e @rhn-creds.yml -i inventory/myazure_rm.yml -e
"ansible_ssh_user=rheluser ansible_ssh_private_key_file='provide_your_ssh_private_key'
hosts_group_name=eap wildfly_version=7.4 override_install_name=jboss-eap"
create-demo-setup.yml
作為 playbook 執行的一部分,將克隆azure-eap-demo存儲庫。其create-demo-setup.yml
文件包含:
- name: Create Azure VM
hosts: localhost
gather_facts: false
connection: local
vars:
repo_url: "https://github.com/ansible-middleware/wildfly-cluster-demo.git"
branch: main
tasks:
- name: Git checkout
ansible.builtin.git:
repo: "{{ repo_url }}"
dest: "{{ playbook_dir }}/wildfly-cluster-demo"
version: "{{ branch }}"
single_branch: yes
clone: yes
update: yes
- name: Create demo resources on azure.
include_role:
name: 'azure'
vars:
ssh_key_path: "{{ ssh_key | default(lookup('env', 'HOME') + '/.ssh/id_rsa.pub')}}"
- meta: refresh_inventory
- pause:
minutes: 1
- name: Run wildfly-cluster-demo
import_playbook: wildfly-cluster-demo/playbook.yml
該劇本創建應用程序所需的 Azure 資源,包括資源組、虛擬網絡、子網、安全組、網絡接口、運行 Red Hat Enterprise Linux 的三個虛擬機以及虛擬機的公共 IP 地址。
Azure 雲實例的所有默認參數都在安裝包中roles/azure/defaults/main.yml
:
最後,劇本部署 WildFly 集群演示。請參閱文章使用 Ansible 自動化和部署 JBoss EAP 集群以了解有關如何使用 WildFly 的更多信息。
一旦 playbook 成功完成,您可以通過登錄Azure 門戶來驗證 JBoss EAP 集群。在這裡,您將找到為支持 JBoss EAP 集群而創建的所有資源。登錄或 SSH 到任何創建的虛擬機,並確認 WildFly 服務正在運行且可訪問。或者,您可以運行wildfly-cluster-demovalidate.yml
應用程序中提供的 playbook 來驗證配置。
要清理在 Azure 上創建的所有資源,請運行clean-demo-resources.yml
playbook:
$ ansible-playbook clean-demo-resources.yml
內容clean-demo-resources.yml
如下:
- name: Create Azure VM
hosts: localhost
connection: local
tasks:
- name: Create VM's on azure.
include_role:
name: 'azure'
vars:
action: destroy
該destroy
操作運行roles/azure/tasks/destroy.yml
文件,其中包含:
---
- name: Remove a VM and all resources that were autocreated
azure_rm_virtualmachine:
resource_group: "{{ item.resourcegroup_name }}"
name: "{{ item.name }}"
remove_on_absent: all_autocreated
state: absent
loop: "{{ vm }}"
- name: Delete a resource group including resources it contains
azure_rm_resourcegroup:
name: "{{ item.name }}"
force_delete_nonempty: yes
state: absent
loop: "{{ resource_groups }}"
playbook 移除所有虛擬機並刪除eap-cluster
資源組下的所有資源。
在本文中,我們演示了在 Microsoft Azure 上使用 Ansible 創建資源並使用 Ansible Middleware 項目中的工具部署 JBoss EAP 集群的分步過程。查看 ansible -middleware GitHub 組織和Ansible Middleware 網站中的其他集合和演示。
鏈接:https ://developers.redhat.com/articles/2022/08/17/how-ansible-simplifies-jboss-eap-deployment-azure
#redhat #aruze #jboss
1660969080
本文演示瞭如何使用 Ansible 自動化在 Microsoft Azure 上部署 Red Hat JBoss Enterprise Application Platform (JBoss EAP)。目前,Red Hat 提供 JBoss EAP 的 Microsoft Azure Marketplace 產品,但它只能通過相對複雜的自帶訂閱 (BYOS) 模型獲得。本文使用 Ansible Collections for Azure 創建 Azure 資源,然後使用 Ansible Middleware 項目提供的 WildFly 服務部署 JBoss EAP。
我們將使用 azure-eap-demo 作為本文的示例應用程序。使用這個應用程序,我們將在運行 Red Hat Enterprise Linux 的 Azure 虛擬機上自動化和部署 JBoss EAP 實例。
要運行示例應用程序,請滿足以下要求:
解壓azure-eap-demo
應用程序後,切換到存儲庫的頂級目錄,然後運行以下命令:
$ ansible-galaxy collection install -r requirements.yml
我們正在使用 Azure 提供的動態清單。創建實例後,您可以使用以下命令查看清單:
$ ansible-inventory -i inventory/myazure_rm.yml --graph
您需要在 playbook 中提供憑據,以便它可以從 Red Hat 客戶門戶下載軟件。在變量中指定您的 Red Hat 帳戶名並在rhn_username
變量中指定您的密碼rhn_password
。
此外,您必須在jboss_eap_rhn_id
變量中指定 JBoss EAP 的 Red Hat Subscription Management 授權。這個變量允許你指定你想要安裝的 JBoss EAP(Red Hat 支持)的版本。或者,您可以從 Red Hat 客戶門戶下載並安裝 JBoss EAP ZIP 文件。
所有這些變量都可以存儲在一個 YAML 文件中,您可以在 Ansible playbook 中名為vars_files
.
現在運行 Ansible playbook,在 create-demo-setup.yml
其中創建 Azure 資源並部署 JBoss EAP:
$ ansible-playbook -e @rhn-creds.yml -i inventory/myazure_rm.yml -e
"ansible_ssh_user=rheluser ansible_ssh_private_key_file='provide_your_ssh_private_key'
hosts_group_name=eap wildfly_version=7.4 override_install_name=jboss-eap"
create-demo-setup.yml
作為 playbook 執行的一部分,將克隆azure-eap-demo存儲庫。其create-demo-setup.yml
文件包含:
- name: Create Azure VM
hosts: localhost
gather_facts: false
connection: local
vars:
repo_url: "https://github.com/ansible-middleware/wildfly-cluster-demo.git"
branch: main
tasks:
- name: Git checkout
ansible.builtin.git:
repo: "{{ repo_url }}"
dest: "{{ playbook_dir }}/wildfly-cluster-demo"
version: "{{ branch }}"
single_branch: yes
clone: yes
update: yes
- name: Create demo resources on azure.
include_role:
name: 'azure'
vars:
ssh_key_path: "{{ ssh_key | default(lookup('env', 'HOME') + '/.ssh/id_rsa.pub')}}"
- meta: refresh_inventory
- pause:
minutes: 1
- name: Run wildfly-cluster-demo
import_playbook: wildfly-cluster-demo/playbook.yml
該劇本創建應用程序所需的 Azure 資源,包括資源組、虛擬網絡、子網、安全組、網絡接口、運行 Red Hat Enterprise Linux 的三個虛擬機以及虛擬機的公共 IP 地址。
Azure 雲實例的所有默認參數都在安裝包中roles/azure/defaults/main.yml
:
最後,劇本部署 WildFly 集群演示。請參閱文章使用 Ansible 自動化和部署 JBoss EAP 集群以了解有關如何使用 WildFly 的更多信息。
一旦 playbook 成功完成,您可以通過登錄Azure 門戶來驗證 JBoss EAP 集群。在這裡,您將找到為支持 JBoss EAP 集群而創建的所有資源。登錄或 SSH 到任何創建的虛擬機,並確認 WildFly 服務正在運行且可訪問。或者,您可以運行wildfly-cluster-demovalidate.yml
應用程序中提供的 playbook 來驗證配置。
要清理在 Azure 上創建的所有資源,請運行clean-demo-resources.yml
playbook:
$ ansible-playbook clean-demo-resources.yml
內容clean-demo-resources.yml
如下:
- name: Create Azure VM
hosts: localhost
connection: local
tasks:
- name: Create VM's on azure.
include_role:
name: 'azure'
vars:
action: destroy
該destroy
操作運行roles/azure/tasks/destroy.yml
文件,其中包含:
---
- name: Remove a VM and all resources that were autocreated
azure_rm_virtualmachine:
resource_group: "{{ item.resourcegroup_name }}"
name: "{{ item.name }}"
remove_on_absent: all_autocreated
state: absent
loop: "{{ vm }}"
- name: Delete a resource group including resources it contains
azure_rm_resourcegroup:
name: "{{ item.name }}"
force_delete_nonempty: yes
state: absent
loop: "{{ resource_groups }}"
playbook 移除所有虛擬機並刪除eap-cluster
資源組下的所有資源。
在本文中,我們演示了在 Microsoft Azure 上使用 Ansible 創建資源並使用 Ansible Middleware 項目中的工具部署 JBoss EAP 集群的分步過程。查看 ansible -middleware GitHub 組織和Ansible Middleware 網站中的其他集合和演示。
鏈接:https ://developers.redhat.com/articles/2022/08/17/how-ansible-simplifies-jboss-eap-deployment-azure
#redhat #aruze #jboss
1624713540
This article is a part of the series – Learn NoSQL in Azure where we explore Azure Cosmos DB as a part of the non-relational database system used widely for a variety of applications. Azure Cosmos DB is a part of Microsoft’s serverless databases on Azure which is highly scalable and distributed across all locations that run on Azure. It is offered as a platform as a service (PAAS) from Azure and you can develop databases that have a very high throughput and very low latency. Using Azure Cosmos DB, customers can replicate their data across multiple locations across the globe and also across multiple locations within the same region. This makes Cosmos DB a highly available database service with almost 99.999% availability for reads and writes for multi-region modes and almost 99.99% availability for single-region modes.
In this article, we will focus more on how Azure Cosmos DB works behind the scenes and how can you get started with it using the Azure Portal. We will also explore how Cosmos DB is priced and understand the pricing model in detail.
As already mentioned, Azure Cosmos DB is a multi-modal NoSQL database service that is geographically distributed across multiple Azure locations. This helps customers to deploy the databases across multiple locations around the globe. This is beneficial as it helps to reduce the read latency when the users use the application.
As you can see in the figure above, Azure Cosmos DB is distributed across the globe. Let’s suppose you have a web application that is hosted in India. In that case, the NoSQL database in India will be considered as the master database for writes and all the other databases can be considered as a read replicas. Whenever new data is generated, it is written to the database in India first and then it is synchronized with the other databases.
While maintaining data over multiple regions, the most common challenge is the latency as when the data is made available to the other databases. For example, when data is written to the database in India, users from India will be able to see that data sooner than users from the US. This is due to the latency in synchronization between the two regions. In order to overcome this, there are a few modes that customers can choose from and define how often or how soon they want their data to be made available in the other regions. Azure Cosmos DB offers five levels of consistency which are as follows:
In most common NoSQL databases, there are only two levels – Strong and Eventual. Strong being the most consistent level while Eventual is the least. However, as we move from Strong to Eventual, consistency decreases but availability and throughput increase. This is a trade-off that customers need to decide based on the criticality of their applications. If you want to read in more detail about the consistency levels, the official guide from Microsoft is the easiest to understand. You can refer to it here.
Now that we have some idea about working with the NoSQL database – Azure Cosmos DB on Azure, let us try to understand how the database is priced. In order to work with any cloud-based services, it is essential that you have a sound knowledge of how the services are charged, otherwise, you might end up paying something much higher than your expectations.
If you browse to the pricing page of Azure Cosmos DB, you can see that there are two modes in which the database services are billed.
Let’s learn about this in more detail.
#azure #azure cosmos db #nosql #azure #nosql in azure #azure cosmos db
1620435660
In this article, you learn how to set up Azure Data Sync services. In addition, you will also learn how to create and set up a data sync group between Azure SQL database and on-premises SQL Server.
In this article, you will see:
Azure Data Sync —a synchronization service set up on an Azure SQL Database. This service synchronizes the data across multiple SQL databases. You can set up bi-directional data synchronization where data ingest and egest process happens between the SQL databases—It can be between Azure SQL database and on-premises and/or within the cloud Azure SQL database. At this moment, the only limitation is that it will not support Azure SQL Managed Instance.
#azure #sql azure #azure sql #azure data sync #azure sql #sql server
1667747700
A collaborative curated list of awesome Ansible resources, tools, Roles, tutorials and other related stuff.
Ansible is an open source toolkit, written in Python, it is used for configuration management, application deployment, continuous delivery, IT infrastructure automation and automation in general.
Official resources by and for Ansible.
Places where to chat with the Ansible community
Tutorials and courses to learn Ansible.
Books about Ansible.
Video tutorials and Ansible training.
Tools for and using Ansible.
Best practices and other opinions on Ansible.
Awesome production ready Playbooks, Roles and Collections to get you up and running.
Author: ansible-community
Source Code: https://github.com/ansible-community/awesome-ansible
License: CC0-1.0 license
1600624800
In the last article, we had a look at how to start with Azure DevOps: Getting Started With Audit Streaming With Event Grid
In the article, we will go to the next step to create a subscription and use webhook event handlers to view those logs in our Azure web application.
#cloud #tutorial #azure #event driven architecture #realtime #signalr #webhook #azure web services #azure event grid #azure #azure event grid #serverless architecture #application integration