<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    paulwong

    #

    15 個用于布局和 UI 增強的 jQuery 插件

    有非常非常多的 jQuery 插件,這些插件可以簡化你的 Web 應用開發。今天我們向你推薦 15 個用于布局和 UI 增強的 jQuery 插件。

    Superscrollorama

    jQuery File Upload Demo

    jQuery Knob

    jQuery Complexify

    rcarousel

    turn.js

    jQuery HiddenPosition

    Fancy Input

    pickadate.js

    Cool Kitten

    stellar.js

    windows

    Infinite Scrolling

    Autobrowse jQuery Infinite scrolling plugin using Ajax

    jScrollPane

    posted @ 2014-11-07 08:48 paulwong 閱讀(339) | 評論 (0)編輯 收藏

    軟件架構師應具備的十大特點

    如果有人問你,作為一個軟件架構師需要哪些特質的話,你會怎么回答?從技術層面上講,架構師的技術要求是首位的。除此之外在做人處事方面,更有魅力的架構師則更受歡迎。 
    最近有個同事問我,是什么成就了一個架構師。下文就是我的回答,適用于各個技術領域。其中我故意不考慮企業架構相關的問題。 

     

    1、了解相關領域的技術知識 

    在你想要成為架構師的相關技術領域,必須具備扎實的專業知識和過人的本領。 

    2、超強的分析、設計能力 

    不管怎樣,具備很強的分析和設計能力都是必殺技。另外就是能夠運用設計模式方式解決各種各樣的問題。 

    3、編碼與驗證性測試(POC) 

    熟悉該組織整個技術棧,并能使用各層的技術熟練地編碼。 
    能快速實現驗證性測試。 

    4、架構設計的實力 

    能為原始需求提供架構方案。 
    考慮周全:工具和框架的采用、安全性、性能和擴展性、依賴關系、集成、效益。 
    熟悉軟件開發生命周期(SDLC):需求、分析、設計、測試、打包、部署。 

    5、建模語言或工具 

    能使用不同的建模語言或工具,向其他架構師、開發者、項目經理等人,闡述架構。 

    6、架構框架 

    能證明架構的可行性,包括其業務、應用、數據、基礎設置方面。 
    了解TOGAF和ZACHMAN框架就更好了。 

    7、溝通能力 

    能與開發人員、測試人員、商業分析師、上級經理溝通無阻,無論在口頭上和書面上。 

    8、布道 

    能講解該行業的市場、技術知識。 
    能為全隊提供培訓課程。 

    9、銷售、甚至售前 

    能參與售前工作(尤其對于軟件服務業):制定技術方案、使用各種預算工具估計方案的規模和成本、與銷售對象互動。 

    10、演講技巧 

    優秀的演講技巧,有助于以下活動:華麗的計劃書和技術文檔、PPT演講、布道。

    posted @ 2014-11-05 12:55 paulwong 閱讀(332) | 評論 (0)編輯 收藏

    解壓ZIP文件

    在pom.xml中加入JAR包
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
    </dependency>

    ZipUtil.java
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.nio.charset.Charset;
    import java.util.UUID;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;

    import org.apache.commons.io.IOUtils;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;

    public class ZipUtil {
        
        private static Logger logger = LoggerFactory.getLogger(ZipUtil.class);
        
        public static void extractFolder(InputStream inputStream, String outputFolder) throws IOException 
        {
            ZipInputStream zis = null;
            try {

                Charset GBK = Charset.forName("GBK");
                zis = new ZipInputStream(inputStream, GBK);
                ZipEntry entry;

                while ((entry = zis.getNextEntry()) != null) {

                    // Create a file on HDD in the destinationPath directory
                    
    // destinationPath is a "root" folder, where you want to extract your ZIP file
                    String encoding = System.getProperty("file.encoding");
                    logger.info("encoding:"+encoding); 
                    
                    String fileName = new String(entry.getName().getBytes("GBK"), encoding);
                    File entryFile = new File(outputFolder, fileName);
    //                File entryFile = new File(outputFolder, entry.getName());
                    if (entry.isDirectory()) {

                        if (entryFile.exists()) {
                            logger.warn("Directory {0} already exists!", entryFile);
                        } else {
                            entryFile.mkdirs();
                        }

                    } else {

                        // Make sure all folders exists (they should, but the safer, the better ;-))
                        if (entryFile.getParentFile() != null && !entryFile.getParentFile().exists()) {
                            entryFile.getParentFile().mkdirs();
                        }

                        // Create file on disk
                        if (!entryFile.exists()) {
                            entryFile.createNewFile();
                        }

                        // and rewrite data from stream
                        OutputStream os = null;
                        try {
                            os = new FileOutputStream(entryFile);
                            IOUtils.copy(zis, os);
                        } finally {
    //                        os.close();
                            IOUtils.closeQuietly(os);
                            zis.closeEntry();
                        }
                    }
                }
            } finally {
                IOUtils.closeQuietly(zis);
            }
        }
        
        public static void main(String [] args) throws IOException
        {
            final String INPUT_ZIP_FILE = "D:TESTING-FILE/ZIP/INPUT/應用.zip";
            String OUTPUT_FOLDER = "D:/TESTING-FILE/ZIP/OUTPUT";
            
            OUTPUT_FOLDER += File.separator + UUID.randomUUID().toString();
            
            InputStream inputStream = new FileInputStream(new File(INPUT_ZIP_FILE));
            
            extractFolder(inputStream, OUTPUT_FOLDER);
            
            /*File file = new File(OUTPUT_FOLDER);
            FileUtil.deleteFolder(file);
    */
        }

    }

    posted @ 2014-10-29 17:34 paulwong 閱讀(362) | 評論 (0)編輯 收藏

    EXCEL轉JAVA BEAN

    pom.xml回入以下包:
            <dependency>
                <groupId>net.sf.jxls</groupId>
                <artifactId>jxls-core</artifactId>
            </dependency>
            <dependency>
                <groupId>net.sf.jxls</groupId>
                <artifactId>jxls-reader</artifactId>
            </dependency>
            <dependency>
                <groupId>net.sf.jxls</groupId>
                <artifactId>jxls-examples</artifactId>
            </dependency>


    轉換的配置文件:
    <workbook>
      <worksheet name="Sheet1">
        <section startRow="0" endRow="0" />
        <loop startRow="1" endRow="1" items="result" var="app" varType="n.app.valueobject.App">
          <section startRow="1" endRow="1">
            <mapping row="1" col="0">app.title</mapping>
            <mapping row="1" col="1">app.categoryId</mapping>
            <mapping row="1" col="2">app.updateContent</mapping>
            <mapping row="1" col="3">app.rank</mapping>
            <mapping row="1" col="4">app.installedQty</mapping>
            <mapping row="1" col="5">app.installedType</mapping>
            <mapping row="1" col="6">app.discuss</mapping>
            <mapping row="1" col="7">app.summary</mapping>
            <mapping row="1" col="8">app.deviceTypes</mapping>
            <mapping row="1" col="9">app.description</mapping>
            <mapping row="1" col="10">app.newFeatures</mapping>
            <mapping row="1" col="11">app.shortRecommend</mapping>
            <mapping row="1" col="12">app.appUrl</mapping>
          </section>
          <loopbreakcondition>
            <rowcheck offset="0">
              <cellcheck offset="0" />
            </rowcheck>
          </loopbreakcondition>
        </loop>
      </worksheet>
    </workbook>



    JAVA代碼:
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;

    import net.sf.jxls.reader.ReaderBuilder;
    import net.sf.jxls.reader.XLSReader;

    import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.xml.sax.SAXException;

    import application.app.valueobject.App;

    public class ExcelUtil<T> {
        
        private static Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
        
        public List<T> parseExcelFileToBeans(InputStream xlsFileInputStream, InputStream jxlsConfigInputStream) throws IOException, SAXException, InvalidFormatException  {
            
            
            List<T> result = new ArrayList<T>();
            Map<String, Object> beans = new HashMap<String, Object>();
            beans.put("result", result);
            InputStream inputStream = null;
            try {
                XLSReader xlsReader = ReaderBuilder.buildFromXML(jxlsConfigInputStream);
                inputStream = new BufferedInputStream(xlsFileInputStream);
                xlsReader.read(inputStream, beans);
            } catch (IOException e) {
                logger.error(e.getMessage(), e);
                throw e;
            } catch (SAXException e) {
                logger.error(e.getMessage(), e);
                throw e;
            } catch (InvalidFormatException e) {
                logger.error(e.getMessage(), e);
                throw e;
            } finally {
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (Exception e) {
                    }
                }
            }
            return result;
        }
        
        public static void main(String[] args) throws Exception {
            
            String path = "D:/DATA/TESTING-FILE/EXCEL";
            
            path = System.getProperty("user.home");
            
            ExcelUtil<App> util = new ExcelUtil<App>();
            String excelFilePath = path + File.separator + "appData.xls";
            
            InputStream configInputStream = 
                    ExcelUtil.class.getResourceAsStream("/excel/template/config/app_config.xml");
            InputStream xlsFileInputStream = new FileInputStream(excelFilePath);
            
            List<App> appList = util.parseExcelFileToBeans(xlsFileInputStream, configInputStream);

            for (App app : appList) {
                System.out.println(app.toString());
            }
            
            /*String [] args2 = {""};
            GroupingSample.main(args2);
    */

        }

    }


    http://www.yihaomen.com/article/java/530.htm

    posted @ 2014-10-29 17:25 paulwong 閱讀(1099) | 評論 (0)編輯 收藏

    springMVC 文件下載

    import java.io.File;  
    import java.io.IOException;  
      
    import org.apache.commons.io.FileUtils;  
    import org.springframework.context.annotation.Scope;  
    import org.springframework.http.HttpHeaders;  
    import org.springframework.http.HttpStatus;  
    import org.springframework.http.MediaType;  
    import org.springframework.http.ResponseEntity;  
    import org.springframework.stereotype.Component;  
    import org.springframework.web.bind.annotation.RequestMapping;  
      
    /** 
     * <一句話功能簡述> 
     * <功能詳細描述> 
     *  
     * 
    @author  Administrator 
     * 
    @version  [版本號, 2014年3月7日] 
     * 
    @see  [相關類/方法] 
     * 
    @since  [產品/模塊版本] 
     
    */  
    @Component  
    @Scope("prototype")   
    @RequestMapping("/downloadFile")  
    public class DownloadAction  
    {  
      
        @RequestMapping("download")    
        public ResponseEntity<byte[]> download() throws IOException {    
            String path="D:\\workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps\\springMVC\\WEB-INF\\upload\\圖片10(定價后).xlsx";  
            File file=new File(path);  
            HttpHeaders headers = new HttpHeaders();    
            String fileName=new String("你好.xlsx".getBytes("UTF-8"),"iso-8859-1");//為了解決中文名稱亂碼問題  
            headers.setContentDispositionFormData("attachment", fileName);   
            headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);   
            return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),    
                                              headers, HttpStatus.CREATED);    
        }    
    }  


    JSP
    <href="./downloadFile/download" >下載</a>  

    posted @ 2014-10-29 17:17 paulwong 閱讀(2627) | 評論 (2)編輯 收藏

    一個使用MOCK的測試REST的基于SPRING的單元測試

    https://github.com/spring-projects/spring-sync-samples/tree/master/spring-rest-todos


    package todos;

    import static org.hamcrest.Matchers.*;
    import static org.mockito.Mockito.*;
    import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
    import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

    import java.util.Arrays;

    import org.junit.Before;
    import org.junit.Ignore;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.mockito.InjectMocks;
    import org.mockito.Mock;
    import org.mockito.Mockito;
    import org.mockito.MockitoAnnotations;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.http.MediaType;
    import org.springframework.test.context.ContextConfiguration;
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    import org.springframework.test.context.web.WebAppConfiguration;
    import org.springframework.test.web.servlet.MockMvc;
    import org.springframework.test.web.servlet.setup.MockMvcBuilders;
    import org.springframework.web.context.WebApplicationContext;

    import com.fasterxml.jackson.databind.ObjectMapper;

    /**
     * 
    @author Roy Clarkson
     
    */
    @RunWith(SpringJUnit4ClassRunner.class)
    @WebAppConfiguration
    @ContextConfiguration(classes = Application.class)
    @Ignore
    public class MainControllerTest {

        @Autowired
        private WebApplicationContext context;

        @Mock
        private TodoRepository repository;

        @InjectMocks
        TodoController mainController;

        private MockMvc mvc;

        @Before
        public void setUp() {
            MockitoAnnotations.initMocks(this);
            mvc = MockMvcBuilders.standaloneSetup(mainController).build();
        }

        @Test
        public void testList() throws Exception {
            final Todo a = new Todo(1L, "a", false);
            final Todo b = new Todo(2L, "b", false);
            final Todo c = new Todo(3L, "c", false);
            when(repository.findAll()).thenReturn(Arrays.asList(a, b, c));

            mvc.perform(get("/todos")
                        .accept(MediaType.APPLICATION_JSON))
                    .andExpect(status().isOk())
                    .andExpect(jsonPath("$", hasSize(3)))
                    .andExpect(jsonPath("$[0].id", is(1)))
                    .andExpect(jsonPath("$[0].description", is("a")))
                    .andExpect(jsonPath("$[0].complete", is(false)))
                    .andExpect(jsonPath("$[1].id", is(2)))
                    .andExpect(jsonPath("$[1].description", is("b")))
                    .andExpect(jsonPath("$[1].complete", is(false)))
                    .andExpect(jsonPath("$[2].id", is(3)))
                    .andExpect(jsonPath("$[2].description", is("c")))
                    .andExpect(jsonPath("$[2].complete", is(false)));

             verify(repository, times(1)).findAll();
             verifyNoMoreInteractions(repository);
        }

        @Ignore
        @Test
        public void testPatch() throws Exception {

        }

        @Test
        public void testCreate() throws Exception {
            final Todo todo = new Todo(1L, "a", false);
            ObjectMapper objectMapper = new ObjectMapper();
            final byte[] bytes = objectMapper.writeValueAsBytes(todo);

            when(repository.save(Mockito.any(Todo.class))).thenReturn(todo);

            mvc.perform(post("/todos")
                        .accept(MediaType.APPLICATION_JSON)
                        .contentType(MediaType.APPLICATION_JSON)
                        .content(bytes))
                    .andExpect(status().isOk())
                    .andExpect(jsonPath("$.id", is(1)))
                    .andExpect(jsonPath("$.description", is("a")))
                    .andExpect(jsonPath("$.complete", is(false)));

            verify(repository, times(1)).save(Mockito.any(Todo.class));
            verifyNoMoreInteractions(repository);
        }

        @Test
        public void testUpdateSameIds() throws Exception {
            final Todo updatedTodo = new Todo(1L, "z", true);
            ObjectMapper objectMapper = new ObjectMapper();
            byte[] bytes = objectMapper.writeValueAsBytes(updatedTodo);

            when(repository.save(Mockito.any(Todo.class))).thenReturn(updatedTodo);

            mvc.perform(put("/todos/{id}", 1L)
                        .contentType(MediaType.APPLICATION_JSON)
                        .content(bytes))
                    .andExpect(status().isNoContent());

            verify(repository, times(0)).delete(1L);
            verify(repository, times(1)).save(Mockito.any(Todo.class));
            verifyNoMoreInteractions(repository);
        }

        @Test
        public void testUpdateDifferentIds() throws Exception {
            final Todo updatedTodo = new Todo(99L, "z", true);
            ObjectMapper objectMapper = new ObjectMapper();
            byte[] bytes = objectMapper.writeValueAsBytes(updatedTodo);

            when(repository.save(Mockito.any(Todo.class))).thenReturn(updatedTodo);

            mvc.perform(put("/todos/{id}", 1L)
                        .contentType(MediaType.APPLICATION_JSON)
                        .content(bytes))
                    .andExpect(status().isNoContent());

            verify(repository, times(1)).delete(1L);
            verify(repository, times(1)).save(Mockito.any(Todo.class));
            verifyNoMoreInteractions(repository);
        }

        @Test
        public void testDelete() throws Exception {
    //        this is how to test a void method with Mockito
    //        doThrow(new IllegalArgumentException()).when(repository).delete(null);

            mvc.perform(delete("/todos/{id}", 1L))
                    .andExpect(status().isNoContent());
        }

    }

    posted @ 2014-10-25 09:42 paulwong 閱讀(3660) | 評論 (1)編輯 收藏

    如何寫好系統用例

    關于系統用例的書籍,太多。不想在這里去解釋什么是系統用例。但為什么要寫系統用例呢,又如何寫好呢?

    寫系統用例是為了更清晰的展示系統的業務場景的功能實現。也是為了給程序員參考的一個圖。同時也是與客戶溝通的橋梁。很多東西,千言萬語,不如一張圖那么直觀。但在很多項目中,用例分析這個過程被忽略而過。

    程序員往往只看到文本的需求,就自己開始做了,對于小項目或許這樣可以,如果是大項目,后期肯定崩潰。

    一個良好的系統用例,用圖形的方式描述了客戶的要求:
    1. 有那些人去參與這個事件。

    2.這些人具體要做什么 (可以理解為調用的方法)

    3.這些人做這個事情,需要什么先決條件 (可以理解為參數,包括權限等等)

    4.這些在做這些事情的時候,需要第三方幫忙嗎?或者需要第三方系統接口嗎?

    5.做完這些事情,應該達到一個什么樣的目的,也就是結果,這個結果會是下一個用例的輸入嗎?

    當你有著人物,事件,參數,輸入,輸出的一張圖 擺在眼前的時候,所有的事情的都清晰了。

    看著這張圖,就可以寫出 相關的接口程序,實現方法等。

    通過大量的系統用例,可以提取出公共的用例,比如權限等。從而抽象出公共的實現方法,才不會導致同一個方法,不同的程序員各自實現了一套。

    以圖書為例子,列表說明一個用例的主要部分,以及要表達清楚的地方。

     

    用例名稱

    bu_借閱圖書

    用例描述

    借閱人通過此用例向系統查詢并提交借書請求

    執行者

    借閱人

    前置條件

    1.     借閱人借閱證件在有效期內

    2.     借閱人沒有逾期未歸還的圖書

    后置條件

    1.     創建借書定單

    2.     更新借閱人借閱記錄

    主過程描述

    1用戶用借閱證提供的帳號登錄系統,計算機顯示我的圖書館界面

    2.用戶選擇查詢圖書,計算機顯示查詢界面

    3.用戶按書名、作者、出版社查詢,計算機顯示查詢結果

    4.用戶可單選或多選書本,并確認借閱。計算機顯示確認借閱圖書清單。

    5.用戶選擇確認借閱,計算機顯示借閱定單及費用

    6用戶選擇提交定單,計算機顯示提交結果和定單號

    7.計算機執行后置條件。用例結束

    分支過程描述

    2.1.1用戶選擇查看原有定單,計算機執行4;

    4.1.1用戶可單選或多選書本,放入借書籃,計算機顯示借書籃現有內容

    4.1.2.1.1用戶選擇繼續借書,計算機執行2

    4.1.2.2.1用戶選擇提交借書籃,計算機執行4

    4.2.1 用戶選擇放棄,計算機執行2

    6.1.1用戶選擇保存定單,計算機保存并執行1

    6.2.1用戶選擇放棄,計算機執行1

    異常過程描述

    1.1.1借閱證已過期,拒絕登錄,用例結束

    1.2.1借閱人有逾期未歸還書本,啟動bu_歸還圖書用例

    5.1.1用戶余額不足,計算機顯示余額和所需金額

    5.1.2.1.1用戶選擇續費,啟動bu_交納借閱費用例

    5.1.2.2.1用戶選擇放棄,計算機執行1

    業務規則

    4.至少選擇一本,至多選擇三本

    涉及的業務實體

    Be_費用記錄

    Be_圖書

    Be_借書籃

    Be_借閱定單

    Be_借閱證

    posted @ 2014-10-24 09:46 paulwong 閱讀(1273) | 評論 (0)編輯 收藏

    軟件開發各種文檔

    現在的軟件開發,越來越多的是文檔的管理了,編寫文檔成了一個很重要的工作,而且維護這些文檔也是一件很繁瑣的工作,個人比較喜歡敏捷開發,代碼即文檔,用比較好的命名規范和簡明扼要的注釋標明代碼用途即可,但這終歸是自己理想中的軟件開發,事實上這么多年做過的很多項目來看,客戶是無論如何都需要文檔的,即使這些文檔或許不會看,但至少會給他們的老板匯報,給上級看,所以很多情況下文檔成了是不是完成工作的標準了。我并不排斥文檔,但中國的外包項目很少有時間去寫文檔,但如果真的有時間,完善這些文檔還是很有好處的。整理了一些軟件開發中常用的模板, 以后自己也可以參考。如果客戶有自己的模板,當然也可以用客戶的模板,下面這些模板都比較具備中國特色,特別適合給上級老板匯報,如果有這方面需求的,可以參考下:

    下載文件 開發進度月報編寫規范.doc

    下載文件 測試分析報告編寫規范.doc

    下載文件 測試計劃文檔編寫規范.doc

    下載文件 概要設計說明書編寫規范.doc

    下載文件 開發進度月報編寫規范.doc件

    下載文件 模塊開發卷宗編寫規范.doc

    下載文件 軟件配置管理計劃編寫規范.doc

    下載文件 軟件需求說明書編寫規范.doc

    下載文件 軟件質量保證計劃編寫規范.doc

    下載文件 數據庫設計說明書編寫規范.doc

    下載文件 數據要求說明書編寫規范.doc

    下載文件 詳細設計說明書編寫規范.doc

    下載文件 項目開發總結報告編寫規范.doc

    下載文件 用戶手冊編寫規范.doc

    以上這些文檔模板應該比較全面了,  在國內的項目開發中完全可以套用,如果是國外的項目或許有些不同,畢竟是不同的文化背景。

    posted @ 2014-10-24 09:44 paulwong 閱讀(346) | 評論 (0)編輯 收藏

    FASTDFS常用命令

    啟動STORAGE SERVER
    fdfs_storaged /etc/fdfs/storage.conf



    啟動TRACKER SERVER
    fdfs_trackerd /etc/fdfs/tracker.conf



    啟動NGINX
    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf


    觀看LOG
    tail -f /home/storage1/fastdfs/logs/storaged.log



    檢查STORAGE SERVER
    fdfs_monitor /etc/fdfs/client.conf


    刪除STORAGE SERVER
    fdfs_monitor /etc/fdfs/client.conf delete group1 10.120.151.114


    重啟
    /usr/local/bin/restart.sh fdfs_storaged /etc/fdfs/storage.conf
    /usr/local/bin/restart.sh fdfs_trackerd /etc/fdfs/storage.conf


    停止
    /usr/local/bin/stop.sh fdfs_storaged /etc/fdfs/storage.conf
    /usr/local/bin/stop.sh fdfs_trackerd /etc/fdfs/storage.conf



    測試上傳
    fdfs_test /etc/fdfs/client.conf upload /usr/include/stdlib.h

     
    查詢文件是否存在
    fdfs_file_info /etc/fdfs/client.conf group1/M00/00/D1/CniXclQ0vdfCNdkzAABGC4v7nb4822.png

    posted @ 2014-10-14 14:23 paulwong 閱讀(2662) | 評論 (0)編輯 收藏

    FASTDFS的STORAGE SERVER的狀態問題

    STORAGE SERVER的狀態通常有七種:
    # FDFS_STORAGE_STATUS:INIT      :初始化,尚未得到同步已有數據的源服務器

    # FDFS_STORAGE_STATUS:WAIT_SYNC :等待同步,已得到同步已有數據的源服務器

    # FDFS_STORAGE_STATUS:SYNCING   :同步中

    # FDFS_STORAGE_STATUS:DELETED   :已刪除,該服務器從本組中摘除

    # FDFS_STORAGE_STATUS:OFFLINE   :離線

    # FDFS_STORAGE_STATUS:ONLINE    :在線,尚不能提供服務

    # FDFS_STORAGE_STATUS:ACTIVE    :在線,可以提供服務


    正常狀態必須是ACTIVE,如果運行以下命令:
    fdfs_monitor /etc/fdfs/client.conf


    發現有以下狀態的服務器:
    Storage 4:
            ip_addr = 10.120.151.114  WAIT_SYNC


    經過各種重啟都不解決問題,只好先刪除,再加入
    #從集群中刪除
    fdfs_monitor /etc/fdfs/client.conf delete group1 10.120.151.114

    #在114服務器中,刪除數據文件夾
    rm -rf /home/storage1/fastdfs/data

    #重啟114節點
    fdfs_storaged /etc/fdfs/storage.conf


    重新查狀態
    fdfs_monitor /etc/fdfs/client.conf


    狀態變正常了。

    posted @ 2014-10-13 17:34 paulwong 閱讀(7907) | 評論 (0)編輯 收藏

    僅列出標題
    共115頁: First 上一頁 43 44 45 46 47 48 49 50 51 下一頁 Last 
    主站蜘蛛池模板: 国产精品无码亚洲精品2021| 亚洲天堂在线播放| av无码久久久久不卡免费网站| 日本一区二区三区免费高清在线 | 大片免费观看92在线视频线视频| 四色在线精品免费观看| 2021国内精品久久久久精免费| 国产精品免费观看视频| 麻豆亚洲AV成人无码久久精品 | 中文字幕在线观看亚洲日韩| 亚洲成色在线影院| 77777亚洲午夜久久多人| 国产成人免费片在线视频观看| 最近免费中文字幕大全视频 | 伊人久久大香线蕉亚洲五月天| 国产片免费福利片永久| 国产一精品一AV一免费孕妇 | 亚洲人成网站色在线入口| 欧洲美熟女乱又伦免费视频| 产传媒61国产免费| 国产亚洲精品免费| 亚洲香蕉免费有线视频| 精品久久久久久久免费加勒比| 亚洲免费福利在线视频| 亚洲精品在线免费观看视频| 日韩中文字幕免费视频| 无码精品国产一区二区三区免费 | 亚洲免费无码在线| 在线观看亚洲天天一三视| 亚洲一级片免费看| 国产亚洲日韩在线三区| 久久亚洲国产成人影院网站 | 免费成人在线视频观看| 中文字幕在线视频免费观看 | 亚洲最大在线观看| 精品亚洲成在人线AV无码| 2017亚洲男人天堂一| 国产亚洲福利在线视频| 亚洲国产精品成人AV在线| 羞羞的视频在线免费观看| 永久免费观看黄网站|