当前位置:   article > 正文

docker n2n安装与调试

n2nv1 docker

docker n2n安装与调试

 

yum install -y docker

 

docker pull pahud/n2n-docker

 

cd /
10 mkdir data
11 cd data
12 mkdir n2n-docker

 

vi Dockerfile
14 docker build -t pahud/n2n-docker
15 docker build
16 ls
17 ll
18 mv Dockerfile n2n-docker/
19 ls
20 cd n2n-docker/
21 ls
22 docker build -f Dockerfile
23 docker build -f Dockerfile .
24 systemctl enable docker.service
25 systemctl start docker.service
26 docker build -f Dockerfile .
27 docker build
28 docker build .
29 docker ps

yum install -y openssl-devel
41 14 yum install -y cmake
42 15 yum install -y net-tools
43 16 yum install -y git
44 yum install -y openssl-devel
45 yum install -y cmake
46 yum install -y net-tools
47 yum install -y git
48 yum install -y gcc gcc-c++
49 cd /data
50 ls
51 git clone https://github.com/meyerd/n2n.git
52 cd n2n/n2n_v2
53 mkdir build
54 cd build
55 cmake ..
56 make && make install
57 mkdir build
58 cd build
59 cmake ..
60 supernode -l 9000 -v -f
61 supernode -l 9000
62 mkdir /mnt/tools -p
63 cd /mnt/tools
64 yum -y install gcc automake autoconf libtool make
65 yum install gcc gcc-c++
66 wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
67 tar -xzf pcre-8.40.tar.gz -C ./
68 cd pcre-8.40
69 ll
70 ./configure --prefix=/usr/local/pcre
71 make && make install
72 cd ..
73 wget http://zlib.net/zlib-1.2.11.tar.gz
74 tar -xzf zlib-1.2.11.tar.gz -C ./
75 cd zlib-1.2.11
76 ./configure --prefix=/usr/local/zlib
77 make && make install
78 cd ..
79 wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
80 tar -xzf openssl-1.0.2k.tar.gz -C ./
81 wget http://nginx.org/download/nginx-1.12.0.tar.gz
82 tar -xzf nginx-1.12.0.tar.gz -C ./
83 cd nginx-1.12.0
84 ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/mnt/tools/pcre-8.40/ --with-zlib=/mnt/tools/zlib-1.2.11/ --with-openssl=/mnt/tools/openssl-1.0.2k/ --with-stream
85 make
86 make install
87 cd /usr/local/nginx/
88 ls
89 vi nginx.conf
90 mkdir /var/log/nginx/
91 mkdir /usr/local/nginx/conf.d/
92 cd /usr/local/nginx/conf.d/
93 vi tcp.stream
94 cd ..
95 ls
96 ./nginx -t
97 ./nginx -s reload
98 ps -ef |grep nginx
99 ./nginx
100 ps -ef |grep nginx
101 ./nginx -s reload
102 ifconfig
103 history
104 ls
105 ./nginx -s reload
106 docker ps
107 ./nginx -s reload
108 docker ps
109 ping 10.0.0.12
110 curl 10.0.0.12:8080
111 ./nginx -s reload
112 ls
113 ps -ef
114 ifconfig
115 ping 10.0.0.12
116 ping 10.0.0.11
117 ifconfig
118 ./nginx -s reload

 

客户端

 

 

yum install -y openssl-devel
14 yum install -y cmake
15 yum install -y net-tools
16 yum install -y git
17 git clone https://github.com/meyerd/n2n.git
18 yum install -y gcc gcc-c++
19 ls
20 cd n2n/
21 ls
22 cd n2n_v
23 cd n2n_v2/
24 mkdir build
25 cd build
26 cmake ..
27 make && make install
28 edge -a 10.0.0.11 -c edge0 -k wss -l 47.244.63.170:9000
29 From 10.0.0.10 icmp_seq=1 Destination Host Unreachable
30 ping 10.0.0.10
31 ping 47.244.63.170
32 ls
33 ps -ef
34 ki;; 2243
35 kill 2243
36 edge -a 10.0.0.12 -c edge0 -k wss -l 47.244.63.170:9000 -v -f
37 history
38 ps -ef
39 edge -a 10.0.0.12 -c edge0 -k wss -l 47.244.63.170:9000 -v -f
40 edge -a 10.0.0.12 -c edge0 -k wss -l 47.244.63.170:9000
41 docker ps
42 docker
43 yum install -y docker
44 ping 10.0.0.10
45 ipconfig
46 ifconfig
47 docker pull nginx
48 docker ps
49 systemctl enable docker.service
50 systemctl start docker.service
51 docker pull nginx
52 docker run -p 80:80 -p 443:443 --name main_nginx -v /data/main/nginx/www:/usr/share/nginx/html -v /data/main/nginx:/etc/nginx:ro -d nginx
53 docker ps
54 docker ps -a
55 docker rm nginx
56 docker rm main_ginx
57 docker rm main_nginx

 

