Ceph分布式存储系统中的分布式事务设计与实现

需积分: 0 0 下载量 108 浏览量 更新于2024-07-01 收藏 563KB PDF 举报
"Day1_XG_4_Transaction_汪黎1" 本文主要介绍了Ceph分布式存储系统,包括其特点、架构以及关键组件。Ceph是一个开源的、大规模的分布式存储解决方案,它支持多种访问接口,如块设备、文件系统、S3、Swift以及RADOS。Ceph自2.6.34版本的Linux内核开始集成,并从OpenStack的Folsom版本起就被广泛支持,成为OpenStack中最常用的存储后端。 Ceph的特殊之处在于它的横向扩展性,没有中心化的元数据服务,采用对象存储和扁平命名空间的设计,这使得它能够在廉价硬件上实现自我修复和自我管理,无单点故障。Ceph系统同时提供了对象、块和文件存储功能,集三者于一体。 在集群架构中,Ceph包含客户端、监控节点(Monitor)和对象存储设备(OSD)。客户端通过标准的块或文件接口与系统交互;Monitor负责监控和维护整个系统的状态和拓扑;OSD则实际存储数据和元数据。 软件架构方面,Ceph系统可以分为四层:底层的RADOS( Reliable Autonomic Distributed Object Store)存储系统,用于提供高可靠性和可扩展性的分布式对象存储;LIBRADOS库封装了对RADOS的访问接口,支持原子性的对象写操作并确保副本间的同步;再上层是高层应用接口,如RADOS Gateway、RBD(Rados Block Device)和CephFS,它们为不同的应用场景提供了接口。 RADOS是Ceph的核心,它利用本地文件系统来存储对象,而LIBRADOS则提供了对这些对象进行操作的API,确保了数据的一致性和可靠性。例如,通过LIBRADOS,可以在指定对象的偏移位置执行一系列写操作,这些操作会原子化地完成,并在所有副本的OSD之间同步,从而保证了数据的完整性。 Ceph以其独特的设计和强大的功能,成为了现代数据中心和云存储环境中的一个重要选择,尤其适合处理大规模、高可用性的数据存储需求。

这段代码是什么意思-- Create table create table CUX_WMS_PO_TRANSACTION_HEADER ( erp_message_no VARCHAR2(60) not null, po_number VARCHAR2(20) not null, erp_order_type VARCHAR2(20) not null, org_code VARCHAR2(20) not null, header_id NUMBER not null, supplier_code VARCHAR2(240) not null, asn_num VARCHAR2(200) not null, last_update_date DATE, last_updated_by NUMBER, creation_date DATE, created_by NUMBER, last_update_login NUMBER, operatives VARCHAR2(50) not null, return_code VARCHAR2(200), return_mesg VARCHAR2(400), isinwarehouse NUMBER, remark VARCHAR2(200), character5 VARCHAR2(200), isinspectionresults NUMBER, remark2 VARCHAR2(150), remark3 VARCHAR2(150), remark4 VARCHAR2(150) ) tablespace APPS_TS_TX_DATA pctfree 10 initrans 1 maxtrans 255 storage ( initial 16K next 8K minextents 1 maxextents unlimited pctincrease 0 ); -- Add comments to the columns comment on column CUX_WMS_PO_TRANSACTION_HEADER.erp_message_no is '接口编号'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.po_number is '采购订单号'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.erp_order_type is '事务处理类型'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.org_code is 'OU-ID'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.header_id is '采购订单头id'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.supplier_code is '供应商编码'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.asn_num is 'wms号'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.operatives is '操作员'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.return_code is '反馈代码'; comment on column CUX_WMS_PO_TRANSACTION_HEADER.return_mesg is '反馈信息'; -- Create/Recreate indexes create index WMS_PO_TRANSACTION_HEADER_N1 on CUX_WMS_PO_TRANSACTION_HEADER (CREATION_DATE, DECODE(RETURN_CODE,'S','S','E')) tablespace APPS_TS_TX_DATA pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 128K minextents 1 maxextents unlimited pctincrease 0 ); create unique index WMS_PO_TRANSACTION_HEADER_U1 on CUX_WMS_PO_TRANSACTION_HEADER (ERP_MESSAGE_NO) tablespace APPS_TS_TX_DATA pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 128K minextents 1 maxextents unlimited pctincrease 0 );

2023-06-04 上传

