lilishop 容器中的es如何增加内存

为什么要增加es的内存就不废话了,

 

找到容器的配置文件

 

 

 

 

ES_JAVA_OPTS: -Xms4g -Xmx4g

原来是256m还是512m 改成4g。

还有一个非常关键的就是改了配置,必需删除掉原来容器里面的es,然后重新构建。否则如何重启都无效。

在linux环境下,的命令参考如下:

[root@VM-16-4-centos ~]# docker ps

CONTAINER ID   IMAGE                                  COMMAND                  CREATED        STATUS         PORTS                                                                                                               NAMES

754d6bfdb20b   xuxueli/xxl-job-admin:2.3.0            "sh -c 'java -jar $J…"   4 months ago   Up 3 hours                                                                                                                         xxl-job

956e4a70f605   foxiswho/rocketmq:broker-4.7.0         "mqbroker -c /etc/ro…"   4 months ago   Up 3 hours     0.0.0.0:10909->10909/tcp, :::10909->10909/tcp, 9876/tcp, 10912/tcp, 0.0.0.0:10911->10911/tcp, :::10911->10911/tcp   rocket-broker

9dd5f0ccf849   styletang/rocketmq-console-ng:latest   "sh -c 'java $JAVA_O…"   4 months ago   Up 3 hours     0.0.0.0:8180->8180/tcp, :::8180->8180/tcp                                                                           rocket-console

24e49481774f   logstash:7.3.0                         "/usr/local/bin/dock…"   4 months ago   Up 3 hours     5044/tcp, 0.0.0.0:4560->4560/tcp, :::4560->4560/tcp, 9600/tcp                                                       logstash

c8a44d264bf4   foxiswho/rocketmq:server-4.7.0         "/bin/sh -c 'cd ${RO…"   4 months ago   Up 3 hours     10909/tcp, 0.0.0.0:9876->9876/tcp, :::9876->9876/tcp, 10911-10912/tcp                                               rocket-server

0f12b30d3e32   redis:6.2.5                            "docker-entrypoint.s…"   4 months ago   Up 3 hours     0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                           redis

906dab750de1   elasticsearch:7.3.0                    "/usr/local/bin/dock…"   4 months ago   Up 3 seconds   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp                                elasticsearch

ee2655e1bc64   mysql:8.0.28                           "docker-entrypoint.s…"   4 months ago   Up 3 hours     0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                mysql

[root@VM-16-4-centos ~]# docker stop  elasticsearch

elasticsearch

[root@VM-16-4-centos ~]# docker rm  elasticsearch

elasticsearch

[root@VM-16-4-centos ~]# docker ps

CONTAINER ID   IMAGE                                  COMMAND                  CREATED        STATUS       PORTS                                                                                                               NAMES

754d6bfdb20b   xuxueli/xxl-job-admin:2.3.0            "sh -c 'java -jar $J…"   4 months ago   Up 3 hours                                                                                                                       xxl-job

956e4a70f605   foxiswho/rocketmq:broker-4.7.0         "mqbroker -c /etc/ro…"   4 months ago   Up 3 hours   0.0.0.0:10909->10909/tcp, :::10909->10909/tcp, 9876/tcp, 10912/tcp, 0.0.0.0:10911->10911/tcp, :::10911->10911/tcp   rocket-broker

9dd5f0ccf849   styletang/rocketmq-console-ng:latest   "sh -c 'java $JAVA_O…"   4 months ago   Up 3 hours   0.0.0.0:8180->8180/tcp, :::8180->8180/tcp                                                                           rocket-console

24e49481774f   logstash:7.3.0                         "/usr/local/bin/dock…"   4 months ago   Up 3 hours   5044/tcp, 0.0.0.0:4560->4560/tcp, :::4560->4560/tcp, 9600/tcp                                                       logstash

c8a44d264bf4   foxiswho/rocketmq:server-4.7.0         "/bin/sh -c 'cd ${RO…"   4 months ago   Up 3 hours   10909/tcp, 0.0.0.0:9876->9876/tcp, :::9876->9876/tcp, 10911-10912/tcp                                               rocket-server

0f12b30d3e32   redis:6.2.5                            "docker-entrypoint.s…"   4 months ago   Up 3 hours   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                           redis

ee2655e1bc64   mysql:8.0.28                           "docker-entrypoint.s…"   4 months ago   Up 3 hours   0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                mysql

[root@VM-16-4-centos ~]# docker restart

"docker restart" requires at least 1 argument.

See 'docker restart --help'.



Usage:  docker restart [OPTIONS] CONTAINER [CONTAINER...]



Restart one or more containers

[root@VM-16-4-centos ~]# systemctl restart docker

[root@VM-16-4-centos ~]# docker ps

