I am developing a Rust application. And I am deploying a Intel NUC with docker. I am using Redis, RabbitMQ, Postgre sql with Rust application successfully on Intel NUC. And I can use Rust and MinIO on local development. But I can not access from rust application to MinIO server. But I can access MinIO GUI on Intel NUC.
How Can I fix that? How Can I proceed?
I got an error that like below:
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value:
error sending request for url (http://127.0.0.1:9000/rust-s3-new/):
error trying to connect: tcp connect error: Connection refused (os error 111)
Caused by:
0: error trying to connect: tcp connect error: Connection refused (os error 111)
1: tcp connect error: Connection refused (os error 111)
2: Connection refused (os error 111)',
part of minIO of docker compose file:
min-io:
image: minio/minio
command: server --console-address ":9001" /data
networks:
- myApp
volumes:
- $HOME/docker/volumes/minio:/data
environment:
- MINIO_ROOT_USER=minio-admin
- MINIO_ROOT_PASSWORD=minio-admin
ports:
- 9000:9000
- 9001:9001
restart: always
Firstly I can a define a bucket path object. there is no error this part:
let bucket = Bucket::new_with_path_style(
"rust-s3-new",
Region::Custom {
region: "".to_owned(),
endpoint: "http://127.0.0.1:9000".to_owned(),
},
Credentials {
access_key: Some("minio-admin".to_owned()),
secret_key: Some("minio-admin".to_owned()),
security_token: None,
session_token: None,
},
)
.unwrap();
After that, while a creating bucket and head object , I got above error, code part:
let (_, code) = bucket.head_object("/").await.unwrap();
println!("create_bucket: {}", code);
if code == 404 {
let create_result = Bucket::create_with_path_style(
bucket.name.as_str(),
bucket.region.clone(),
bucket.credentials.clone(),
BucketConfiguration::default(),
)
.await
.unwrap();
println!(
"=== Bucket created\n{} - {} - {}",
bucket.name, create_result.response_code, create_result.response_text
);
}
I am trying to use rust-s3 library. How Can I fix that? Where is the error? thanks.