Implantado um único nó swift, ou seja, contendo tanto swift-proxy quanto swift-storage charms, em um ambiente de openstack de vários nós. Aqui está o meu arquivo de configuração:
swift-proxy:
zone-assignment: 'manual'
replicas: 1
swift-hash: 'fdfef9d4-8b06-11e2-8ac0-531c923c8fae'
swift-storage:
zone: 1
block-device: /etc/swift/storage.img|10G
(Como esta é uma configuração experimental, não necessito de várias réplicas). Depois de montar o armazenamento.img em um dispositivo de loop:
/etc/swift/storage.img /srv/node/loop0 xfs loop,noatime,nodiratime,nobarrier,logbufs=8 0 0
e reiniciando serviços rápidos, eu pude fazer upload e download de arquivos, conforme link .
Atualmente, o problema é que acessar o Swift from Horizon, retorna o erro [HTTP / 1.1 500 INTERNAL SERVER ERROR 49ms], com "Algo deu errado!" on / horizon / project / containers / page. Os logs do servidor apache no nó Horizon e o syslog no nó Swift não transmitem nenhuma mensagem útil:
Apache logs:
...
10.0.0.63 - - [01/Aug/2014:22:47:46 +0000] "GET /horizon/project/containers/ HTTP/1.1" 500 2205 "https://10.0.0.63/horizon/admin/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0"
...
Swift logs:
...
Aug 1 22:52:11 node2 account-replicator: Beginning replication run
Aug 1 22:52:11 node2 account-replicator: Replication run OVER
Aug 1 22:52:11 node2 account-replicator: Attempted to replicate 1 dbs in 0.00824 seconds (121.32638/s)
Aug 1 22:52:11 node2 account-replicator: Removed 0 dbs
Aug 1 22:52:11 node2 account-replicator: 0 successes, 0 failures
Aug 1 22:52:11 node2 account-replicator: no_change:0 ts_repl:0 diff:0 rsync:0 diff_capped:0 hashmatch:0 empty:0
Aug 1 22:52:27 node2 object-replicator: Starting object replication pass.
Aug 1 22:52:27 node2 object-replicator: 1/1 (100.00%) partitions replicated in 0.00s (274.28/sec, 0s remaining)
Aug 1 22:52:27 node2 object-replicator: 1 suffixes checked - 0.00% hashed, 0.00% synced
Aug 1 22:52:27 node2 object-replicator: Partition times: max 0.0008s, min 0.0008s, med 0.0008s
Aug 1 22:52:27 node2 object-replicator: Object replication complete. (0.00 minutes)
Aug 1 22:52:39 node2 container-replicator: Beginning replication run
Aug 1 22:52:39 node2 container-replicator: Replication run OVER
Aug 1 22:52:39 node2 container-replicator: Attempted to replicate 1 dbs in 0.00803 seconds (124.54721/s)
Aug 1 22:52:39 node2 container-replicator: Removed 0 dbs
Aug 1 22:52:39 node2 container-replicator: 0 successes, 0 failures
Aug 1 22:52:39 node2 container-replicator: no_change:0 ts_repl:0 diff:0 rsync:0 diff_capped:0 hashmatch:0 empty:0
Aug 1 22:52:40 node2 object-auditor: Begin object audit "forever" mode (ZBF)
Aug 1 22:52:40 node2 object-auditor: Begin object audit "forever" mode (ALL)
Aug 1 22:52:40 node2 object-auditor: Object audit (ZBF) "forever" mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 639.38, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.63
Aug 1 22:52:40 node2 object-auditor: Object audit (ALL) "forever" mode completed: 0.01s. Total quarantined: 0, Total errors: 0, Total files/sec: 77.42, Total bytes/sec: 14090.95, Auditing time: 0.01, Rate: 0.96
Aug 1 22:52:40 node2 object-auditor: Begin object audit "forever" mode (ZBF)
Aug 1 22:52:40 node2 object-auditor: Object audit (ZBF) "forever" mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 623.87, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.66
Aug 1 22:52:40 node2 container-updater: Begin container update sweep
Aug 1 22:52:40 node2 container-updater: Container update sweep completed: 0.05s
Aug 1 22:52:41 node2 account-replicator: Beginning replication run
Aug 1 22:52:41 node2 account-replicator: Replication run OVER
Aug 1 22:52:41 node2 account-replicator: Attempted to replicate 1 dbs in 0.00801 seconds (124.78064/s)
Aug 1 22:52:41 node2 account-replicator: Removed 0 dbs
Aug 1 22:52:41 node2 account-replicator: 0 successes, 0 failures
Aug 1 22:52:41 node2 account-replicator: no_change:0 ts_repl:0 diff:0 rsync:0 diff_capped:0 hashmatch:0 empty:0
Aug 1 22:52:57 node2 object-replicator: Starting object replication pass.
Aug 1 22:52:57 node2 object-replicator: 1/1 (100.00%) partitions replicated in 0.00s (274.42/sec, 0s remaining)
Aug 1 22:52:57 node2 object-replicator: 1 suffixes checked - 0.00% hashed, 0.00% synced
Aug 1 22:52:57 node2 object-replicator: Partition times: max 0.0009s, min 0.0009s, med 0.0009s
Aug 1 22:52:57 node2 object-replicator: Object replication complete. (0.00 minutes)
Aug 1 22:53:09 node2 container-replicator: Beginning replication run
Aug 1 22:53:09 node2 container-replicator: Replication run OVER
Aug 1 22:53:09 node2 container-replicator: Attempted to replicate 1 dbs in 0.00786 seconds (127.24117/s)
Aug 1 22:53:09 node2 container-replicator: Removed 0 dbs
Aug 1 22:53:09 node2 container-replicator: 0 successes, 0 failures
Aug 1 22:53:09 node2 container-replicator: no_change:0 ts_repl:0 diff:0 rsync:0 diff_capped:0 hashmatch:0 empty:0
Aug 1 22:53:10 node2 object-auditor: Begin object audit "forever" mode (ZBF)
Aug 1 22:53:10 node2 object-auditor: Begin object audit "forever" mode (ALL)
Aug 1 22:53:10 node2 object-auditor: Object audit (ZBF) "forever" mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 283.05, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.68
Aug 1 22:53:10 node2 object-auditor: Object audit (ALL) "forever" mode completed: 0.01s. Total quarantined: 0, Total errors: 0, Total files/sec: 84.08, Total bytes/sec: 15301.85, Auditing time: 0.01, Rate: 0.89
Aug 1 22:53:10 node2 object-auditor: Begin object audit "forever" mode (ZBF)
Aug 1 22:53:10 node2 object-auditor: Object audit (ZBF) "forever" mode completed: 0.00s. Total quarantined: 0, Total errors: 0, Total files/sec: 714.90, Total bytes/sec: 0.00, Auditing time: 0.00, Rate: 0.64
...
Deve-se observar que, para o swift cli funcionar corretamente, eu tenho que usar a opção "--insegure", caso contrário a verificação SSL falhará, por exemplo, emitindo a lista swift --debug -v -V 2.0:
...
DEBUG:iso8601.iso8601:Got u'00' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'01' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'35' for 'second' with default None
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): 10.0.0.59
[Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
em que 10.0.0.59 é o endereço do nó Swift; no entanto, com a opção "--insecure":
...
DEBUG:iso8601.iso8601:Got u'03' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'37' for 'second' with default None
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): 10.0.0.59
DEBUG:urllib3.connectionpool:Setting read timeout to <object object at 0x7feea6bd2090>
DEBUG:urllib3.connectionpool:"GET /v1/AUTH_9b508c0ebfb144b596034b3c99cbfcad?format=json HTTP/1.1" 200 46
DEBUG:swiftclient:REQ: curl -i https://10.0.0.59:8080/v1/AUTH_9b508c0ebfb144b596034b3c99cbfcad?format=json -X GET -H "X-Auth-Token: 3161ab12fd4545888e0c42365480e310"
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: [('content-length', '46'), ('accept-ranges', 'bytes'), ('server', 'Apache/2.4.7 (Ubuntu)'), ('x-timestamp', '1406848229.54726'), ('x-trans-id', 'tx50a3a1d09ae145958a6bb-0053dc1cc9'), ('date', 'Fri, 01 Aug 2014 23:03:38 GMT'), ('x-account-bytes-used', '182'), ('x-account-container-count', '1'), ('content-type', 'application/json; charset=utf-8'), ('x-account-object-count', '1')]
DEBUG:swiftclient:RESP BODY: [{"count": 1, "bytes": 182, "name": "myfile"}]
myfile
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): 10.0.0.59
DEBUG:urllib3.connectionpool:Setting read timeout to <object object at 0x7feea6bd2090>
DEBUG:urllib3.connectionpool:"GET /v1/AUTH_9b508c0ebfb144b596034b3c99cbfcad?format=json&marker=myfile HTTP/1.1" 200 2
DEBUG:swiftclient:REQ: curl -i https://10.0.0.59:8080/v1/AUTH_9b508c0ebfb144b596034b3c99cbfcad?format=json&marker=myfile -X GET -H "X-Auth-Token: 3161ab12fd4545888e0c42365480e310"
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: [('content-length', '2'), ('accept-ranges', 'bytes'), ('server', 'Apache/2.4.7 (Ubuntu)'), ('x-timestamp', '1406848229.54726'), ('x-trans-id', 'txd1d511e7f45648338a4a8-0053dc1cca'), ('date', 'Fri, 01 Aug 2014 23:03:38 GMT'), ('x-account-bytes-used', '182'), ('x-account-container-count', '1'), ('content-type', 'application/json; charset=utf-8'), ('x-account-object-count', '1')]
DEBUG:swiftclient:RESP BODY: []
lista atual é retornada. Não tenho certeza se os dois estão relacionados, mas parecem plausíveis.
Gostaria de receber ajuda.