In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I. Environment
Ubuntu 18.04.1 LTS
II. Resource preparation
1. Nginx-1.14.0
2. FastDFS-5.11
3. Fastdfs-nginx-module
4. Libfastcommon
III. Installation
1. Install libfastcommon
1 > decompress libfastcommon
2 > make command compilation
3 > make install command installation
4 > set up soft links
Ln-s / usr/lib64/libfastcommon.so / usr/local/lib/libfastcommon.so
Ln-s / usr/lib64/libfastcommon.so / usr/lib/libfastcommon.so
Ln-s / usr/lib64/libfdfsclient.so / usr/local/lib/libfdfsclient.so
Ln-s / usr/lib64/libfdfsclient.so / usr/lib/libfdfsclient.so
two。 Install FastDFS
1 > decompression
2 > make command compilation, make install command installation
3 > make a copy of the three sample configuration files installed under / etc/fdfs/ and remove the .sample suffix
3. Configure Tracker
1 > create a f_tracker directory under / opt/
Tracker.conf file in 2 > modify 2. 3 >
Disabled=false# enable profile (false is enabled)
Port=22122# sets the port number of tracker, usually using 22122 as the default port
Base_path=/opt/f_tracker# sets the data file and log directory for tracker
Http.server_port=6666# sets the http port number. Default is 8080.
3 > create a soft reference for the startup script, because commands such as fdfs_trackerd are not in / usr/local/bin, but in the / usr/bin path
Ln-s / usr/bin/fdfs_trackerd / usr/local/bin
Ln-s / usr/bin/stop.sh / usr/local/bin
Ln-s / usr/bin/restart.sh / usr/local/bin
4 > service fdfs_trackerd start starts the Tracker server (check the snooping of the tracker service through the netstat-unltp | grep fdfs command)
4. Configure Storage
1 > create f_storage and f_storage_data directories under / opt/
Storage.conf file in 2 > modify 2. 3 >
Disabled=false# enable profile (false is enabled)
Group_name=group1# group name, modified according to the actual situation
Port=23000 # sets the port number of storage. The default is 23000. The storage port number of the same group must be the same.
Base_path=/opt/f_storage# sets up storage data files and log directories
The number of store_path_count=1 # storage paths, which needs to match the number of store_path
Store_path0=/opt/f_storage_data # actual file storage path
The IP address and port number of the tracker_server=192.168.43.45:22122 # tracker server. Since this is built on a stand-alone machine, this is the native ip. If the cluster is built, enter the ip where the tracker server resides.
Http.server_port=8888# sets the http port number
3 > set a soft reference for the startup script of the Storage server
Ln-s / usr/bin/fdfs_storaged / usr/local/bin
4 > service fdfs_storaged start command starts the Storage server, and a multi-level storage directory will be generated under the file storage path.
5 > check to see if storage is registered on tracker. The command / usr/bin/fdfs_monitor / etc/fdfs/storage.conf is successful with the word Active in the picture.
5. Configure client.conf
Storage.conf file in 1 > modify 2.3 >
Base_path=/opt/fastdfs_tracker#tracker server file path
Tracker_server=192.168.43.45:22122#tracker server IP address and port number
The http port number of the http.tracker_server_port=6666# tracker server, which must correspond to the setting of tracker
2 > upload 1.txt via command
/ usr/bin/fdfs_upload_file / etc/fdfs/client.conf / home/2.jpg
3 > if successful, return id as group1/M00/00/00/wKgrLVu5nQ6ADqBpAAB92gKP0_o908.jpg
6. Install Nginx
1 > decompress nginx-1.14.0 and fastdfs-nginx-module
2 > add fastdfs-nginx-module module to nginx. Enter the command in the nginx-1.14.0 directory. / configure-- prefix=/usr/share/nginx-- with-http_ssl_module-- with-http_stub_status_module-- with-http_realip_module-- with-http_auth_request_module-- with-http_v2_module-- with-http_dav_module-- with-http_slice_module-- with-threads-- with-http_addition_module-- with-http_geoip_module=dynamic-- with -http_gunzip_module-with-http_gzip_static_module-with-http_image_filter_module=dynamic-with-http_sub_module-with-http_xslt_module=dynamic-with-stream=dynamic-with-stream_ssl_module-with-mail=dynamic-with-mail_ssl_module-add-module=/home/jobs/fastdfs/moudle1/src
-- prefix is the installation directory and / home/jobs/fastdfs/moudle1/src is the directory where the module is located
3 > make command compilation
4 > make install command installation
5 > I failed to compile when I installed, and failed for most of the day. Finally, I installed nginx through apt-get install nginx, and then checked the installation information with the nognx-V command. Know-- prefix=/usr/share/nginx-- with-http_ssl_module-- with-http_stub_status_module-- with-http_realip_module-- with-http_auth_request_module-- with-http_v2_module-- with-http_dav_module-- with-http_slice_module-- with-threads-- with-http_addition_module-- with-http_geoip_module=dynamic-- with-http_gunzip_module-- with-http_gzip_static_ Module-with-http_image_filter_module=dynamic-with-http_sub_module-with-http_xslt_module=dynamic-with-stream=dynamic-with-stream_ssl_module-with-mail=dynamic-with-mail_ssl_module Then enter the command. / configure plus the above information plus-- add-module=/home/jobs/fastdfs/moudle1/src in the nginx-1.14.0 directory.
7. Configure the fastdfs-nginx-module module and nginx
1 > modify / usr/share/nginx/nginx.conf
Server {
Listen 8888
Server_name localhost
# charset koi8-r
# access_log logs/host.access.log main
Location / {
Root html
Index index.html index.htm
}
Location ~ / group1/M00 {
Ngx_fastdfs_module
}
# error_page 404 / 404.html
# redirect server error pages to the static page / 50x.html
#
Error_page 500 502 503 504 / 50x.html
Location = / 50x.html {
Root html
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
# location ~\ .php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# location ~\ .php$ {
# root html
# fastcgi_pass 127.0.0.1:9000
# fastcgi_index index.php
# fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name
# include fastcgi_params
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
# location ~ /\ .ht {
# deny all
#}
}
2 > enter the conf directory under the directory of the FastDFS installation package, and copy http.conf and mime.types to the / etc/fdfs directory. Next, you need to copy the mod_fastdfs.conf under the src directory in the fastdfs-nginx-module installation directory to the / etc/fdfs directory:
3 > mod_fastdfs.conf modifies the following configuration, other defaults
# connection timeout
Connect_timeout=10
# Tracker Server
Tracker_server=file.ljzsg.com:22122
# StorageServer default Port
Storage_server_port=23000
# set it to true if the uri of the file ID contains / group**,
Url_have_group_name = true
# the store_path0 path configured by Storage must be the same as that in storage.conf
Store_path0=/opt/f_storage_data
4 > start the Nginx command service nginx start and print out the pid information as successful
5 > browsers access http://192.168.43.45:8888/group1/M00/00/00/wKgrLVu5nQ6ADqBpAAB92gKP0_o908.jpg
IV. Cluster installation
For cluster installation, you only need to install fastdfs and nginx on each machine. If it is a single tracker and multiple storage, just configure tracker on one machine and storage and nginx on other machines. Fastdfs can also be composed of multiple tracker, and each tracker has the same status. For round-robin use, storage can be divided into groups, and the content of storage in each group is the same.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.