±à¼£ºrichie
2023-12-10 04:41:10
ÍØÆÕ¿µESÊÇÒ»¿î¹¦ÄÜÇ¿´ó¡¢Áé»î¶àÑùµÄÆóÒµ¼¶¹ÜÀíϵͳ¡£È»¶ø£¬ÓÉÓÚÆäÇ¿´óµÄ¹¦Äܺ͸´ÔÓµÄÅäÖÃÑ¡ÏÓÐʱ»á³öÏÖÓû§ÔÚʹÓùý³ÌÖÐÓöµ½ÏµÍ³²»Æ½ºâµÄÇé¿ö¡£±¾ÎĽ«Ïêϸ½éÉÜһЩµ÷ƽµÄ¼¼ÇÉ£¬°ïÖúÄúÓÅ»¯ÍØÆÕ¿µESϵͳµÄÐÔÄÜ¡£
Òªµ÷ƽÍØÆÕ¿µESϵͳ£¬Ê×ÏÈÒªÁ˽âϵͳµÄµ±Ç°¸ºÔØÇé¿ö¡£¿ÉÒÔͨ¹ýÒÔÏ·½Ê½²é¿´£º
ÔÚÍØÆÕ¿µES·þÎñÆ÷ÉÏ´ò¿ªÃüÁîÐÐÖնˣ¬²¢ÊäÈëÒÔÏÂÃüÁ
$ top¸ÃÃüÁÏÔʾϵͳµÄʵʱ¸ºÔØÇé¿ö£¬°üÀ¨CPUʹÓÃÂÊ¡¢ÄÚ´æʹÓÃÂʵȡ£
ÍØÆÕ¿µESϵͳ×Ô´øÁËKibana¼à¿Ø¹¤¾ß£¬¿ÉÒÔͨ¹ýKibana²é¿´ÏµÍ³µÄ¸ºÔØÇé¿ö¡£´ò¿ªä¯ÀÀÆ÷£¬ÊäÈëÍØÆÕ¿µES·þÎñÆ÷µÄIPµØÖ·£¬È»ºóÔÚµØÖ·À¸ºóÃæ¼ÓÉÏ/app/kibana
£¬Èçapp/kibana
£¬È»ºó°´»Ø³µ¼ü¡£ÔÚKibanaµÄ½çÃæÉÏ£¬Ñ¡Ôñ¡°¼à¿Ø¡±Ñ¡Ï¿ÉÒԲ鿴ϵͳµÄ¸ºÔØÇé¿öÒÔ¼°ÆäËûÐÔÄÜÖ¸±ê¡£
ÍØÆÕ¿µESϵͳÔÚÔËÐйý³ÌÖлáÏûºÄ´óÁ¿µÄÄÚ´æ¡£Èç¹ûϵͳÄÚ´æ²»×㣬»áµ¼ÖÂϵͳÐÔÄÜϽµ»ò±ÀÀ£¡£Òò´Ë£¬ºÏÀíÅäÖÃϵͳµÄÄÚ´æÊǵ÷ƽÍØÆÕ¿µESϵͳµÄ¹Ø¼ü¡£
ÍØÆÕ¿µESϵͳĬÈÏ»áΪJavaÐéÄâ»ú·ÖÅä1GBµÄ¶ÑÄÚ´æ¡£ÔÚ´ó¶àÊýÇé¿öÏ£¬ÕâÊDz»¹»µÄ¡£ÎÒÃǽ¨Ò齫¶ÑÄÚ´æµÄ´óСÉèÖÃΪÎïÀíÄÚ´æµÄÒ»°ë£¬µ«²»³¬¹ý32GB¡£Äú¿ÉÒÔͨ¹ý±à¼jvm.options
ÎļþÀ´ÉèÖöÑÄÚ´æ´óС¡£ÕÒµ½ÒÔÏÂÐУº
-Xms1g -Xmx1g
½«ÆäÐÞ¸ÄΪ£º
-Xms8g -Xmx8g
Õ⽫ΪJavaÐéÄâ»ú·ÖÅä8GBµÄ¶ÑÄÚ´æ¡£
ÍØÆÕ¿µESϵͳÓкܶà²å¼þ£¬Èç¹û²»ÐèҪijЩ²å¼þ£¬¿ÉÒÔͨ¹ý±à¼elasticsearch.yml
ÎļþÀ´¹Ø±ÕËüÃÇ¡£ÕÒµ½ÒÔÏÂÐУº
# ÆôÓÃX-Pack²å¼þ #xpack.security.enabled: true
½«Æä×¢Ê͵ô£¬¼´ÐÞ¸ÄΪ£º
# ÆôÓÃX-Pack²å¼þ #xpack.security.enabled: false
Õ⽫¹Ø±ÕX-Pack²å¼þ£¬½ÚʡϵͳÄÚ´æ¡£
Èç¹ûÍØÆÕ¿µESϵͳ¸ºÔعýÖØ£¬¿ÉÒÔͨ¹ýÔö¼Ó½ÚµãÀ´·ÖÉ¢¸ºÔØ£¬ÌáÉýϵͳÐÔÄÜ¡£
ÍØÆÕ¿µESϵͳĬÈÏÇé¿öÏÂÖ»ÓÐÒ»¸öÊý¾Ý½Úµã£¬Èç¹ûÊý¾ÝÁ¿ºÜ´ó£¬¿ÉÒÔͨ¹ýÌí¼Ó¸ü¶àµÄÊý¾Ý½ÚµãÀ´ÌáÉýÊý¾Ý´¦ÀíÄÜÁ¦¡£±à¼elasticsearch.yml
Îļþ£¬ÕÒµ½ÒÔÏÂÐУº
# ½ÚµãÃû³Æ #node.name: node-1
¸´ÖÆÕâÐв¢ÐÞ¸ÄÃû³ÆΪnode-2
£¬È»ºóÈ¡Ïû×¢ÊÍ£º
# ½ÚµãÃû³Æ node.name: node-2
Öظ´ÒÔÉϲ½Ö裬¿ÉÒÔÌí¼Ó¸ü¶àµÄÊý¾Ý½Úµã¡£
Èç¹ûÓдóÁ¿µÄ¿Í»§¶ËÇëÇó£¬ÎªÁ˼õÇáÊý¾Ý½ÚµãµÄ¸ºÔØ£¬¿ÉÒÔÌí¼Ó¿Í»§¶Ë½Úµã¡£±à¼elasticsearch.yml
Îļþ£¬ÕÒµ½ÒÔÏÂÐУº
# ½ÚµãÃû³Æ #node.name: node-1
¸´ÖÆÕâÐв¢ÐÞ¸ÄÃû³ÆΪnode-3
£¬È»ºóÈ¡Ïû×¢ÊÍ£º
# ½ÚµãÃû³Æ node.name: node-3
ͨ¹ýÌí¼Ó¸ü¶àµÄ¿Í»§¶Ë½Úµã£¬¿ÉÒÔÌá¸ßϵͳµÄ²¢·¢´¦ÀíÄÜÁ¦¡£
ÍØÆÕ¿µESϵͳµÄºËÐŦÄÜÖ®Ò»¾ÍÊÇÇ¿´óµÄËÑË÷ÄÜÁ¦¡£ÒÔÏÂÊÇһЩÓÅ»¯ËÑË÷ÐÔÄܵļ¼ÇÉ£º
ÔÚ´´½¨Ë÷Òýʱ£¬¿ÉÒÔͨ¹ýÖ¸¶¨·ÖƬºÍ¸±±¾ÊýÁ¿À´Ìá¸ßËÑË÷ÐÔÄÜ¡£ÀýÈ磺
PUT /my_index { "settings": { "number_of_shards": 5, "number_of_replicas": 1 } }
ÉÏÊö´úÂë±íʾ½«my_index
Ë÷Òý»®·ÖΪ5¸ö·ÖƬ£¬Ã¿¸ö·ÖƬÓÐÒ»¸ö¸±±¾¡£
¹ýÂËÆ÷ÊÇÒ»ÖÖÓÃÓÚÔÚËÑË÷¹ý³ÌÖÐÅųý²»Æ¥ÅäµÄÎĵµµÄ¼¼Êõ¡£Í¨¹ýʹÓùýÂËÆ÷£¬¿ÉÒÔÏÔÖøÌá¸ßËÑË÷ÐÔÄÜ¡£ÀýÈ磺
GET /my_index/_search { "query": { "bool": { "must": { "match": { "title": "¹Ø¼ü´Ê" } }, "filter": { "term": { "category": "Àà±ð" } } } } }
ÉÏÊö´úÂëÖУ¬¹ýÂËÆ÷term
ÓÃÓÚ¹ýÂËÖ¸¶¨Àà±ðµÄÎĵµ¡£
¾ÛºÏÊÇÒ»ÖÖÓÃÓÚͳ¼Æ¡¢·ÖÎöÊý¾ÝµÄ¼¼Êõ¡£Í¨¹ýʹÓþۺϣ¬¿ÉÒÔ»ñÈ¡¸üÏêϸµÄÊý¾ÝÐÅÏ¢£¬²¢Ìá¸ßËÑË÷ÐÔÄÜ¡£ÀýÈ磺
GET /my_index/_search { "aggs": { "avg_price": { "avg": { "field": "price" } } } }
ÉÏÊö´úÂëÖУ¬¾ÛºÏavg
ÓÃÓÚ¼ÆËãprice
×ֶεÄƽ¾ùÖµ¡£
ͨ¹ýºÏÀíµ÷ÕûÍØÆÕ¿µESϵͳµÄÅäÖ㬿ÉÒÔÌá¸ßϵͳµÄÐÔÄܺÍÎȶ¨ÐÔ¡£±¾ÎĽéÉÜÁ˲鿴ϵͳ¸ºÔØ¡¢µ÷ÕûÄÚ´æÅäÖá¢Ôö¼Ó½ÚµãºÍÓÅ»¯ËÑË÷ÐÔÄܵȼ¼ÇÉ¡£Ï£ÍûÕâЩ¼¼ÇɶÔÄúÓÅ»¯ÍØÆÕ¿µESϵͳÓÐËù°ïÖú¡£
¿Õ°×Ò·þ∵À³¿¨ÃÞ∵º¬ÃÞÁ¿97%£¬¼ÓÈë3%À³¿¨¡£âˆµ220G,32Ö§¾«...
2023-12-10 01:27:42Ñ¡Ôñ¹ú²úRTKµÄ»°£¬»ª²âÒÇÆ÷ÔõôÑù£¿
2023-12-09 22:56:13¾«Æ·Ñ§Ï°Íø(51edu.com)ÔÚ½¨Éè¹ý³ÌÖÐÒýÓÃÁË»¥ÁªÍøÉϵÄһЩÐÅÏ¢×ÊÔ´²¢¶ÔÓÐÃ÷È·À´Ô´µÄÐÅÏ¢×¢Ã÷Á˳ö´¦£¬°æȨ¹éÔ×÷Õß¼°ÔÍøÕ¾ËùÓУ¬Èç¹ûÄú¶Ô±¾Õ¾ÐÅÏ¢×ÊÔ´°æȨµÄ¹éÊôÎÊÌâ´æÓÐÒìÒ飬ÇëÄúÖÂÐÅqinquan#51edu.com(½«#»»³É@)£¬ÎÒÃÇ»áÁ¢¼´×ö³ö´ð¸´²¢¼°Ê±½â¾ö¡£Èç¹ûÄúÈÏΪ±¾Õ¾ÓÐÇÖ·¸ÄúȨÒæµÄÐÐΪ£¬Çë֪ͨÎÒÃÇ£¬ÎÒÃÇÒ»¶¨¸ù¾Ýʵ¼ÊÇé¿ö¼°Ê±´¦Àí¡£