国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Ceph入門到精通-創(chuàng)建存儲桶通知

這篇具有很好參考價(jià)值的文章主要介紹了Ceph入門到精通-創(chuàng)建存儲桶通知。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

在存儲桶級別創(chuàng)建存儲桶通知。這些需要 與發(fā)送存儲桶通知的目標(biāo)一起發(fā)布。桶 通知是 S3 操作。

父主題:
存儲桶管理

先決條件

  • 運(yùn)行 IBM Storage Ceph 集群,帶有 Ceph Object Gateway。

  • 正在運(yùn)行的 HTTP 服務(wù)器、RabbitMQ 服務(wù)器或 Kafka 服務(wù)器。

  • 根級訪問。

  • 用戶訪問密鑰和私有密鑰。

  • 終結(jié)點(diǎn)參數(shù)。

重要:IBM 支持事件,例如 、 、 和 。IBM 還支持事件,例如 和 。ObjectCreateputpostmultipartUploadcopyObjectRemoveobject_deletes3_multi_object_delete

下面列出了創(chuàng)建存儲桶通知的兩種方法:

  • 使用 boto 腳本

  • 使用 AWS CLI

程序

使用 boto 腳本

  1. 安裝 python3-boto3 軟件包:

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm">[user@client ~]$  dnf install python3-boto3</code></span></span></span>
  2. 創(chuàng)建 S3 存儲桶。

  3. 創(chuàng)建一個(gè) python 腳本,為 、 或 協(xié)議創(chuàng)建 SNS 主題:topic.pyhttpamqpkafka

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm">import boto3
    from botocore.client import Config
    import sys
    
    # endpoint and keys from vstart
    endpoint = 'http://127.0.0.1:8000'
    access_key='0555b35654ad1656d804'
    secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
    
    client = boto3.client('sns',
            endpoint_url=endpoint,
            aws_access_key_id=access_key,
            aws_secret_access_key=secret_key,
            config=Config(signature_version='s3'))
    
    attributes = {"push-endpoint": "amqp://localhost:5672", "amqp-exchange": "ex1", "amqp-ack-level": "broker"}
    
    client.create_topic(topic_name="mytopic", Attributes=attributes)</code></span></span></span>
  4. Run the python script for creating topic:

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> python3 topic.py</code></span></span></span>
  5. Create a python script?to create S3 bucket notification for?and?events:notification.pys3:objectCreates3:objectRemove

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm">import boto3
    import sys
    
    # bucket name as first argument
    bucketname = sys.argv[1]
    # topic ARN as second argument
    topic_arn = sys.argv[2]
    # notification id as third argument
    notification_id = sys.argv[3]
    
    # endpoint and keys from vstart
    endpoint = 'http://127.0.0.1:8000'
    access_key='0555b35654ad1656d804'
    secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
    
    client = boto3.client('s3',
            endpoint_url=endpoint,
            aws_access_key_id=access_key,
            aws_secret_access_key=secret_key)
    
    # regex filter on the object name and metadata based filtering are extension to AWS S3 API
    # bucket and topic should be created beforehand
    
    topic_conf_list = [{'Id': notification_id, 
                        'TopicArn': topic_arn, 
                        'Events': ['s3:ObjectCreated:*', 's3:ObjectRemoved:*'],
                        }]
        client.put_bucket_notification_configuration(
            Bucket=bucketname,
              NotificationConfiguration={
                'TopicConfigurations': [
                  {
                    'Id': notification_name,
                    'TopicArn': topic_arn,
                    'Events': ['s3:ObjectCreated:*', 's3:ObjectRemoved:*']
                  }]})</code></span></span></span>
  6. Run the python script for creating the bucket notification:

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> python3 notification.py</code></span></span></span>
  7. Create S3 objects in the bucket.

  8. Fetch the notification configuration:

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm">endpoint = 'http://127.0.0.1:8000'
    access_key='0555b35654ad1656d804'
    secret_key='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
    
    client = boto3.client('s3',
            endpoint_url=endpoint,
            aws_access_key_id=access_key,
            aws_secret_access_key=secret_key)
    
    # getting a specific notification configuration is an extension to AWS S3 API
    
    print(client.get_bucket_notification_configuration(Bucket=bucketname))</code></span></span></span>
  9. Optional: Delete the objects.

    1. Verify the object deletion events at the?,?, or?receiver.httprabbitmqkafka

