运行上面的集群请至少保证docker拥有3g以上,因为Elasticsearch by default deploys with a 1GB heap,开始只使用了2g时就会出现内存不足导致es启动失败,如果是下面几种错误信息可以尝试增加内存
1 2 3 4 5
master not discovered or elected yet, an election requires a node with id 或 master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes 或 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
using System; using ToolGood.Words; namespaceKeywordTest { classProgram { staticvoidMain(string[] args) { var stopwatch = System.Diagnostics.Stopwatch.StartNew(); string post = System.IO.File.ReadAllText(@"D:\Projects\Opensource\ToolGood.Words\csharp\KeywordTest\sample_post");
StringSearch iwords = new StringSearch(); iwords.SetKeywords(spams); stopwatch.Start(); for (var i = 0; i < 500; i++) { var f = iwords.FindFirst(post); }
stopwatch.Stop(); var s = stopwatch.ElapsedMilliseconds; Console.WriteLine("测试用时(ms):" + s); } } }
import clr from System import String from ToolGood.Words import StringSearch stringSearch=StringSearch()
withopen('./sample_post',encoding='utf-8') as f: test_post = f.read() from System.Collections.GenericimportList spam_words=List[String]() withopen('././SpamWordsCN.min.txt',encoding='utf-8') as f: for line in [line.rstrip() for line in f]: spam_words.Add(String(line))
stringSearch.SetKeywords(spam_words) import time start = time.time() times = 500 while times > 0: f = stringSearch.FindFirst(test_post) times -= 1 end = time.time() print('程序运行时间:%s毫秒' % ((end - start) * 1000))
withopen('./sample_post', encoding='utf-8') as f: test_post = f.read() spam_words={} withopen('././SpamWordsCN.min.txt', encoding='utf-8') as f: words=[line.strip() for line in f] for w in words: iflen(w)>0: spam_words[w[0]]=w import time
start = time.time() times = 500 while times > 0: for i,c inenumerate(test_post): if c in spam_words: is_found=True for j,sc inenumerate(spam_words[c]): if sc!=test_post[i+j]: # compare failed is_found=False break # found if is_found: #print('找到了%s'%spam_words[c]) break times -= 1 end = time.time() print('程序运行时间:%s毫秒' % ((end - start) * 1000))
from StringSearch import StringSearch withopen('./sample_post',encoding='utf-8') as f: test_post = f.read() withopen('././SpamWordsCN.min.txt',encoding='utf-8') as f: spam_words = [line.rstrip() for line in f] import time search = StringSearch() search.SetKeywords(spam_words) start = time.time() times = 500 while times > 0:
f = search.FindFirst(test_post) times -= 1 end = time.time() print('程序运行时间:%s毫秒' % ((end - start) * 1000))
我有四万七千张照片,别问我为啥有那么多照片,手机更新了,但是每次都是恢复以前的一切,但是照片庞大到传统的各种导出很无力,特别是使用了icloud也是。这里icloud一定要用微软商店中的版本,老版本就是有个安装包的那个可以点击下载所有文件,问题是不会自动下载最新的,然后下载还容易中断。最新版本会再本地出现一个icloud挂载文件夹,也是windows10最新支持的,出于备份的目的我需要有的不仅仅是镜像而是真正的下载我的拷贝。可以右击资源管理器中的icloud标识选择“Always keep on this device”,他就会自动下载所有文件。
import threading import os, time, threading from tqdm import tqdm from pathlib import Path from multiprocessing import Pool, cpu_count from tqdm.contrib.concurrent import process_map import win32file
if __name__ == '__main__': start_time = time.time() r = process_map(try_open, file_names, max_workers=5) # with Pool(cpu_count()-2) as pool: # pool.map(try_open, files)
nas玩了好多年,现在稳定使用的事赛扬的cpu和六块大硬盘。系统使用的是windows server 2019,为啥没用黑群辉,为啥没用linux。作为母系统来说win绝对是最好的,个人nas经常要解决的就是长期运行、不可间断的,比如百度网盘,长时间跑脚本的数据,这些都要求系统跟pc有很大的兼容,所以应用上win胜出。win server还提供了block级别的重复数据,所以省心的给你节省空间。这块其实专门写个专题都有必要。