优化以下Oracle语句: SELECT SUBSTR(msn.serial_number, 1, 10) genset_sn, msi2.segment1 Genset_BOM_NUM, msi2.inventory_item_id, msi.segment1 key_component, mut1.serial_number component_sn, msi.description component_desc, wdj.date_completed, (SELECT MAX(aps.vendor_name) FROM ap_suppliers aps, bom_resources bor, mtl_unit_transactions mut, po_headers_all poh, po_lines_all pol, wip_osp_resources_val_v wor WHERE aps.vendor_id = poh.vendor_id AND bor.resource_id = wor.resource_id AND poh.po_header_id = pol.po_header_id AND pol.item_id = bor.purchase_item_id AND wor.wip_entity_id = mut.transaction_source_id AND mut.serial_number = mut1.serial_number AND mut.inventory_item_id = mut1.inventory_item_id AND mut.organization_id = mut1.organization_id AND mut.receipt_issue_type = 2 AND mut.transaction_source_type_id = 5 ) supplier FROM mtl_material_transactions mmt1, mtl_material_transactions mmt2, mtl_parameters mpa, mtl_serial_numbers msn, mtl_system_items msi, mtl_system_items msi2, mtl_transaction_types mtt1, mtl_transaction_types mtt2, mtl_unit_transactions mut1, mtl_unit_transactions mut2, wip_discrete_jobs_v wdj WHERE mmt1.inventory_item_id = mut1.inventory_item_id AND mmt1.organization_id = mut1.organization_id AND WDJ.PRIMARY_ITEM_ID = msi2.INVENTORY_ITEM_ID AND mmt1.transaction_id = mut1.transaction_id AND mmt1.transaction_source_id = wdj.wip_entity_id AND mmt1.transaction_type_id = mtt1.transaction_type_id AND mtt1.transaction_type_name = 'WIP Issue' AND NOT EXISTS (SELECT 'WIP Negative Issue or WIP Return' FROM mtl_material_transactions mmt3, mtl_transaction_types mtt3, mtl_unit_transactions mut3 WHERE mmt3.transaction_id = mut3.transaction_id AND mmt3.transaction_type_id = mtt3.transaction_type_id AND mmt3.transaction_date > mmt1.transaction_date AND mtt3.transaction_type_name IN ('WIP Negative Issue', 'WIP Return') AND mut3.serial_number = mut1.serial_number AND mut3.inventory_item_id = mut1.inventory_item_id) AND mmt2.transaction_id = mut2.transaction_id AND mmt2.transaction_source_id = wdj.wip_entity_id AND mmt2.transaction_type_id = mtt2.transaction_type_id AND mtt2.transaction_type_name = 'WIP Completion' AND mpa.organization_code = 'WHP' AND msn.current_organization_id = mpa.organization_id AND LENGTH(msn.serial_number) >= 10 AND msi.inventory_item_id = mmt1.inventory_item_id AND msi.organization_id = mmt1.organization_id AND (msi.planning_make_buy_code = 2 OR msi.segment1 LIKE 'SO%') AND mut2.serial_number = msn.serial_number AND mut2.inventory_item_id = msn.inventory_item_id AND mut2.organization_id = mpa.organization_id AND msi2.ORGANIZATION_ID = '323'

2023-07-15 上传

优化sql:SELECT we.organization_id ,we.wip_entity_id ,case when wl.line_id is null then we.wip_entity_name else '' end wip_entity_name ,we.primary_item_id ,mtt.transaction_type_name ,mmt.transaction_date ,bd.department_code ,mmt.inventory_item_id ,mmt.subinventory_code ,mta.reference_account ,br.resource_code ,lu2.meaning as line_type_name ,mta.base_transaction_value ,mta.cost_element_id ,flv.meaning as cost_element ,wdj.class_code job_type_code ,ml.meaning job_type_name FROM (select * from gerp.mtl_material_transactions where substr(transaction_date,1,7) >= '2023-06' and transaction_source_type_id = 5) mmt inner join gerp.wip_entities we on mmt.organization_id = we.organization_id inner join gerp.mtl_transaction_accounts mta on mta.transaction_source_id = we.wip_entity_id and mta.transaction_id = mmt.transaction_id and mta.transaction_source_type_id = 5 inner join gerp.mtl_transaction_types mtt on mtt.transaction_type_id = mmt.transaction_type_id inner join mfg_lookups lu2 on lu2.lookup_code = mta.accounting_line_type and lu2.lookup_type = 'CST_ACCOUNTING_LINE_TYPE' inner join gerp.mtl_system_items_b msi on msi.inventory_item_id = mmt.inventory_item_id and msi.organization_id = mta.organization_id left join gerp.bom_departments bd on bd.department_id = mmt.department_id left join gerp.bom_resources br on br.resource_id = mta.resource_id left join gerp.wip_lines wl on wl.line_id = mmt.repetitive_line_id left join gerp.wip_discrete_jobs wdj on wdj.wip_entity_id = mta.transaction_source_id left join gerp.fnd_lookup_values_vl flv on cast(mta.cost_element_id as string) = flv.lookup_code and flv.lookup_type = 'CST_COST_CODE_TYPE' left join mfg_lookups ml on ml.lookup_code = wdj.job_type and ml.lookup_type = 'WIP_DISCRETE_JOB' 。其中mmt,we,mta,msi,wdj数据量很大

2023-06-10 上传