Using the AWS CLI

  1. Create topic:

    Syntax

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> aws --endpoint=_AWS_END_POINT_ sns create-topic --name NAME --attributes=ATTRIBUTES_FILE</code></span></span></span>

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> [user@client ~]$ aws --endpoint=http://localhost sns create-topic --name test-kafka --attributes=file://topic.json
    
     sample topic.json:
     {"push-endpoint": "kafka://localhost","verify-ssl": "False", "kafka-ack-level": "broker", "persistent":"true"}
     ref: https://docs.aws.amazon.com/cli/latest/reference/sns/create-topic.html</code></span></span></span>
  2. Create the bucket notification:

    Syntax

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> aws s3api put-bucket-notification-configuration --bucket BUCKET_NAME --notification-configuration NOTIFICATION_FILE</code></span></span></span>

    Example

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> [user@client ~]$ aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://notification.json
    
     sample notification.json
     {
         "TopicConfigurations": [
             {
                 "Id": "test_notification",
                 "TopicArn": "arn:aws:sns:us-west-2:123456789012:test-kafka",
                 "Events": [
                     "s3:ObjectCreated:*"
                 ]
             }
         ]
     }</code></span></span></span>
  3. Fetch the notification configuration:

    Syntax

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> aws s3api --endpoint=_AWS_ENDPOINT_ get-bucket-notification-configuration --bucket BUCKET_NAME</code></span></span></span>

    文章來源地址http://www.zghlxwxcb.cn/news/detail-553020.html

    <span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><span style="background-color:#1e1e1e"><code class="language-plaintext-ibm"> [user@client ~]$ aws s3api --endpoint=http://localhost get-bucket-notification-configuration --bucket my-bucket
     {
         "TopicConfigurations": [
             {
                 "Id": "test_notification",
                 "TopicArn": "arn:aws:sns:default::test-kafka",
                 "Events": [
                     "s3:ObjectCreated:*"
                 ]
             }
         ]
     }</code></span></span></span>

