ubuntu fixed ip&FDFS upload file error

Total text: 1498 words and 8 pictures
Estimated reading time: 4 minutes

ubuntu fixed ip&FDFS upload file error#

Ubuntu fixed ip

In some project development, we need to write some configuration files, and often use ip and port. If the location of your computer changes frequently, you will find that the ip will change every time you turn on Ubuntu in the virtual machine. This is normal, because the virtual network card will automatically assign an IP for us. The ip is different in different places. So how do we solve this problem and fix our ip permanently?

Environmental equipment###

Windows10pro, VMware15.0, Ubuntu16.04, virtual machine adopts NAT mode

Setting steps###

  1. Press win key + R to go to the running interface:

  1. Enter cmd to open, click ok to open the command window.

  1. Enter ipconfig to view the IP and find VMware Network Adapter VMnet8.

The ip in ipv4 in the picture is what we need

For example, my ip is 192.168.59.xxx, so the thing to remember is 192.168.59

  1. Then enter the virtual machine and click on the network icon. Because the editor has set the theme, the icon looks like a network cable socket. Click Edit Connection in the drop-down menu.

  1. The following window will appear, click Wired Connection 1 first, and then click Edit.

  1. Click the ipv4 setting in the opened window, the method --- select manual, add the following address to the address, the address is 192.168.59 (fill in the first three digits of your own ip), and the last digit is from (3-254) Choose a number as you like. For example, if I choose 225, then fill in my address with 192.168.59.225. Set the subnet mask to 255.255.255.0, set the gateway and dns to "Network segment.2", and finally choose to save (apply)

  1. Next time your Ubuntu will not change the old IP, this is a permanent change.

FDFS upload file error##

surroundings###

VMware15.0,Ubuntu16.04、python3.5、fdfs-client-py1.2.6

Error###

raise DataError('[-] Error:%d,s'%(th.status,os.strerror(th.status)))

DataEoor:[-] Error:2,No such file or directory

the reason###

The reason for this is that the IP in the configuration file of the FastDFS client is inconsistent when we set up the Storage server, or the filled-in IP is inconsistent with the local IP.

Solution###

  1. View the currently running container
docker container ls
  1. If Storage is running, then we stop it
docker container stop storage
  1. If it is not running or after performing the second step, execute the following command to delete the storage.
docker rm fb057554358(Storage's CONTAINER ID)
  1. Re-create Storage after deleting and start service
docker run -dti --network=host --name storage -e TRACKER_SERVER=<Own computer ip>:22122-v /var/fdfs/storage:/var/fdfs delron/fastdfs storage

Set ip to the ip of your computer, do not use 127.0.0.1. When filling in ip, don’t put <>

  1. In the configuration file, set the IP as the IP of your computer, which is consistent with the above ip.
tracker_server=<Own computer ip>:22122

Do not write <> when filling in ip

High-quality article recommendation:

Official Account Usage Guide

[ Redis operation command summary)(http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484082&idx=2&sn=4a2f11b6822ec49b794116e53f5f0ed5&chksm=cec63a52f9b1b3449c27fceneb114fc84ffc442684ffv

[ Those English words that make you headaches in the front end](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247483944&idx=1&sn=2c6fb1cc97bca84adabe15723086824c&chksm=cec63ac8f17789_direct4bef12149scenechatchatchatchatchachambers&mid=2247483944&idx=1&sn=2c6fb1cc97bca84adabe15

[ Summary and review of the key knowledge of the Flask framework](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484160&idx=2&sn=c5b5ce368b080ccb8205d63031617a2a&chksm=cec63be0f9b1b8fbb4bc4bbc3498cenebcc4ccv12a9b16416

[ Detailed explanation of the key knowledge points of the project](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484181&idx=2&sn=e2015a985b4e1bce9e6f16257155996a&chksm=cec63bf5f9b1b2e3c63bf5f9b1b2e4e3ca66aedcenebenechae direct#ef6aed2, 766,, and,,,,,,,,,,,,,,,,,,, direct, engine, engine

[ Difficulties to understand & interview questions and answers](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484209&idx=1&sn=215c12fe6163904a5394483277698887&chksm=cec63bd1f9b1b2c79c9facca4715f9b1fenebchae directfarechad

[ Some common problems in the flask framework](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484258&idx=3&sn=96dc890f79e66b8d2445ee9b2d985bfd&chksm=cec63b886benebfd&chksm=cec63d

[ Team development considerations](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484267&idx=1&sn=a301cf5be9bc939a06a22294cd6c29c3&chksm=cec63b8bf9b1b29dced376f6c29c3&chksm=cec63b8bf9b1b29dced376e55e55edcchat

[ Talking about Password Encryption](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484267&idx=2&sn=539bf8c1791b710cd4d11a9bcd754d78&chksm=cec63b8bf9b1b29389df6c41075cenescene_bedirect4107255scene&quot

[ English words in the Django framework](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484300&idx=2&sn=b869826ea317bc96a2c0d2c192fd1602&chksm=cec63b6cf9benerescene=cec63b6cf9b15

[ Related operations of the database in Django](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484300&idx=1&sn=53d55448a048cbc247fbac415ea7484f&chksm=cec63b6cf9b1b27a4006f2367a2f66dceneb directchat66 of 558ceneb66fa2f14f

English words in the DRF frame

[ Key content review-DRF](http://mp.weixin.qq.com/s?__biz=Mzg3NTA0OTM1OQ==&mid=2247484561&idx=1&sn=ac59c777cbcd03bc077f19148cdd1164&chksm=cec63c71f9b1b5678c6b3e8d972c64ffbc672ebc72ef9b1b5678c6b3e8d32 #

Recommended Posts

ubuntu fixed ip&amp;FDFS upload file error
ubuntu installation error
ubuntu unzip the rar file
Ubuntu file synchronization tool rsync
Ubuntu pip3 install uwsgi error