1. 从宿主机copy文件到容器
docker cp jdk-8u45-linux-x64.tar.gz 68614964fc64:/work
2. docker上安装ssh后 ssh进容器,有可能出现登录后即中断的情况,目前还没有弄清楚原因
root@centos12 ~]# ssh 172.17.0.17
root@172.17.0.17's password:
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 2.6.32-573.el6.x86_64 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Last login: Mon Jul 16 10:32:13 2018 from 172.17.42.1
Connection to 172.17.0.17 closed.
3. docker容器中的ulimit问题
root@web:/home/hunter/test# python connectivity.py post {"took":1} http://172.17.0.64:9200/_search?q=connectivity-test.conn_token:connectivity-test-yHoxx25Q Traceback (most recent call last): File "connectivity.py", line 80, in <module> r = requests.get(url, headers=headers) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in get return request('get', url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 378, in send raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPConnectionPool(host='172.17.0.64', port=9200): Max retries exceeded with url: /_search?q=connectivity-test.conn_token:connectivity-test-yHoxx25Q (Caused by <class 'socket.error'>: [Errno 111] Connection refused)
通过 docker run --ulimit nofile=65536:65536 --name es6 -d newssh3 创运行容器,解决。
4. docker 容器中权限不足的问题(不能修改系统级的配置)
# vim /etc/sysctl.conf # sysctl -p sysctl: setting key "vm.max_map_count": Read-only file system
编辑sysctl.conf后执行sysctl -p 报Read-only file system
解决方法:# docker run --privileged -it bdb468c63e82 /bin/bash
5.
root@his:/work# docker load < /work/mysqlimages.tar
6.
7. docker程序的某些文件莫名其妙的丢失,只能重装
1、所有应用的配置文件都要修改并检查
2、基于docker部署es增加节点时需要把network.host替换成network.bind_host和network.publish_host
3、增加es新节点的数据目录要清除
4、所有机器的/etc/hosts 都要修改正确
5、docker数据目录/var/lib/docker 挂载到最大分区上,避免空间不够
6、fdisk 分区完重启,然后再mkfs.ext4 格式化,在/etc/fstab 配置开机自动挂载,然后在重启
7、es 节点要执行sysctl -p ,加入/work/auto_start中可以run 时自动执行
8、requirements.txt 中的包要指定版本及安装先后顺序
117上的gocron,登录VPN后无法访问gocron的web界面
原因路由和本地电脑IP有冲突,删除路由即可。
route del -net 172.16.0.0 netmask 255.255.0.0