systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
dhclient
git
git config http.postBuffer 524288000
DNS
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DNS1=8.8.8.8
vim /etc/resolv.conf
nameserver 8.8.8.8
service network restart
docker
tar -zxvf docker-20.10.18.tgz
/bin/cp docker/* /usr/bin/
vim /etc/systemd/system/docker.service
#内容[Unit]Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
[Service]Type=notify
# the default is not to use systemd for cgroups because the delegate issues still# exists and systemd currently does not support the cgroup feature set required# for containers run by dockerExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock --icc=false
ExecReload=/bin/kill -s HUP $MAINPID# Having non-zero Limit*s causes performance problems due to accounting overhead# in the kernel. We recommend using cgroups to do container-local accounting.LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.# Only systemd 226 and above support this version.#TasksMax=infinityTimeoutStartSec=0# set delegate yes so that systemd does not reset the cgroups of docker containersDelegate=yes
# kill only the docker process, not all processes in the cgroupKillMode=process
# restart the docker process if it exits prematurelyRestart=on-failure
StartLimitBurst=3StartLimitInterval=60s
[Install]WantedBy=multi-user.target
#添加service服务文件权限chmod +x /etc/systemd/system/docker.service
#重载unit配置文件
systemctl daemon-reload
#启动Docker
systemctl start docker#如果失败vim /etc/sysconfig/selinux 把 selinux 属性值改为disabled。然后重启系统
#设置开机自启
systemctl enable docker.service
#查看Docker状态
systemctl status docker#查看Docker版本docker version
#配置仓库地址sudomkdir -p /etc/docker
sudotee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://jhn7rnah.mirror.aliyuncs.com"],
"insecure-registries": ["192.168.60.3:5000"]
}
EOFsudo systemctl daemon-reload
sudo systemctl restart docker#限制容器日志参数
--log-opt max-size=500m --log-opt max-file=3#推送镜像到私有仓库docker tag 镜像名 仓库地址/到仓库中的镜像名
docker push 仓库地址/镜像名
docker pull hyper/docker-registry-web
##命令注释docker run ##运行
-d ##后台运行
-p 5001:8080 ##端口映射
--name registry-web ##容器命名
--link registry ##连接其他容器 加入registry到host
-e REGISTRY_URL=http://registry:5000/v2 ##指定仓库地址
-e REGISTRY_NAME=localhost:5000 ##仓库命名
hyper/docker-registry-web ##被启动的镜像
-p 5001:8080
--link registry
-e REGISTRY_URL=http://192.168.60.3:5000/v2
-e REGISTRY_NAME=192.168.60.3:5000
ES镜像
FROM centos:8
COPY ./elasticsearch-7.8.0-linux-x86_64.tar.gz ./
RUN tar -zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz
RUN groupadd -r es &&useradd -r -g es es
RUN chown -R es /elasticsearch-7.8.0
USER es
WORKDIR /elasticsearch-7.8.0
ENTRYPOINT ./bin/elasticsearch
EXPOSE 9200
EXPOSE 9300
构建镜像
docker build -t es:1 ./
给宿主机挂载卷的目录赋权
chmod777 -R ./config/
修改宿主机配置文件
vim /etc/sysctl.conf
在文件末尾增加下面内容
一个进程可以拥有的VMA(虚拟内存区域)的数量,默认值为65536
vm.max_map_count=655360
重新加载
sysctl -p
创建容器运行
docker run --name=es -p 9200:9200 -p 9300:9300 -v /root/es/config:/elasticsearch-7.8.0/config es:1
修改ES配置
vim ./config/elasticsearch.yml
修改ES内存占用
vim ./config/jvm.options
-Xms=1g
-Xmx=1g