docker ps
91 systemctl stop firewalld.service
92 systemctl start firewalld.service
93 systemctl status firewalld.service
94 firewall-cmd --zone=public --list-ports
95 firewall-cmd --zone=public --add-port=80/tcp --permanent
96 firewall-cmd --reload
97 docker ps
98 firewall-cmd --zone=public --list-ports
99 firewall-cmd --zone=public --add-port=80/tcp --permanent
100 systemctl status firewalld.service
101 systemctl stop firewalld.service
102 ifconfig
103 docker stop main_nginx
104 docker ps
105 docker ps -a
106 docker docker run -dit --rm --name main_nginx nginx
107 docker run -dit --rm --name main_nginx nginx
108 docker ps
109 firewall-cmd --zone=public --query-port=80/tcp
110 systemctl start firewalld.service
111 firewall-cmd --query-panic
112 firewall-cmd --zone=public --query-port=80/tcp
113 systemctl status firewalld.service
114 firewall-cmd --list-services
115 firewall-cmd --zone=public --list-ports
116 netstat -anp
117 vi /etc/sysctl.conf
118 systemctl restart network
119 sysctl net.ipv4.ip_forward
120 pkill docker
121 netstat -anp
122 vim /etc/sysctl.conf
123 vi /etc/sysctl.conf
124 sysctl -p /etc/sysctl.conf
125 systemctl restart network
126 docker-machine ip default
127 curl 127.0.0.1:80
128 curl 127.0.0.1:443
129 docker ps
130 history
131 systemctl enable docker.service
132 systemctl start docker.service
133 docker ps
134 docker ps -a
135 docker images
136 docker run nginx
137 docker ps
138 docker docker run -dit --rm --name main_nginx \
139 docker run -dit --rm --name main_nginx nginx
140 docker ps
141 curl 127.0.0.1:443
142 curl 127.0.0.1:80
143 docker ps
144 docker ps -a
145 docker rm 59e
146 history
147 netstat -anp
148 docker run -ti -d --name my-nginx2 -P docker.io/nginx
149 docker ps
150 docker stop my-nginx2
151 docker ps
152 docker stop main_nginx
153 docker run -dit --rm --name main_nginx -v /data/main/nginx:/etc/nginx:ro -p 80:80 -p 443:443 nginx
154 docker ps
155 docker stop my-nginx2
156 docker start my-nginx2
157 docker ps
158 docker stop main_ginx
159 docker stop main_nginx
160 docker ps
161 docker stop my-nginx2
162 docker ps
163 ls
164 docker ps
165 docker ps -a
166 docker rm my-nginx2
167 docker docker run -dit --rm --name main_nginx nginx
168 docker run -dit --rm --name main_nginx nginx
169 docker ps
170 docker stop main_nginx
171 docker docker run -dit --rm --name main_nginx nginx
172 docker run -dit --rm --name main_nginx nginx
173 docker run -dit --rm --name main_nginx nginx
174 docker ps
175 docker ps -a
176 docker cp main_nginx:/etc/nginx /data/main/
177 docker stop main_nginx
178 docker run -dit --rm --name main_nginx -v /data/main/nginx:/etc/nginx:ro -p 9003:80 nginx
179 docker ps
180 historuy
181 history
182 systemctl stop firewalld.service
183 docker ps
184 docker nginx -s reload
185 docker exec -it nginx /etc/init.d/nginx reload
186 docker exec -it main_nginx /etc/init.d/nginx reload
187 docker ps
188 history
189 wget www.baidu.com
190 docker ps
191 docker stio main_nginx
192 docker stop main_nginx
193 docker run -dit --rm --name main_nginx -v /data/main/nginx:/etc/nginx:ro -v /data/var/log/nginx/logs:/var/log/nginx nginx
194 docker ps
195 docker ps -a
196 docker run -dit --rm --name main_nginx -v /data/main/nginx:/etc/nginx:ro nginx
197 docker ps
198 docker ps -a
199 docker ps
200 history
201 docker run -ti -d --name nginx2 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
202 docker ps
203 docker stop main_nginx
204 docker ps -a
205 docker stop nginx2
206 docker run -ti -d --name nginx2 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
207 docker ps
208 docker ps -a
209 docker rmi nginx2
210 docker rm nginx2
211 docker run -ti -d --name nginx2 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
212 docker rm nginx2
213 docker run -ti -d --name my-nginx2 -P docker.io/nginx
214 docker rm my-nginx2
215 history
216 systemctl start firewalld.service
217 docker run -ti -d --name my-nginx2 -P docker.io/nginx
218 docker ps
219 docker stop my-nginx2
220 docker run -ti -d --name nginx2 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
221 docker ps
222 docker run -ti -d --name my-nginx2 -P docker.io/nginx
223 docker run -ti -d --name my-nginx3 -P docker.io/nginx
224 docker ps
225 docker docker stop nginx2
226 docker stop nginx2
227 docker rm nginx2
228 docker run -ti -d --name my-nginx3 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
229 docker ps
230 docker stop my-nginx3
231 docker run -ti -d --name my-nginx3 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
232 docker ps
233 docker ps -a
234 docker rm mynginx2
235 docker rm my-nginx2
236 docker ps
237 docker ps -a
238 docker ps
239 docker run -ti -d --name my-nginx2 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
240 docker ps
241 docker ps -a
242 docker rm my-nginx3
243 docker ps
244 docker stop my-nginx2
245 docker ps
246 docker run -ti -d --name my-nginx3 -P docker.io/nginx
247 docker ps
248 docker cp my-nginx3:/etc/nginx /data/main2
249 cd /data
250 ll
251 cd main2
252 ls
253 ll
254 docker ps
255 docker cp /data/main2/ my-nginx3:/etc/nginx
256 docker exec -it my-nginx3 /etc/init.d/nginx reload
257 docker ps
258 docker stop mu-nginx3
259 docker stop my-nginx3
260 docker run -ti -d --name my-nginx3 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
261 docker ps
262 docker ps -a
263 docker rm my-nginx3
264 docker rm my-nginx2
265 docker ps
266 docker run -ti -d --name my-nginx3 -v /data/main/nginx:/etc/nginx:ro -P docker.io/nginx
267 docker ps
268 history
269 firewall-cmd --state
270 docker ps
271 systemctl stop firewalld.service
272 docker logs my-nginx2
273 docker logs my-nginx3
274 docker exec -it my-nginx
275 docker exec -it my-nginx3
276 docker exec my-nginx3
277 exit
278 ps
279 ps -a
280 exit
281 ipconfig
282 ping www.baidu.com
283 vi /etc/resolv.conf
284 vi /etc/sysconfig/network-scripts/ifcfg-ens33
285 service network restart
286 ifconfig
287 history
288 ls
289 ps -ef
290 cur 127.0.0.1:32805
291 curl 127.0.0.1:32805
292 curl www.baidu.com
293 curl 127.0.0.1:32805
294 docker ps
295 ps -a
296 docker ps
297 docker pull hub.c.163.com/library/nginx:latest
298 docker images
299 docker run -d -p 8080:80 hub.c.163.com/library/nginx:latest
300 systemctl restart docker
301 docker ps
302 docker ps -a
303 docker start happy_thompson
304 docker ps
305 docker stop 99c
306 docker start my-nginx3
307 docker ps
308 docker stop 0f7
309 docker ps
310 docker ps -a
311 docker start happy_thompson
312 docker ps
313 docker stop 99c
314 docker run -d -p 8080:80 -v /data/main/nginx/www/songaw:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
315 docker ps
316 docker stop 4e3
317 docker run -d -p 8080:80 -v /data/main/nginx/www/:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
318 dockedocker exec -it suspicious_hawking
319 docker exec -it suspicious_hawking
320 docker exec -it suspicious_hawking bash
321 docker ps
322 docker start 14b
323 docker exec -it suspicious_hawking bash
324 docker
325 docker exec -it 14b bash
326 history
327 docker exec -it 14b /etc/init.d/nginx reload
328 docker ps
329 docker exec -it 14b bash
330 docker stop 14b
331 docker start 14b
332 history
333 docker exec -it 14b bash
334 ls
335 docker ps
336 docker cp 14b:/etc/nginx /data/main3
337 cd /data/main3/
338 ls
339 docker stop 14b
340 docker run -d -p 8080:80 -v /data/main3/:/etc/nginx hub.c.163.com/library/nginx:latest
341 docker ps
342 docker ps -a
343 docker rm my-nginx3
344 docker ps
345 docker run -d -p 8080:80 -v /data/main3/:/etc/nginx/ hub.c.163.com/library/nginx:latest
346 docker ps
347 docker run -d -p 8080:80 -v /data/main3/nginx/:/usr/share/nginx/ hub.c.163.com/library/nginx:latest
348 docker ps
349 docker stop 054
350 docker stop 05
351 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf hub.c.163.com/library/nginx:latest
352 docker ps
353 docker stop 1b
354 docker run -d -p 8080:80 -v /data/main/nginx:/etc/nginx:ro hub.c.163.com/library/nginx:latest
355 docker ps
356 docker stop 525
357 docker ps
358 docker run -d -p 8080:80 -v /data/main3/:/etc/nginx:ro hub.c.163.com/library/nginx:latest
359 docker ps
360 docker ps -a
361 docker stop 8c
362 docker stop 52
363 docker stop 1b
364 docker stop 050
365 docker stop 123
366 docker stop 3f
367 docker stop
368 docker ps
369 docker ps -a
370 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main3/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
371 docker ps
372 chcon -Rt svirt_sandbox_file_t /data
373 docker ps
374 docker stop a10
375 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main3/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
376 docker ps
377 docker stop 2b
378 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
379 docker ps -a
380 docker rmi 1
381 docker rm 1
382 docker rm 2
383 docker rm 3
384 docker rm 4
385 docker rm 5
386 docker rm 6
387 docker rm 7
388 docker rm 8
389 docker ps
390 docker stop 4f
391 docker ps
392 docker ps -a
393 docker stop nginx
394 docker rm 4f
395 docker fm a1
396 docker rm a1
397 docker rm 1b
398 docker rm 05
399 docker rm 12
400 docker rm 14
401 docker rm 4e
402 docker rm 99
403 docker ps -a
404 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main1/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
405 vi /etc/selinux/config
406 reboot
407 docker ps -a
408 docker start 110
409 docker ps
410 docker rm 110
411 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main1/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
412 docker ps
413 docker stop 755
414 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main3/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
415 docker ps
416 curl 127.0.0.1:8080
417 history
418 edge -a 10.0.0.12 -c edge0 -k wss -l 47.244.63.170:9000
419 docker ps
420 docker stop 255
421 docker stop 25
422 docker rm 25
423 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main1/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
424 docker ps
425 docker stop dc
426 docker ps -a
427 docker rm dc
428 docker rm 755
429 vim /etc/selinux/config
430 vi /etc/selinux/config
431 docker run -d -p 8080:80 -v /data/main3/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main2/www:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
432 docker ps
433 docker stop f4
434 docker ps
435 cd /data
436 ls
437 rm -rf main
438 rm -rf main2
439 docker run -d -p 8080:80 -v /data/main/nginx.conf:/usr/share/nginx/nginx.conf -v /data/main/www/songaw:/usr/share/nginx/html hub.c.163.com/library/nginx:latest
440 docker ps
441 ifconfig
442 ping 10.0.0.2
443 ping 10.0.0.10.
444 ping 10.0.0.10
445 ps
446 docker ps
447 ps -ef
448 kill 1763
449 edge -a 10.0.0.12 -c edge0 -k wss -l 47.244.63.170:9000
450 ping 10.0.0.10
451 docker ps
452 ps
453 ps -ef
454 ls
455 ifconfig
456 uname -a
457 docker version
458 docker run -d -v /home/root/registry:/var/lib/registry -p 5000:5000 --restart=always --privileged=true --name registry registry:latest
459 docker ps
460 docker tag tomcat localhost:5000/tomcat
461 vi /etc/sysconfig/docker
462 docker pull docker.io/centos
463 docket tag centos localhost:5000/centos
464 docker tag centos localhost:5000/centos
465 docker push localhost:5000/centos
466 ipconfig
467 ifconfig
468 vi /etc/sysconfig/docker
469 docker pas
470 docker ps
471 docker tag vigilant_darwin
472 docker images
473 ls
474 docker ps
475 cd n2n/
476 ls
477 cd n2n_v2/
478 ls
479 ps -ef

转载于:https://www.cnblogs.com/songanwei/p/10036211.html

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号