- 发布于4天前
常用命令
gistry.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赞评论浏览 35 - 发布于2022-04-01 15:44:19
docker 容器出现 no route to host 的错误
y=ipv4 source address=172.17.0.0/16 accept' && firewall-cmd --reload赞 2评论浏览 125 - 赞 1评论浏览 112
- 赞评论浏览 125
-
docker-machine 通过命令的方式端口映射到主机
我只能使用192.168.99.100:3000访问我的应用程序来自docker机器的默认IP。 如何将docker-machine 3000端口转发到主机80端口? 目前,Docker Machine是在您计算机中VirtualBox下运行的虚拟机,因此要公开您的应用程序端口,您需要将虚拟机端口映射到您的主机端口。 为此,有两个选择,但是在确保停止运行Docker Machine之前,请执行以下操作: docker-machine stop default # see PS below if docker machine isn't default 选项1-使用VirtualBox界面 打开VirtualBox Manager 选择您的Docker Machine VirtualBox镜像(例如:默认) 打开设置->网络->高级->端口转发 添加您的应用名称,所需的主机端口(例如:80)和您的访客端口(例如:3000) 选项2-使用VirtualBox命令行 只需使用您自己的参数运行以下命令: VBoxManage modifyvm "default" --natpf1 "myapp,tcp,,80,,3000" 最后考虑事项 现在,您可以启动运行的Docker Machine: docker-machine start default eval $(docker-machine env default) 然后只需启动应用程序Docker容器并运行http://localhost/对其进行测试。 附言:您的Docker机器名称可能不是默认,在这种情况下,请相应更改名称。赞评论 2浏览 334