到了這里,關(guān)于Ceph入門到精通-創(chuàng)建存儲桶通知的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Ceph入門到精通-Ceph PG狀態(tài)詳細(xì)介紹(全)

    本文主要介紹PG的各個(gè)狀態(tài),以及ceph故障過程中PG狀態(tài)的轉(zhuǎn)變。 Ceph is still creating the placement group. Ceph 仍在創(chuàng)建PG。 activating The placement group is peered but not yet active. PG已經(jīng)互聯(lián),但是還沒有active。 active Ceph will process requests to the placement group. Ceph 可處理到此PG的請求。 clean Ceph re

    2024年02月14日
    瀏覽(22)
  • Ceph入門到精通-ceph故障處理 - osd down處理

    發(fā)現(xiàn)osd掉之后,我們首先要確認(rèn)是哪個(gè)主機(jī)的哪塊盤,來判斷是這個(gè)盤壞了還是什么原因 來看一下是哪兩塊 登錄對應(yīng)機(jī)器確認(rèn)下是哪塊盤 2.我們發(fā)現(xiàn)盤還在,首先嘗試能否重啟ceph-osd服務(wù) ,這里已經(jīng)拉起來了 3.如果重啟無望或者盤漂移,重新卸載安裝 3.1 看看日志 是不是有

    2024年02月01日
    瀏覽(18)
  • Ceph入門到精通-Linux下Ceph源碼編譯和GDB調(diào)試

    Ceph版本:14.2.22 Linux版本:ubuntu-server 18.04 ? ? Ceph源碼是托管在Github上,由于某些原因,國內(nèi)訪問Github網(wǎng)站很慢,所以需要從其他途徑加速獲取源碼。Github官方給出了幾個(gè)Github的鏡像網(wǎng)站: https://github.com.cnpmjs.org/ https://hub.fastgit.org/ 本地需要修改~/.gitconfig文件,才可以從上面

    2024年02月12日
    瀏覽(21)
  • Ceph入門到精通-podman 入門實(shí)戰(zhàn)

    Ceph入門到精通-podman 入門實(shí)戰(zhàn)

    目錄 podman安裝 podman制作本地鏡像 podman(docker)命令回顧 podman快速入門 一入編程深似海,從此節(jié)操是路人。 最近使用podman,就想著寫一篇總結(jié)性的筆記,以備后續(xù)參考。就如同寫代碼,不寫注釋,過了一段時(shí)間可能會想這是我寫的嗎?不會吧,還要理一下邏輯才能讀懂,不利

    2023年04月24日
    瀏覽(21)
  • Ceph入門到精通-sysctl參數(shù)優(yōu)化

    sysctl.conf ?是一個(gè)文件,通常用于在 Linux 操作系統(tǒng)中配置內(nèi)核參數(shù)。這些參數(shù)可以控制網(wǎng)絡(luò)、文件系統(tǒng)、內(nèi)存管理等各方面的行為。 99-xx.yml ?可能是一個(gè)文件名,其中? 99- ?是一個(gè)特定的命名約定。在? sysctl.conf ?文件中,通常會有一個(gè)特定的順序來加載配置項(xiàng)。通常,以?

    2024年02月10日
    瀏覽(17)
  • Ceph入門到精通-如何編譯安裝Quagga?

    Ceph入門到精通-如何編譯安裝Quagga?

    Quagga Quagga中文翻譯斑驢,是一種先進(jìn)的路由軟件包,提供一套基于TCP/IP的路由協(xié)議。 – 使得操作系統(tǒng)變成專業(yè)的路由 – 使得操作系統(tǒng)具有與傳統(tǒng)路由通過路由協(xié)議直接對接 – BGP – OSPF – RIP – IS-IS – MPLS – LDP – BFD – PIM-SSM – 傳統(tǒng)路由以提供所有路由協(xié)議的過程程序的

    2024年02月11日
    瀏覽(19)
  • Ceph入門到精通-LVS基礎(chǔ)知識

    Ceph入門到精通-LVS基礎(chǔ)知識

    LB集群: ???(Load??Balancing)即負(fù)載均衡集群,其目的是為了提高訪問的并發(fā)量及提升服務(wù)器的性能,其 ???實(shí)現(xiàn)方式分為硬件方式和軟件方式。 ??硬件實(shí)現(xiàn)方式: ????????常用的有 F5公司的BIG-IP系列、A10公司的AX系列、Citrix公司的 NetScaler系列等 ??軟件實(shí)現(xiàn)方式: ??

    2024年02月11日
    瀏覽(22)
  • Ceph入門到精通-更換osd、擴(kuò)容osd

    1. 1 查看故障盤osd id 1.2 銷毀osd 1.3 更換故障硬盤 1.4 查看新硬盤盤符 1.5 擦除新硬盤 1.6 預(yù)備替換原osd 1.7 查看osd fsid 1.8 激活osd 3.1 停止所有osd服務(wù) 3.2 銷毀所有osd 3.3 擦除磁盤數(shù)據(jù) 3.4 清除crush數(shù)據(jù) 3.5 刪除osd應(yīng)用 4. 調(diào)整PG

    2024年02月19日
    瀏覽(19)
  • Ceph入門到精通-Nginx 大量請求 延遲優(yōu)化

    優(yōu)化nginx以處理大量請求并減少延遲可以通過以下幾種方法實(shí)現(xiàn): 調(diào)整worker_processes和worker_connections參數(shù):增加worker_processes值可以增加nginx的進(jìn)程數(shù)量,提高并發(fā)處理能力。增加worker_connections參數(shù)的值可以增加每個(gè)worker進(jìn)程可處理的連接數(shù),從而在請求高峰期更好地分配負(fù)載。

    2024年02月10日
    瀏覽(20)
  • Ceph入門到精通-Nginx超時(shí)參數(shù)分析設(shè)置

    Ceph入門到精通-Nginx超時(shí)參數(shù)分析設(shè)置

    nginx中有些超時(shí)設(shè)置,本文匯總了nginx中幾個(gè)超時(shí)設(shè)置 Nginx 中的超時(shí)設(shè)置包括: “client_body_timeout”:設(shè)置客戶端向服務(wù)器發(fā)送請求體的超時(shí)時(shí)間,單位為秒。 “client_header_timeout”:設(shè)置客戶端向服務(wù)器發(fā)送請求頭的超時(shí)時(shí)間,單位為秒。 “send_timeout”:設(shè)置服務(wù)器向客戶端

    2024年02月07日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包