fecmall elasticSearch报错解决:ElasticSearch ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];

elasticSearch · Fecmall · 于 2个月前 发布 · 94 次阅读

elasticSearch使用报错:ElasticSearch ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];

具体的报错log

Exception 'yii\elasticsearch\Exception' with message 'Elasticsearch request failed with code 403. Response body:
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)te (api)];"},"status":403}'

in /www/web/demo/fecbvc/addons/fecmall/fecelastic/yii2-elasticsearch/Connection.php:585

Error Info:
Array
(
    [requestMethod] => POST
    [requestUrl] => http://127.0.0.1:9200/fecshop_product_en/product/1?op_type=create
    [requestBody] => {"m_id":"1","name":"Off-the-Shoulder Long Sleeve High-Low Day Dress","short_description":"","description":"Comp; T-Shirts<br /><br />Material: Rayon,Spandex<br />Clothing Length: Regular<br />Sleeve Length: Short<br />Collar: Skew Collar<bents: 1 x T-Shirt<br /><br /><br />","spu":"kilw","sku":"kilw0001","score":"18","status":"1","is_in_stock":"1","url_key":"/off-the0","special_from":"1471708800","special_to":"1570118400","final_price":"124.00","image":"a:2:{s:7:\"gallery\";a:1:{i:0;a:5:{s:5:\"ls\";s:1:\"1\";s:9:\"is_detail\";s:1:\"1\";}}s:4:\"main\";a:5:{s:5:\"image\";s:20:\"/1/22/12229472_1.jpg\";s:5:\"label\";s:4:\"BLUt":"1471852757","sync_updated_at":1584109696}
    [responseCode] => 403
    [responseHeaders] => Array
        (
            [content-type] => application/json; charset=UTF-8
            [content-length] => 259
        )

    [responseBody] => Array
        (
            [error] => Array
                (
                    [root_cause] => Array
                        (
                            [0] => Array
                                (
                                    [type] => cluster_block_exception
                                    [reason] => blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
                                )

                        )

                    [type] => cluster_block_exception
                    [reason] => blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
                )

            [status] => 403
        )

)

Stack trace:
#0 /www/web/demo/fecbvc/addons/fecmall/fecelastic/yii2-elasticsearch/Connection.php(342): yii\elasticsearch\Connection->httpReques
#1 /www/web/demo/fecbvc/addons/fecmall/fecelastic/yii2-elasticsearch/Command.php(141): yii\elasticsearch\Connection->postInsert(Ar
#2 /www/web/demo/fecbvc/addons/fecmall/fecelastic/yii2-elasticsearch/ActiveRecord.php(446): yii\elasticsearch\Command->insert('fec
#3 /www/web/demo/fecbvc/vendor/yiisoft/yii2/db/BaseActiveRecord.php(678): yii\elasticsearch\ActiveRecord->insert(true, NULL)
#4 /www/web/demo/fecbvc/vendor/fancyecommerce/fecshop/services/helper/AR.php(108): yii\db\BaseActiveRecord->save()
#5 /www/web/demo/fecbvc/addons/fecmall/fecelastic/services/search/ElasticSearch.php(121): fecshop\services\helper\AR->save(Object(
#6 [internal function]: fecelastic\services\search\ElasticSearch->actionSyncProductInfo(Array, 50)
#7 /www/web/demo/fecbvc/vendor/fancyecommerce/fecshop/services/Service.php(54): call_user_func_array(Array, Array)
#8 /www/web/demo/fecbvc/vendor/fancyecommerce/fecshop/services/Search.php(103): fecshop\services\Service->__call('syncProductInfo'
#9 [internal function]: fecshop\services\Search->actionSyncProductInfo(Array, 50)
#10 /www/web/demo/fecbvc/vendor/fancyecommerce/fecshop/services/Service.php(54): call_user_func_array(Array, Array)
#11 /www/web/demo/fecbvc/vendor/fancyecommerce/fecshop/app/console/modules/Product/controllers/SearchController.php(64): fecshop\s
#12 [internal function]: fecshop\app\console\modules\Product\controllers\SearchController->actionSyncdata('1')
#13 /www/web/demo/fecbvc/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#14 /www/web/demo/fecbvc/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#15 /www/web/demo/fecbvc/vendor/yiisoft/yii2/console/Controller.php(164): yii\base\Controller->runAction('syncdata', Array)
#16 /www/web/demo/fecbvc/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('syncdata', Array)
#17 /www/web/demo/fecbvc/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('product/search/...', Array)
#18 /www/web/demo/fecbvc/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('product/search/...'
#19 /www/web/demo/fecbvc/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\
#20 /www/web/demo/fecbvc/yii(53): yii\base\Application->run()
#21 {main}

解决方法

linux命令行执行: curl -XPUT -H "Content-Type: application/json" http://127.0.0.1:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

127.0.0.1:9200换成您自己的ip和端口

共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics