0%

npm install -g n --registry=https://registry.npm.taobao.org
/usr/local/node-v8.9.4-linux-x64/lib/node_modules/n/bin/n stable
/usr/local/node-v8.9.4-linux-x64/lib/node_modules/n/bin/n 8.10.0

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such fi
如果目前处在这个目录中间/tmp/boss/build/git@repo.we.com/release/t8t-fi-frt.1561119168/sc,执行删除自身的命令,就会无处依托,报这个错
commands.getstatusoutput('rm -rf /tmp/boss/build/git@repo.we.com/release/t8t-fi-frt.1561119168/sc')

执行不到java, mvn ,虽然 /etc/profile输出了java, mvn 的目录

commands.getstatusoutput('cd xxx')
commands.getstatusoutput('rm * -rf')
删除的不是xxx目录下的文件,而是当前目录下的,切换目录要用  os.chdir()

下载
yum groupinstall "Development Tools"
yum install ncurses*
yum install libpcap-devel.x86_64 libpcap.x86_64

wget -c https://github.com/raboof/nethogs/archive/v0.8.5.tar.gz
tar zxvf v0.8.5.tar.gz
cd nethogs-0.8.5/
make && make install
nethogs

删除索引
curl -XDELETE 192.168.1.95:9200/*2020.06*,*2020.07*,*2020.08*


{
  "query": {
    "bool": {
      "must": {
        "match": {
          "spaceStr.raw": {
            "query": "家居住宅",
            "type": "phrase"
          }
        }
      }
    }
  }
}

ES学习

这个是 测试环境的
host  :  192.168.1.36:9200
index  :  search_test_v171120
type  :  xiaoguotu


host : 192.168.1.152:9200
index : search_v20160420
type  :  xiaoguotu

http://192.168.1.36:9200/_plugin/kopf/   #弃用

http://192.168.2.57:9200/_plugin/kopf/
http://192.168.1.152:9200/_plugin/kopf/#/!/cluster

1.相关概念
http://wiki.we.com:8090/pages/viewpage.action?pageId=38502846

index 数据库
type 表

2.restful接口来操作
http://192.168.2.57:9200/_plugin/kopf/

http://192.168.2.57:9200/ipic_test20180402/categories/_search
{
    "query": {
        "term": {
            "uid": "6282"
        }
    },
    "sort": {
        "_script": {
            "script": "doc['hits'].value - 4 * doc['puttime'].value",
            "type": "number",
            "order": "desc"
        }
    }
}


show mappings 查看字段

先curl通了再改Java代码
开调试模式,看 querybuilder里的值符不符合语法

3.开发环境没数据,上测试就可以了

4.如何新增表

5.运行elasticsearch
打开命令行,进入D:\soft\elasticsearch-6.5.3\bin
运行 elasticsearch
6.新增index

7.term
{
    "query": {
        "term": {
            "proj": {
                "value": "t8t-mid-wom",
                "boost": 1.0
            }
        }
    }
}
8.多个字段
{
    "query": {
        "constant_score": {
            "filter": {
                "bool": {
                    "must": [
                        {
                            "term": {
                                "added_by": "1000"
                            }
                        },
                        {
                            "term": {
                                "ca_ispass": 1
                            }
                        }
                    ]
                }
            }
        }
    }
}
9.多个值terms
{
    "query": {
        "constant_score": {
            "filter": {
                "terms": {
                    "added_by": [
                        1000,
                        6282
                    ]
                }
            }
        }
    }
}
10.范围
{
    "query": {
        "range": {
            "case_num": {
                "gte": 1,
                "lte": 20
            }
        }
    }
}
11.排序
{
    "from":0,
    "sort": [
        {
            "feed_scores": {
                "order": "desc",
                "unmapped_type": "long"
            }
        }
    ],
    "size":1000
}
12.更新
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/_updating_documents.html

13.获取mappings
http://test.es.search.com:9200/shejiben_ipic_dev/_mapping?pretty

14.should里面嵌套must,要用bool
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "city": "深圳"
          }
        },
        {
          "range": {
            "user_score": {
              "from": 1,
              "to": null,
              "include_lower": true,
              "include_upper": false
            }
          }
        }
      ],
      "should": [
        {
          "terms": {
            "goodlevel": [
              2,
              4,
              5
            ]
          }
        },
        {
          "bool": {
            "must": [
              {
                "term": {
                  "apply_status": 4
                }
              },
              {
                "range": {
                  "case_num": {
                    "from": 1,
                    "to": null,
                    "include_lower": true,
                    "include_upper": false
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}



15. 

1、改这个文件
vendor/composer/autoload_psr4.php
    'gb_php\\' => array($baseDir . '/gb_php'),
2、执行命令
composer dump-autoload -o


rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm

yum install mysql-community-client mysql-community-devel mysql-community-server php-mysql

systemctl start mysqld

/usr/bin/mysqladmin -u root password 'admin'

https://windows.php.net/downloads/pecl/releases/

sudo kill -INT `cat /usr/local/php-7.1.7/var/run/php-fpm.pid`

sudo /usr/local/php-7.1.7/sbin/php-fpm -c /usr/local/php-7.1.7/etc/php.ini -y /usr/local/php-7.1.7/etc/php-fpm.conf -D

/usr/local/php/sbin/php-fpm --fpm-config /usr/local/php/etc/php-fpm.conf

1.下载一个php包
https://php.net/releases/
2.解压
tar zxvf php-7.1.21.tar.gz 
3.安装依赖
yum install gcc gcc-c++ wget make libxml2 libxml2-devel openssl openssl-devel curl curl-devel libjpeg-devel freetype-devel bison autoconf libmcrypt libmcrypt-devel gd gd-devel mhash mhash-devel mcrypt
4.编译安装
cd php-7.1.21
./configure 
make
make install
php -v