YYDS
发布于

常用命令


http://ftp.de.debian.org/debian/pool/main/  ubuntu 软件包镜像站

npm install -g cnpm --registry=http://registry.npm.taobao.org

ps -ef|grep java|grep -v grep|cut -c 9-15|xargs kill -9

nohup ./product -u 0.0.0.0:1220 >logging.log 2>&1 &
【mysql】
alter user user() identified by "123456";
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
【安装软件包命令】
dpkg -i xxx.deb(ubuntu)
rpm -ivh(centos)

json转对象 收藏下
 List<ConfigItem> list = gson.fromJson(config, new TypeToken<List<ConfigItem>>() {
        }.getType());

		
		
curl -XPOST http://localhost:9501/b2b2c_site_goods/goods/_mapping -d '{"properties": {"goodsName": {"type": "text", "analyzer": "ik_smart", "search_analyzer": "ik_smart"}}}'

curl -H "Content-Type: application/json" -XPUT 'localhost:9501/b2b2c_site_goods/goods/_mapping'  -d '{"goods":{"properties":{"goodsName":{"type":"text","analyzer":"ik_max_word"}}}}'


db.getCollection("test_url").update({},{$set:{'time': NumberInt(ISODate().getTime())}},{'multi':true})


db.createUser( {user: "admin",pwd: "123456",roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]})

groupadd es
useradd es -g es -p es


1、数据备份到文件
neo4j-admin  dump --database=graph.db --to=D:/Neo4j/neo4j-community-3.5.6/data/dump/graph.dump
2、备份的数据文件导入
bin/neo4j-admin load --from=D:/Neo4j/neo4j-community-3.4.9/data/dump/graph.dump --database=graph.db --force

./neo4j-admin load --from=/opt/graph.dump --database=graph.db --force

doucha.com
yiyi
Yi@2345six


nohup ./product -u 0.0.0.0:1220 >logging.log 2>&1 &
启动elasticsearch-head
nohup grunt server &
apt install grunt


【docker 】
启动镜像并映射端口
docker run --privileged -d  --name myiso -it -e "container=docker"  -p 80:80 -p 8081:8081 -p 8088:8088 -p 3306:3306 testimg:latest /bin/bash
进入镜像
docker exec -it myiso  /bin/bash

打包linux镜像
tar --numeric-owner --exclude=/proc --exclude=/sys -cvf centos7-base.tar /
导入镜像到docker
cat centos7-base.tar | docker import - centos7-mini2

导入镜像
 docker load < /root/image.tar  或者 docker load -i /root/image.tar

导出镜像
docker save image > /root/image.tar 
【mysql】
docker run -d  --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
【elasticsearch】

http.cors.enabled: true
http.cors.allow-origin: "*"

在   /etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144

vi /etc/security/limits.conf
# elasticsearch config start
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
# elasticsearch config end

docker run -d --restart=always --name es -p 9200:9200 \
 -p 9300:9300 elasticsearch:6.7.2
docker run -p 9200:9200 -p 9300:9300 --name elasticsearch \
   -e "discovery.type=single-node" \
   -e "cluster.name=elasticsearch" \
   -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
   -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
   -d elasticsearch:7.5.0

http.cors.enabled: true
http.cors.allow-origin: "*"
【elasticsearch-head】
docker run -d  --name elasticsearch-head -it  -p 9100:9100 mobz/elasticsearch-head-vim:latest

[neo4j]
docker run -it -d --name neo4j -p 7474:7474 -p 7687:7687 neo4j:latest
【mongodb】
 docker run -d -it --name mongodb -p 27017:27017 mongo:4.0.19 --bind_ip_all
【redis】
docker run -d --name redis -it -p 6379:6379 redis:4.0.11 --requirepass "123456"


//es改大查询数量
curl -H "Content-Type: application/json" -X PUT 'http://127.0.0.1:9501/index_test/_settings?preserve_existing=true' -d '{"max_result_window" : "100000"}'
searchSourceBuilder.trackTotalHits(true);
//删除查出的数据
_delete_by_query会删除所有query语句匹配上的文档,用法如下:

curl -X POST "localhost:9200/twitter/_delete_by_query" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "match": {
      "name": "测试删除"
    }
  }
}

//创建映射
http://192.168.3.188:9501/index_test/_mapping/    POST 请求
{"properties":{"alias":{"type":"keyword"},"country":{"type":"keyword"},"id":{"type":"keyword"},"label":{"type":"keyword"},"name":{"type":"keyword"}}}


导入elasticsearch备份数据: java -jar job.jar import index_test f:/elasticsearch.json -Dspring.elasticsearch.jest.uris=http://192.168.3.188:9501
java -jar job.jar import index_test D:/dataParse_202009131504/node_baozhangfuzhujianting.json
{"properties":
{
"alias":{"type":"keyword"},
"country":{"type":"keyword"},
"label":{"type":"keyword"},
"name":{"type":"keyword"},
"node_color":{"type":"keyword"}
}}


【nginx】
docker run -d --name nginx -it -v /usr/local/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /usr/local/nginx/conf/fastcgi.conf:/etc/nginx/fastcgi.conf -v /usr/local/nginx/conf/conf.d:/usr/local/nginx/conf/conf.d/ -v /usr/local/nginx/html:/usr/local/nginx/html -v /mnt/cryptdisk/server/tiles:/mnt/cryptdisk/server/tiles  -p 80:80 -p 8081:8081 -p 8082:8082 nginx:1.14.2

开启ipv4转发 虚拟机挂起的问题
vi /etc/sysctl.conf
net.ipv4.ip_forward=1

root
Mxsjw123

【coturn】
sudo docker run -p 3478:3478 -p 3478:3478/udp coturn


打包系统镜像docker
tar -cvpf /allsystem.tar  --directory=/  --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/run  --exclude=/allsystem.tar  /


查找端口的pid
lsof -i:8080|grep "LISTEN"|awk '{print $2}'
查找jar的pid
ps -ef | grep -w xxx.jar | grep -v "grep" | awk '{print $2}'

杀死端口的id
kill -9 $(netstat -nlp | grep :81 | awk '{print $7}' | awk -F"/" '{ print $1 }')


docker-machine create --virtualbox-disk-size "100000" --virtualbox-memory "14000" -d virtualbox default
MACHINE_STORAGE_PATH F:\Docker\.docker
评论