完成安装

完成安装

注解

默认配置文件在各发行版本中可能不同。你可能需要添加这些部分和选项而不是修改已经存在的部分和选项。另外,在配置片段中的省略号(...)表示默认的配置选项你应该保留。

  1. 从对象存储资源仓库获取``/etc/swift/swift.conf`` 文件:

    # curl -o /etc/swift/swift.conf \
      https://git.openstack.org/cgit/openstack/swift/plain/etc/swift.conf-sample?h=stable/liberty
    
  2. 编辑``/etc/swift/swift.conf``文件并完成以下操作:

    • 在``[swift-hash]``部分,为你的环境配置哈希路径前缀和后缀:

      [swift-hash]
      ...
      swift_hash_path_suffix = HASH_PATH_SUFFIX
      swift_hash_path_prefix = HASH_PATH_PREFIX
      

      将其中的 HASH_PATH_PREFIX和 HASH_PATH_SUFFIX替换为唯一的值。

      警告

      这些值要保密,并且不要修改或丢失。

    • 在``[storage-policy:0]``部分,配置默认存储策略:

      [storage-policy:0]
      ...
      name = Policy-0
      default = yes
      
  3. 复制``swift.conf`` 文件到每个存储节点和其他允许了代理服务的额外节点的 /etc/swift 目录。

  1. 在所有节点上,确认配置文件目录是否有合适的所有权:

    # chown -R root:swift /etc/swift
    
  2. 在控制节点和其他运行了代理服务的节点上,启动对象存储代理服务及其依赖服务,并将它们配置为随系统启动:

    # systemctl enable openstack-swift-proxy.service memcached.service
    # systemctl start openstack-swift-proxy.service memcached.service
    
  3. 在存储节点上,启动对象存储服务,并将其设置为随系统启动:

    # systemctl enable openstack-swift-account.service openstack-swift-account-auditor.service \
      openstack-swift-account-reaper.service openstack-swift-account-replicator.service
    # systemctl start openstack-swift-account.service openstack-swift-account-auditor.service \
      openstack-swift-account-reaper.service openstack-swift-account-replicator.service
    # systemctl enable openstack-swift-container.service \
      openstack-swift-container-auditor.service openstack-swift-container-replicator.service \
      openstack-swift-container-updater.service
    # systemctl start openstack-swift-container.service \
      openstack-swift-container-auditor.service openstack-swift-container-replicator.service \
      openstack-swift-container-updater.service
    # systemctl enable openstack-swift-object.service openstack-swift-object-auditor.service \
      openstack-swift-object-replicator.service openstack-swift-object-updater.service
    # systemctl start openstack-swift-object.service openstack-swift-object-auditor.service \
      openstack-swift-object-replicator.service openstack-swift-object-updater.service
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.