-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuracao.txt
247 lines (178 loc) · 9.29 KB
/
configuracao.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Fonte:
https://minio.io/
https://docs.minio.io/
https://docs.minio.io/docs/minio-client-complete-guide
https://github.com/minio/minio
https://minio.io/docker.html
https://docs.minio.io/docs/minio-docker-quickstart-guide
https://github.com/minio/minio-java
https://blog.alexellis.io/meet-minio/
------------------------
--- Primeiro exemplo ---
com * Minio Client "mc"
------------------------
$ docker run --rm -p 9000:9000 --name minio1 -v /mnt/data:/data -v /mnt/config:/root/.minio minio/minio server /data
Created minio configuration file successfully at /root/.minio
Endpoint: http://172.17.0.2:9000 http://127.0.0.1:9000
AccessKey: 2INY1VVHTR6S20NWLHAO
SecretKey: L/Gln1zJEw090OAqbzfcBDDFXkepYI9wgZGobGfY
Browser Access:
http://172.17.0.2:9000 http://127.0.0.1:9000
Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
$ mc config host add myminio http://172.17.0.2:9000 2INY1VVHTR6S20NWLHAO L/Gln1zJEw090OAqbzfcBDDFXkepYI9wgZGobGfY
Object API (Amazon S3 compatible):
Go: https://docs.minio.io/docs/golang-client-quickstart-guide
Java: https://docs.minio.io/docs/java-client-quickstart-guide
Python: https://docs.minio.io/docs/python-client-quickstart-guide
JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
.NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide
Drive Capacity: 21 GiB Free, 35 GiB Total
...
==> http://127.0.0.1:9000/minio/default/
...
$ cd /home/02963357460/estudo.git/ceph
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -it minio/mc ls
Obs.:
1) Conteúdo de "config.json":
{
"version": "8",
"hosts": {
"local": {
"url": "http://172.17.0.2:9000",
"accessKey": "2INY1VVHTR6S20NWLHAO",
"secretKey": "L/Gln1zJEw090OAqbzfcBDDFXkepYI9wgZGobGfY",
"api": "S3v4"
}
}
}
2) Obtendo o ip:
$ docker exec -it minio1 sh
/ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
59: eth0@if60: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.2/16 scope global eth0
valid_lft forever preferred_lft forever
/ #
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -it minio/mc ls local
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -it minio/mc mb sinter-default/input local
ou
# $ docker run --rm -v $PWD/config.json:/root/.mc/config.json -it minio/mc mb local/sinter-default/input
# Copiando arquivos para o bucket e pasta:
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -v $PWD/teste.txt:/tmp/teste.txt -it minio/mc cp /tmp/teste.txt local/sinter-default/input/teste.txt
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -v $PWD/2017092700001.zip:/tmp/2017092700001.zip -it minio/mc cp /tmp/2017092700001.zip local/sinter-default/input/2017092700001.zip
$ docker run --rm -v $PWD/config.json:/root/.mc/config.json -it minio/mc ls local/sinter-default/input
==> http://127.0.0.1:9000/minio/sinter-default/input/
Obs.: outros comandos:
$ docker run minio/mc config host add myminio http://172.17.0.2:9000 2INY1VVHTR6S20NWLHAO L/Gln1zJEw090OAqbzfcBDDFXkepYI9wgZGobGfY
$ docker run minio/mc ls
ou
$ docker run -it --entrypoint=/bin/sh minio/mc
> Commands:
ls List files and folders.
mb Make a bucket or a folder.
cat Display file and object contents.
pipe Redirect STDIN to an object or file or STDOUT.
share Generate URL for sharing.
cp Copy files and objects.
mirror Mirror buckets and folders.
find Finds files which match the given set of parameters.
diff List objects with size difference or missing between two folders or buckets.
rm Remove files and objects.
events Manage object notifications.
watch Watch for file and object events.
policy Manage anonymous access to objects.
session Manage saved sessions for cp command.
config Manage mc configuration file.
update Check for a new software update.
version Print version info.
----------------------------------------------------------------
--- Minio Custom Access and Secret Keys using Docker secrets ---
----------------------------------------------------------------
$ echo "AKIAIOSFODNN7EXAMPLE" | docker secret create access_key -
$ echo "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | docker secret create secret_key -
$ docker service create --name="minio-service" --secret="access_key" --secret="secret_key" minio/minio server /data
+++++++++++++++++++
=== rodar minio ===
+++++++++++++++++++
$ docker run --rm --interactive --tty -p 9000:9000 --name minio1 -v minio:/data -e MINIO_ACCESS_KEY=clenubio -e MINIO_SECRET_KEY=clenubio minio/minio server /data
Unable to find image 'minio/minio:latest' locally
latest: Pulling from minio/minio
88286f41530e: Already exists
0bfd6b415849: Pull complete
ca9faf3a7870: Pull complete
Digest: sha256:bae7b91a56b1590730c853d5ae24aadea22c37f66ee3792b5b18c204aff25ce0
Status: Downloaded newer image for minio/minio:latest
Created minio configuration file successfully at /root/.minio
Endpoint: http://172.17.0.2:9000 http://127.0.0.1:9000
AccessKey: clenubio
SecretKey: clenubio
Browser Access:
http://172.17.0.2:9000 http://127.0.0.1:9000
Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
$ mc config host add myminio http://172.17.0.2:9000 clenubio clenubio
Object API (Amazon S3 compatible):
Go: https://docs.minio.io/docs/golang-client-quickstart-guide
Java: https://docs.minio.io/docs/java-client-quickstart-guide
Python: https://docs.minio.io/docs/python-client-quickstart-guide
JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
.NET: https://docs.minio.io/docs/dotnet-client-quickstart-guide
Drive Capacity: 21 GiB Free, 35 GiB Total
ERRO[0524] Received non-HTTP message from new connection 172.17.0.1:51040 at server 172.17.0.2:9000 cause=junk message source=[listener.go:205:github.com/minio/minio/pkg/http.(*httpListener).start.func2()]
ERRO[0524] Received non-HTTP message from new connection 172.17.0.1:51044 at server 172.17.0.2:9000 cause=junk message source=[listener.go:205:github.com/minio/minio/pkg/http.(*httpListener).start.func2()]
ERRO[0524] Received non-HTTP message from new connection 172.17.0.1:51048 at server 172.17.0.2:9000 cause=junk message source=[listener.go:205:github.com/minio/minio/pkg/http.(*httpListener).start.func2()]
ERRO[0524] Received non-HTTP message from new connection 172.17.0.1:51052 at server 172.17.0.2:9000 cause=junk message source=[listener.go:205:github.com/minio/minio/pkg/http.(*httpListener).start.func2()]
===>: http://127.0.0.1:9000/minio
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++x
x=== inserir arquivo no ceph "minio" (via Verticle do Sinter) ===x
x++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02963357460@serpro-1455337:~$ mkdir cephtest
02963357460@serpro-1455337:~$ cd !$
cd cephtest
02963357460@serpro-1455337:~/cephtest$ ls
02963357460@serpro-1455337:~/cephtest$ touch abc
02963357460@serpro-1455337:~/cephtest$
02963357460@serpro-1455337:~/cephtest$ ls
abc
02963357460@serpro-1455337:~/cephtest$ curl -i -X POST -H 'Content-Type: multipart/form-data' -F "data=@abc" http://localhost:9595/ws/receive
HTTP/1.1 500 Internal Server Error
Content-Length: 21
Internal Server Error02963357460@serpro-1455337:~/cephtest$
02963357460@serpro-1455337:~/cephtest$ curl -i -X POST -H 'Content-Type: multipart/form-data' -F "data=@abc" http://localhost:9595/ws/receive
HTTP/1.1 500 Internal Server Error
Content-Length: 21
Internal Server Error02963357460@serpro-1455337:~/cephtest$
++++++++++++++++++++++++
=== Estudo no Sinter ===
++++++++++++++++++++++++
0) git/sinter-project/sinter-rest/sinter-rest-ceph/build.gradle
1) br.gov.serpro.supde.derce.sinter.rest.gw.ReceberLoteRTDGw.java
1.1) br.gov.serpro.supde.derce.sinter.config.IConfigRetriever
2) br.gov.serpro.supde.derce.sinter.rest.handlers.FileUploadHandler.java
3) br.gov.serpro.supde.derce.sinter.ceph.SinterCephRawOperations.java
4) git/sinter-project/sinter-rest/sinter-rest-ceph/src/main/resources/config.yaml
Obs.:
==> https://github.com/minio/minio-java/blob/master/examples/GetObject.java
YYYYYYYYYYYYYYYYYYYYYYYYYYYY
++ minio com SSL ++++
YYYYYYYYYYYYYYYYYYYYYYYYYYYY
(13:36:31) tadeu: Rodar o minio com certificado SSL
$ mkdir certs_minio
# cria chave privada:
$ openssl genrsa -out certs_minio/private.key 2048
# cria chave publica:
$ openssl req -new -x509 -days 3650 -key certs_minio/private.key -out certs_minio/public.crt -subj "/C=BR/ST=Pernambuco/L=Recife/O=SERPRO/CN=localhost"
$ docker run -d --rm --interactive --tty -v minio:/data -v $PWD/certs_minio:/root/.minio/certs -e "MINIO_ACCESS_KEY=XXXXX" -e "MINIO_SECRET_KEY=XXXXX" -p 9000:9000 minio/minio server /data
Obs.:
(13:37:12) tadeu: endereço do servidor fica
https://localhost:9000
http://127.0.0.1:9000
http://127.0.0.1:9000/minio/default/
xxxxxxxxxxxxxx
xxx Outros xxx
xxxxxxxxxxxxxx