Nginx Jump Fastdfs Store Image address Error Analysis process summary

Source: Internet
Author: User

1, problem description

Upload compressed image error: Org.csource.common.MyException:getStoreStorage fail, errno code:2


The reason is that the DNS domain name ping does not pass the Traker, changed to an IP address OK, as follows:

[Email protected] logs]# vim/etc/fdfs/storage_group2.conf

#tracker_server =tracker.mytest.com:22122

tracker_server=192.168.121.219:22122

Then restart the Storeage service

/usr/local/bin/fdfs_storaged/etc/fdfs/storage_group2.conf &


2,check, go inside the/home/plocc/fastdfs_group2 directory. Logs directory below

Go inside and look at the log information, everything works as follows:

[Email protected] ~]# ll/home/plocc/fastdfs_group2/

Total 8

Drwxr-xr-x. 259 root root 4096 May 4 2014data

Drwxr-xr-x. 2 root root 4096 May 4 2014logs

[Email protected] ~]#

Cd/home/plocc/fastdfs_group2/logs

[Email protected] logs]# tail-f Storaged.log

......

[2015-03-30 09:41:07] INFO-FILE:STORAGE_PARAM_GETTER.C, line:187, Use_storage_id=0, id_type_in_filename=ip,storage_ip_changed_auto_ Adjust=1, Store_path=0, reserved_storage_space=20.00%,use_trunk_file=0, slot_min_size=256, slot_max_size=16 MB, TRUNK_FILE_SIZE=64MB, Trunk_create_file_advance=0, trunk_create_file_time_base=02:00,trunk_create_file_interval= 86400, Trunk_create_file_space_threshold=20 gb,trunk_init_check_occupying=0, trunk_init_reload_from_binlog=0, Store_slave_file_use_link=0

[2015-03-30 09:41:07] INFO-FILE:STORAGE_FUNC.C, line:174, tracker_client_ip:192.168.121.220,my_server_id_str:192.168.121.220, G_server_ Id_in_filename:-596006720

[2015-03-30 09:41:07] Info-local_host_ip_count:2, 127.0.0.1 192.168.121.220

[2015-03-30 09:41:08] INFO-FILE:TRACKER_CLIENT_THREAD.C, line:308, successfully connect to tracker server192.168.121.219:22122, as a tracker Client, my IP is 192.168.121.220

[2015-03-30 09:41:08] INFO-FILE:TRACKER_CLIENT_THREAD.C, line:1124, tracker server 192.168.121.219:22122, Settracker leader: 192.168.121.219:22122

3, the new question came, and then the picture download, the error is as follows:

An error occurred while downloading the picture group2/m00/00/b4/wkh53fuyq1eapeawaabs0pixl7w885.jpg.

First check the FASTDFS server for this file, query to do have this file

[[email protected] data]# find. -namewkh53fuyq1eapeawaabs0pixl7w885.jpg

./00/b4/wkh53fuyq1eapeawaabs0pixl7w885.jpg

[Email protected] data]# pwd

/home/plocc/fastdfs_group2/data

[Email protected] data]#

Where is the problem? , we check the judgment by the image address that we can access on the website. Feel free to open a picture of the site, right click on the picture above, select "Copy Image Address", get the following information:

Http://static.mytest.com/group1/M00/03/AF/wKi0d1QGA0qANZk5AABawNvHeF0411.png

4,ping under Static.mytest.com, go to the above to check the Nginx configuration

Ping this static.mytest.com to see which server it is on:

[[email protected] ~]# Ping static.mytest.com

PING static.mytest.com (192.168.121.221) bytes of data.

Bytes from 192.168.121.221:icmp_seq=1ttl=64 time=0.251 ms

Bytes from 192.168.121.221:icmp_seq=2ttl=64 time=0.326 ms

Bytes from 192.168.121.221:icmp_seq=3ttl=64 time=0.305 ms

Bytes from 192.168.121.221:icmp_seq=4ttl=64 time=0.299 ms

^c

---static.mytest.com ping statistics---

4 packets transmitted, 4 received, 0%packet loss, time 3762ms

RTT Min/avg/max/mdev =0.251/0.295/0.326/0.030 ms

[Email protected] ~]#

Then go in 192.168.121.221 inside to see the Nginx configuration inside, enter

[Email protected] ~]# cd/usr/local/nginx/conf

[Email protected] conf]# vim nginx.conf #进去检索/group2 or group1

The following configuration is found:

Location ~* ^/group1/.*$ {

Proxy_pass Http://filebackend;

}

Location ~* ^/group2/.*$ {

Proxy_pass Http://filebackend;

}

Then continue in the NGINX.CNF to find Filebackend configuration, you will see the following configuration:

Upstream filebackend{

Server dfs.mytest.com:8090;

}

5, to check the nginx inside the filebackend corresponding to the dfs.mytest.com

Go ping the dfs.mytest.com and see the address.

[[email protected] ~]# Ping dns.mytest.com

PING dns.mytest.com (192.168.121.212) bytes of data.

Bytes from 192.168.121.212:icmp_seq=1ttl=64 time=0.081 ms

Bytes from 192.168.121.212:icmp_seq=2ttl=64 time=0.110 ms

Bytes from 192.168.121.212:icmp_seq=3ttl=64 time=0.104 ms

^c

---dns.mytest.com ping statistics---

3 Packets transmitted, 3 received, 0%packet loss, time 2275ms

RTT Min/avg/max/mdev =0.081/0.098/0.110/0.014 ms

[Email protected] ~]#

