mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 07:27:37 +00:00
test global_disks
This commit is contained in:
+14
-8
@@ -69,11 +69,12 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
// 用于rpc
|
||||
let (endpoint_pools, _) = EndpointServerPools::from_volumes(opt.address.clone().as_str(), opt.volumes.clone())?;
|
||||
|
||||
tokio::spawn(async move {
|
||||
// Setup S3 service
|
||||
// 本项目使用s3s库来实现s3服务
|
||||
let service = {
|
||||
// let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new(opt.address.clone(), endpoint_pools).await?);
|
||||
let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new().await?);
|
||||
let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new());
|
||||
//设置AK和SK
|
||||
//其中部份内容从config配置文件中读取
|
||||
let mut access_key = String::from_str(config::DEFAULT_ACCESS_KEY).unwrap();
|
||||
@@ -108,10 +109,8 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
let hyper_service = service.into_shared();
|
||||
|
||||
let http_server = ConnBuilder::new(TokioExecutor::new());
|
||||
let graceful = hyper_util::server::graceful::GracefulShutdown::new();
|
||||
|
||||
let mut ctrl_c = std::pin::pin!(tokio::signal::ctrl_c());
|
||||
|
||||
let graceful = hyper_util::server::graceful::GracefulShutdown::new();
|
||||
info!("server is running at http://{local_addr}");
|
||||
|
||||
loop {
|
||||
@@ -137,10 +136,6 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
});
|
||||
}
|
||||
|
||||
warn!(" init store");
|
||||
// init store
|
||||
ECStore::new(opt.address.clone(), endpoint_pools.clone()).await?;
|
||||
|
||||
tokio::select! {
|
||||
() = graceful.shutdown() => {
|
||||
tracing::debug!("Gracefully shutdown!");
|
||||
@@ -149,6 +144,17 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
tracing::debug!("Waited 10 seconds for graceful shutdown, aborting...");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
warn!(" init store");
|
||||
// init store
|
||||
ECStore::new(opt.address.clone(), endpoint_pools.clone()).await?;
|
||||
|
||||
tokio::select! {
|
||||
_ = tokio::signal::ctrl_c() => {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
info!("server is stopped");
|
||||
Ok(())
|
||||
|
||||
@@ -45,9 +45,9 @@ pub struct FS {
|
||||
}
|
||||
|
||||
impl FS {
|
||||
pub async fn new() -> Result<Self> {
|
||||
pub fn new() -> Self {
|
||||
// let store: ECStore = ECStore::new(address, endpoint_pools).await?;
|
||||
Ok(Self {})
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
#[async_trait::async_trait]
|
||||
|
||||
Reference in New Issue
Block a user