CONTAINER ID   IMAGE                                  COMMAND                  CREATED        STATUS         PORTS                                                                                                               NAMES

754d6bfdb20b   xuxueli/xxl-job-admin:2.3.0            "sh -c 'java -jar $J…"   4 months ago   Up 6 seconds                                                                                                                       xxl-job

956e4a70f605   foxiswho/rocketmq:broker-4.7.0         "mqbroker -c /etc/ro…"   4 months ago   Up 6 seconds   0.0.0.0:10909->10909/tcp, :::10909->10909/tcp, 9876/tcp, 10912/tcp, 0.0.0.0:10911->10911/tcp, :::10911->10911/tcp   rocket-broker

9dd5f0ccf849   styletang/rocketmq-console-ng:latest   "sh -c 'java $JAVA_O…"   4 months ago   Up 6 seconds   0.0.0.0:8180->8180/tcp, :::8180->8180/tcp                                                                           rocket-console

24e49481774f   logstash:7.3.0                         "/usr/local/bin/dock…"   4 months ago   Up 6 seconds   5044/tcp, 0.0.0.0:4560->4560/tcp, :::4560->4560/tcp, 9600/tcp                                                       logstash

c8a44d264bf4   foxiswho/rocketmq:server-4.7.0         "/bin/sh -c 'cd ${RO…"   4 months ago   Up 6 seconds   10909/tcp, 0.0.0.0:9876->9876/tcp, :::9876->9876/tcp, 10911-10912/tcp                                               rocket-server

0f12b30d3e32   redis:6.2.5                            "docker-entrypoint.s…"   4 months ago   Up 6 seconds   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                           redis

ee2655e1bc64   mysql:8.0.28                           "docker-entrypoint.s…"   4 months ago   Up 6 seconds   0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                mysql

[root@VM-16-4-centos ~]# docker-compose up -d

no configuration file provided: not found

[root@VM-16-4-centos ~]# cd /usr/local/src/docker

[root@VM-16-4-centos docker]# docker-compose up -d

[+] Running 8/8

 ⠿ Container elasticsearch   Started                                                                                                                                                                                                                                                                                                                                                       0.3s

 ⠿ Container rocket-server   Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container mysql           Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container rocket-broker   Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container redis           Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container xxl-job         Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container rocket-console  Running                                                                                                                                                                                                                                                                                                                                                       0.0s

 ⠿ Container logstash        Running                                                                                                                                                                                                                                                                                                                                                       0.0s

[root@VM-16-4-centos docker]# docker ps

CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS          PORTS                                                                                                               NAMES

bb3813bd6555   elasticsearch:7.3.0                    "/usr/local/bin/dock…"   19 seconds ago   Up 18 seconds   0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp                                elasticsearch

754d6bfdb20b   xuxueli/xxl-job-admin:2.3.0            "sh -c 'java -jar $J…"   4 months ago     Up 3 minutes                                                                                                                        xxl-job

956e4a70f605   foxiswho/rocketmq:broker-4.7.0         "mqbroker -c /etc/ro…"   4 months ago     Up 3 minutes    0.0.0.0:10909->10909/tcp, :::10909->10909/tcp, 9876/tcp, 10912/tcp, 0.0.0.0:10911->10911/tcp, :::10911->10911/tcp   rocket-broker

9dd5f0ccf849   styletang/rocketmq-console-ng:latest   "sh -c 'java $JAVA_O…"   4 months ago     Up 3 minutes    0.0.0.0:8180->8180/tcp, :::8180->8180/tcp                                                                           rocket-console

24e49481774f   logstash:7.3.0                         "/usr/local/bin/dock…"   4 months ago     Up 3 minutes    5044/tcp, 0.0.0.0:4560->4560/tcp, :::4560->4560/tcp, 9600/tcp                                                       logstash

c8a44d264bf4   foxiswho/rocketmq:server-4.7.0         "/bin/sh -c 'cd ${RO…"   4 months ago     Up 3 minutes    10909/tcp, 0.0.0.0:9876->9876/tcp, :::9876->9876/tcp, 10911-10912/tcp                                               rocket-server

0f12b30d3e32   redis:6.2.5                            "docker-entrypoint.s…"   4 months ago     Up 3 minutes    0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                                           redis

ee2655e1bc64   mysql:8.0.28                           "docker-entrypoint.s…"   4 months ago     Up 3 minutes    0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                mysql

[root@VM-16-4-centos docker]# systemctl restart docker

 

在Windows环境中,docker容器存放的路径可以参考下面的截图。

 

 

 

 

 在修改好配置后,新的windows目录下 重新编译容器。

 

 顺利启动,mysql错误可以忽略,因为用的是本地的mysql,没用容器里面的。

posted on 2022-12-14 14:14  Neo0820  阅读(217)  评论(0编辑  收藏  举报

导航