Then go to 192.168.121.212 inside to see the Nginx configuration, need to find/group1 or group2, found group1 no group2

Location ~* ^/group1/.*$ {

Proxy_pass Http://filebackend;

Include proxy.conf;

Error_log Logs/file_error.loginfo;

Access_log Logs/file_access.log Main;

}

So add a group2

Location ~* ^/group2/.*$ {

Proxy_pass Http://filebackend;

Include proxy.conf;

Error_log Logs/file_error.loginfo;

Access_log Logs/file_access.log Main;

}

We're continuing to retrieve the Filebackend in nginx.conf and see where it's pointing.

Upstream filebackend{

Server 192.168.121.220:8090;

}

6, go to upstream server 121.220 above to view Nginx service 8090

See point to 192.168.121.220, then we go to 192.168.121.220 on the Fastdfs file server, go to the next background process to find the Fastdfs configuration file path

[Email protected] bin]# ps-eaf|grepfdfs_storaged

Root 25036 1 0 09:41? 00:00:00/usr/local/bin/fdfs_storaged/etc/fdfs/storage_group2.conf

Root 25176 25121 0 11:00am pts/2 00:00:00 grep fdfs_storaged

[Email protected] bin]#

Then go to the config file inside/etc/fdfs/storage_group2.conf to see the picture file storage path

[Email protected] bin]# vim/etc/fdfs/storage_group2.conf

# The base path to store data and log files

Base_path=/home/plocc/fastdfs_group2

Then go to the/home/plocc/fastdfs_group2 path below to find out if the downloaded picture saved picture exists here:

Then when the picture is downloaded, the error is as follows: Download image

group2/m00/00/b4/wkh53fuyq1eapeawaabs0pixl7w885.jpg Error when .

[Email protected] fastdfs_group2]# Find-name wkh53fuyq1eapeawaabs0pixl7w885.jpg

./data/00/b4/wkh53fuyq1eapeawaabs0pixl7w885.jpg

[Email protected] fastdfs_group2]#

The file is present, so you then need to provide the service server 192.168.121.220:8090 locally in Fastdfs; go to Port 8090.

[Email protected] conf]# NETSTAT-ANP |grep8090

TCP 0 0 0.0.0.0:8090 0.0.0.0:* LISTEN 1266/nginx

[Email protected] conf]#

is on the nginx, we go to see Nginx configuration

server {

Listen 8090;

server_name localhost;

#charset Koi8-r;

#access_log Logs/host.access.log Main;

location/group1/m00 {

Root/home/plocc/fastdfs/data;

Ngx_fastdfs_module;

}

location/group2/m00 {

root/home/plocc/fastdfs_group2;

Ngx_fastdfs_module;

}

See there are/group2/m00, we go to/home/plocc/fastdfs_group2 inside see if there is a film inside

[Email protected] conf]# cd/home/plocc/fastdfs_group2

[Email protected] fastdfs_group2]# Find-name wkh53fuyq1eapeawaabs0pixl7w885.jpg

./data/00/b4/wkh53fuyq1eapeawaabs0pixl7w885.jpg

[Email protected] fastdfs_group2]#

Picture is present, then we apply the group1 address prefix http://static.mytest.com, set on the download failed on the top, the URL is as follows

Http://static.mytest.com/group2/M00/00/B4/wKh53FUYq1eAPeAWAABs0PIXl7w885.jpg, as shown in 1.png below:


With the developer said the address can access, the developer to review the code, the results found that the problem in his configuration of the image download host address path is not correct, modify the normal host path, you can access the picture.

7,nginx Error: Open log file "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail,

PS: An error summary record

[Email protected] logs]# tail-f Error.log

2015/03/30 14:52:22 [alert] 26293#0:workerprocess 26297 exited with fatal code 2 and cannot being respawned

Open log File "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail, Errno:13,error info:permission DENIED2015/03/30 14:52:22 [Alert] 26293#0:workerprocess 26294 exited with fatal code 2 and cannot be respawned

Ngx_http_fastdfs_process_init pid=26305

Ngx_http_fastdfs_process_init pid=26306

Open log File "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail, Errno:13,error info:permission deniedngx_http_ Fastdfs_process_init pid=26308

Ngx_http_fastdfs_process_init pid=26307

Open log File "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail, errno:13,error info:permission deniedopen log fil E "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail, errno:13, error info:permission Denied2015/03/30 14:53:50[ Alert] 26304#0:worker process 26305 exited with fatal code 2 and cannot berespawned

2015/03/30 14:53:50 [alert] 26304#0:workerprocess 26306 exited with fatal code 2 and cannot being respawned

Open log File "/home/plocc/fastdfs/logs/mod_fastdfs.log" to write fail, Errno:13,error info:permission DENIED2015/03/30 14:53:50 [Alert] 26304#0:workerprocess 26308 exited with fatal code 2 and cannot be respawned

2015/03/30 14:53:50 [alert] 26304#0:workerprocess 26307 exited with fatal code 2 and cannot being respawned

^c

[Email protected] logs]#

Need to give 777 of permissions

chmod 777/home/plocc/fastdfs/logs/mod_fastdfs.log

Then restart the Fastdfs storage service and fix it.


 ----------------------------------------------------------------------------------------------------------------
< Copyrighthave,textChapterspermission to reprint, but must be linked to the source address, otherwise held accountableRen!>
Original Blog Address: http://blog.itpub.net/26230597/viewspace-1479382/
Hara Douglas Fir (MCHDBA)
----------------------------------------------------------------------------------------------------------------

Nginx Jump Fastdfs Store Image address Error Analysis process summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.