首页 文章 精选 留言 我的

精选列表

搜索[基础搭建],共10000篇文章
优秀的个人博客,低调大师

急速搭建 Serverless AI 应用:为你写诗

前言 首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。函数计算更多信息参考。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API 网关、日志服务等资源。它通过一个资源配置文件(template.yml),协助您进行开发、构建、部署操作。Fun 的更多文档参考。 备注: 本文介绍的技巧需要 Fun 版本大于等于 3.2.0。 依赖工具 本项目是在 MacOS 下开发的,涉及到的工具是平台无关的,对于 Linux 和 Windows 桌面系统应该也同样适用

优秀的个人博客,低调大师

手机端webApp开发本地调试环境搭建

背景 这是本人在字节跳动工作时,学习到的经验,记录下来,和大家一起共同学习,有错误的地方往提出宝贵意见。手机端WebApp开发阶段,用chrome devtools模拟手机设备,很多兼容性问题不能提前发现。考虑到很多同学在开发时不便经常发版,方便设备可通过ip地址直接在移动端调试,提前发现问题,且不用发版到 test/pre 环境。 环境 开发机与移动测试机需要在同一网段下。 配置步骤 睁开双眼,找到vue目录中的config里的index.js文件(根据实际文件目录情况)。 抬起左手,伸出兰花指,往下翻,找到host配置,若配置为'localhost',改成'0.0.0.0'即可。 保存,重新启动服务。 查询虚拟机ip地址:在桌面上打开Powershell命令窗口,输入ipconfig,回车。 说明:此方法适合vue-cli 3.0以下的项目,3.0运行后会自动生成Network地址,在测手机上可直接调试。 验证 前提:(手机wifi需要与项目在同一个网络下才可以调试) 拿出一部可以打王者荣耀的手机,打开一个浏览器,输入你的ip,不要忘记加上项目的端口号,有的项目是需要加上入口名称的: 例如:http://10.1.104.230:8080 或加入入口名:http://10.1.104.230:8080/passager.html#/home 这样每次更改代码,保存后,页面就会自动刷新,这样就提高了修改bug的效率,降低了加班引起家暴的风险,多么神奇!!! 祝你早日成为大牛!

优秀的个人博客,低调大师

使用阿里云ECS搭建WordPress博客教程

宝塔官网:https://www.bt.cn/?invite_code=MV90a3BjeWM=安装要求:内存:512M以上,推荐768M以上(纯面板约占系统60M内存)硬盘:100M以上可用硬盘空间(纯面板约占20M磁盘空间)系统:CentOS 7.1+ (Ubuntu16.04+.、Debian9.0+),确保是干净的操作系统,没有安装过其它环境带的Apache/Nginx/php/MySQL(已有环境不可安装) 宝塔linux6.0版本是基于centos7开发的,务必使用centos7.x 系统提示:Centos官方已宣布在2020年停止对Centos6的维护更新,各大软件开发商也逐渐停止对Centos6的兼容,新服务器不建议使用Centos6Linux面板6.9.7安装命令:推荐使用阿里云云服务器安装)使用SSH 连接工具,挂载磁盘后,根据系统执行框内命令开始安装(大约2分钟完成面板安装)Centos安装命令:yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh Ubuntu/Deepin安装命令:wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh Debian安装命令:wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh Fedora安装命令:wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh Linux面板6.9.7升级命令: curl http://download.bt.cn/install/update6.sh|bash 以下为部分功能预览图:面板设置SSL

优秀的个人博客,低调大师

BeeGFS开发环境搭建4-源码编译

如果我们需要动态调试和开发BeeGFS,那么就需要自己手动编译了,而且能够用最简单的方式运行起来,下面就讲解自己探索和分析的过程。 参考文档: # https://git.beegfs.io/pub # https://www.beegfs.io/wiki/BuildFromSources 初始化环境 安装依赖的软件包: $ yum install -y libuuid-devel libibverbs-devel librdmacm-devel libattr-devel redhat-rpm-config rpm-build xfsprogs-devel cppunit cppunit-devel zlib-devel openssl-devel sqlite sqlite-devel ant gcc-c++ gcc redhat-lsb-core java-devel 获取官方源码 获取指定版本的源码: $ git clone https://git.beegfs.io/pub/v6.git beegfs-v6 $ cd beegfs-v6 $ git tag -l 6.1 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 $ git checkout -b v6.18 6.18 进行简单的查看和验证: $ git show 6.18 | head -n12 tag 6.18 Tagger: Bernd Lietzow <bernd.lietzow@itwm.fraunhofer.de> Date: Mon Mar 12 16:09:35 2018 +0100 created tag 6.18 commit aee03250ea19502952d2f187e73134996abaec5b Author: Bernd Lietzow <bernd.lietzow@itwm.fraunhofer.de> Date: Mon Mar 12 16:09:13 2018 +0100 updated to release 6.18 $ git branch -av master 4a69532 updated to release 6.19 * v6.18 aee0325 updated to release 6.18 remotes/origin/HEAD -> origin/master remotes/origin/master 4a69532 updated to release 6.19 分析Makefile 查看他的Makefile,BeeGFS自己实现了一个简单的Makefile工程模板,所有的子模块都使用这一套模板来变异,十分简单高效: $ make -j$(nproc) -C beegfs_meta/build help [VER] BEEGFS_VERSION="19.5-git8" BEEGFS_VERSION_CODE=18023688 make: Entering directory `/root/beegfs-v6/fhgfs_meta/build' Optional arguments: BEEGFS_DEBUG=1 Enables debug information and symbols BEEGFS_DEBUG_OPT=1 Enables internal debug code, but compiled with optimizations CXX=<compiler> Specifies a c++ compiler DISTCC=distcc Enables the usage of distcc V=1 Print command lines of tool invocations BEEGFS_COMMON_PATH=<path> Path to the beegfs_common directory BEEGFS_OPENTK_PATH=<path> Path to the beegfs_opentk_lib directory BEEGFS_THIRDPARTY_PATH=<path> Path to the beegfs_thirdparty directory Targets: all (default) build only clean delete compiled files help print this help message rpm create an rpm package deb create debian package file make: Leaving directory `/root/beegfs-v6/fhgfs_meta/build' $ cat beegfs_meta/build/Makefile # This is the beegfs_meta makefile. # It creates an ELF executable. # # Use "make help" to find out about configuration options. CAN_PACKAGE := yes include $(or $(root-dir),../..)/build/Makefile $(call build-executable,\ beegfs-meta,\ $(shell find ../source -iname '*.cpp'),\ opentk common cppunit dl) # enable special reference DirInode debug code ifneq ($(BEEGFS_DEBUG_RELEASE_DIR),) # extra release dir debugging CXXFLAGS += -DBEEGFS_DEBUG_RELEASE_DIR endif $ cat build/Makefile ... override V := $(if $V,,@) all: ... rpm: ./make-rpm ... # build-executable # # define a new executable for the build # arguments: # #1: name of the executable # #2: sources # #3: required libraries build-executable = $(eval $(call -build-executable-fragment,$(strip $1),$2,$3)) define -build-executable-fragment all: $1 CLEANUP_FILES += $1 $(addsuffix .o,$2) $(addsuffix .d,$2) $(addsuffix .o,$2): CXXFLAGS += \ $(foreach lib,$3,$(call resolve-dep-cflags,$(lib))) $1: LDFLAGS += \ -Wl,--start-group $(foreach lib,$3,$(call resolve-dep-ldflags,$(lib))) -Wl,--end-group $1: $(addsuffix .o,$2) $(foreach lib,$3,$(call resolve-dep-deps,$(lib))) @echo "[LD] $$@" $$V$$(CXX) -o $$@ $(addsuffix .o,$2) $$(LDFLAGS) -include $(addsuffix .d,$2) endef 分析RPM脚本 查看他构建RPM包的方法,直接打包源码目录,并使用一个RPM SPEC文件模板,使用sed动态生成一个SPEC文来进行构建: $ cat beegfs_meta/build/make-rpm #!/bin/bash NAME=beegfs-meta SPEC_FILE=${NAME}.spec source ../../beegfs-version arch=`uname -m` if [[ "$arch" == "x86_64" ]]; then BUILDARCH="$arch" elif [[ "$arch" =~ 86 ]]; then BUILDARCH="i686" else BUILDARCH=$arch fi CONCURRENCY=${MAKE_CONCURRENCY:-4} export BEEGFS_VERSION_PATH=`pwd`/../../beegfs-version set -e pushd ../ TOOLS_ROOT=`pwd` popd BUILD="${TOOLS_ROOT}/build" mkdir -p $BUILD/buildroot/{BUILD,RPMS,S{RPMS,PECS,OURCES}} rm -f $BUILD/buildroot/SOURCES/*.tgz ROOT_DIR=${ROOT_DIR:-`(cd ../..; pwd)`} BEEGFS_COMMON_PACKAGE_PATH=${BEEGFS_COMMON_PACKAGE_PATH:-`readlink -f ../../beegfs_common_package`} set +e # test if redhat-rpm-config is installed. If so, we must not specify # %debug_package in the spec file, if not installed we need to define it # in order to strip binaries and to build a debug package rpm -qa redhat-rpm-config | grep redhat-rpm-config NEED_DEBUG_DEFINE=$? set -e pushd $TOOLS_ROOT tar czf $BUILD/buildroot/SOURCES/${NAME}-${BEEGFS_VERSION}.tgz --exclude=buildroot/* * cd $BUILD sed -e "s#%BEEGFS_COMMON_PACKAGE_PATH%#$BEEGFS_COMMON_PACKAGE_PATH#g" \ -e "s/%NAME%/$NAME/g" \ -e "s/%BEEGFS_VERSION%/$BEEGFS_VERSION/g" \ -e "s/%BUILDARCH%/$BUILDARCH/g" \ -e "s/%MAKE_CONCURRENCY%/$CONCURRENCY/g" \ -e "s/%NEED_DEBUG_DEFINE%/$NEED_DEBUG_DEFINE/g" \ ${SPEC_FILE}.in > ${SPEC_FILE} rpmbuild --clean -bb ${SPEC_FILE} --define "_topdir $BUILD/buildroot/" -D "ROOT_DIR $ROOT_DIR" popd rm -fr /var/tmp/${NAME}-root/ rm -f /var/tmp/rpm-tmp.* 分析RPM配置 查看SPEC中引用的参数,正式上面的脚本替换后的结果: $ cat beegfs_meta/build/beegfs-meta.spec %define buildarch x86_64 %define BEEGFS_COMMON_PACKAGE_PATH /root/beegfs-v6/fhgfs_common_package %define BEEGFS_VERSION %VER%-%RELEASE_STR% %define MAKE_CONCURRENCY 4 %define NEED_DEBUG_DEFINE 0 %define BEEGFS_VERSION 19.4-git17 %define VER %(echo '%{BEEGFS_VERSION}' | cut -d - -f 1) %define BEEGFS_RELEASE_STR %(echo '%{BEEGFS_VERSION}-' | cut -d - -f 2) %define EPOCH %(echo '%{VER}' | cut -d . -f 1) ... %build cd build make \ root-dir=%{ROOT_DIR} \ BEEGFS_VERSION=%{BEEGFS_VERSION} \ -j %{MAKE_CONCURRENCY} ... $ grep -rHn root-dir beegfs_meta beegfs_meta/build/Makefile:8:include $(or $(root-dir),../..)/build/Makefile beegfs_meta/build/beegfs-meta.spec.in:74: root-dir=%{ROOT_DIR} \ beegfs_meta/build/beegfs-meta.spec:74: root-dir=%{ROOT_DIR} \ 正式开始编译 先编译依赖的函数库: $ make -j$(nproc) -C beegfs_thirdparty/build $ make -j$(nproc) -C beegfs_opentk_lib/build $ make -j$(nproc) -C beegfs_common/build 根据需要编译所需的模块: $ make -j$(nproc) -C beegfs_meta/build clean # make -j$(nproc) -C beegfs_meta/build BEEGFS_DEBUG=1 $ make -j$(nproc) -C beegfs_meta/build [VER] BEEGFS_VERSION="19.5-git9" BEEGFS_VERSION_CODE=18023689 make: Entering directory `/root/beegfs-v6/fhgfs_meta/build' [CXX] ../source/app/App.cpp.o [CXX] ../source/components/DatagramListener.cpp.o [CXX] ../source/app/config/Config.cpp.o ... [CXX] ../source/toolkit/BuddyCommTk.cpp.o [CXX] ../source/toolkit/StorageTkEx.cpp.o [CXX] ../source/toolkit/XAttrTk.cpp.o [LD] beegfs-meta make: Leaving directory `/root/beegfs-v6/fhgfs_meta/build' $ file /root/beegfs-v6/beegfs_meta/build/beegfs-meta /root/beegfs-v6/beegfs_meta/build/beegfs-meta: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=be90bbf04db11b7dcf46d29240b7cb20ab676cf5, not stripped 也可以编译Debug版本,但是要注意,此时前面依赖的函数库也得编译成Debug版本,否则运行时会直接崩溃: $ make -j$(nproc) -C beegfs_meta/build BEEGFS_DEBUG=1 [VER] BEEGFS_VERSION="19.5-git9" BEEGFS_VERSION_CODE=18023689 make: Entering directory `/root/beegfs-v6/fhgfs_meta/build' make: Nothing to be done for `all'. make: Leaving directory `/root/beegfs-v6/fhgfs_meta/build' [root@sacd02 beegfs-v6]# make -j$(nproc) -C beegfs_meta/build rpm [VER] BEEGFS_VERSION="19.5-git9" BEEGFS_VERSION_CODE=18023689 make: Entering directory `/root/beegfs-v6/fhgfs_meta/build' ./make-rpm ~/beegfs-v6/fhgfs_meta ~/beegfs-v6/fhgfs_meta/build ~/beegfs-v6/fhgfs_meta/build redhat-rpm-config-9.1.0-87.el7.centos.noarch ~/beegfs-v6/fhgfs_meta ~/beegfs-v6/fhgfs_meta/build Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.0aowao + umask 022 + cd /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD + cd /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILD + rm -rf beegfs-meta-19.5 + /usr/bin/mkdir -p beegfs-meta-19.5 + cd beegfs-meta-19.5 + /usr/bin/gzip -dc /root/beegfs-v6/fhgfs_meta/build/buildroot/SOURCES/beegfs-meta-19.5-git9.tgz + /usr/bin/tar -xvvf - drwxr-xr-x root/root 0 2019-05-09 10:32 build/ -rw-r--r-- root/root 482 2019-05-08 17:43 build/Makefile -rw-r--r-- root/root 3994 2019-05-08 17:43 build/beegfs-meta.spec.in -rw-r--r-- root/root 199 2019-05-08 17:43 build/config.cpack drwxr-xr-x root/root 0 2019-05-08 17:43 build/debian/ -rw-r--r-- root/root 176 2019-05-08 17:43 build/debian/changelog.in -rw-r--r-- root/root 2 2019-05-08 17:43 build/debian/compat ... -rw-r--r-- root/root 27079 2019-05-08 22:43 source/toolkit/BuddyCommTk.cpp.d -rw-r--r-- root/root 26516 2019-05-08 22:43 source/toolkit/XAttrTk.cpp.d -rw-r--r-- root/root 2571472 2019-05-08 22:43 source/toolkit/StorageTkEx.cpp.o -rw-r--r-- root/root 2405768 2019-05-08 22:43 source/toolkit/XAttrTk.cpp.o -rw-r--r-- root/root 3042288 2019-05-08 22:43 source/toolkit/BuddyCommTk.cpp.o + STATUS=0 + '[' 0 -ne 0 ']' + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.FjeeXr + umask 022 + cd /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD + cd beegfs-meta-19.5 + cd build + make root-dir=/root/beegfs-v6 BEEGFS_VERSION=19.5-git9 -j 4 [VER] BEEGFS_VERSION="19.5-git9" BEEGFS_VERSION_CODE=18023689 make[1]: Entering directory `/root/beegfs-v6/fhgfs_meta/build/buildroot/BUILD/beegfs-meta-19.5/build' make[1]: warning: -jN forced in submake: disabling jobserver mode. make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/root/beegfs-v6/fhgfs_meta/build/buildroot/BUILD/beegfs-meta-19.5/build' + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.OeYWrw + umask 022 + cd /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD + '[' /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 '!=' / ']' + rm -rf /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 ++ dirname /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 + mkdir -p /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT + mkdir /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 + cd beegfs-meta-19.5 + cd build + echo 'mkdir RPM_BUILD_ROOT (/root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64)' mkdir RPM_BUILD_ROOT (/root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64) + mkdir -p /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/etc/beegfs/ + cp -a dist/etc/beegfs-meta.conf /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/etc/beegfs/ + mkdir -p /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/etc/init.d/ + INITSCRIPT=dist/etc/init.d/beegfs-meta.init + install -D dist/etc/init.d/beegfs-meta.init /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/etc/init.d/beegfs-meta + install -D -m644 dist/usr/lib/systemd/system/beegfs-meta.service /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/usr/lib/systemd/system/beegfs-meta.service + GENERIC_INITSCRIPT=/root/beegfs-v6/fhgfs_common_package/build/dist/etc/init.d/beegfs-service.init + cat /root/beegfs-v6/fhgfs_common_package/build/dist/etc/init.d/beegfs-service.init + install -D beegfs-meta /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/opt/beegfs/sbin/beegfs-meta + install -D dist/sbin/beegfs-setup-meta /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/opt/beegfs/sbin/beegfs-setup-meta + install -D dist/etc/default/beegfs-meta /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/etc/default/beegfs-meta + /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD/beegfs-meta-19.5 extracting debug info from /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64/opt/beegfs/sbin/beegfs-meta dwz: Too few files for multifile optimization /usr/lib/rpm/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match. + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars Processing files: beegfs-meta-19.5-git9el7.x86_64 Provides: beegfs-meta = 19:19.5-git9el7 beegfs-meta(x86-64) = 19:19.5-git9el7 config(beegfs-meta) = 19:19.5-git9el7 Requires(interp): /bin/sh /bin/sh Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires(post): /bin/sh Requires(preun): /bin/sh Requires: /bin/bash libbeegfs-opentk.so()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libcppunit-1.12.so.1()(64bit) libdl.so.2()(64bit) libgcc_s.so.1()(64bit) libgcc_s.so.1(GCC_3.0)(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libpthread.so.0(GLIBC_2.3.2)(64bit) libpthread.so.0(GLIBC_2.3.3)(64bit) libpthread.so.0(GLIBC_2.3.4)(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libstdc++.so.6()(64bit) libstdc++.so.6(CXXABI_1.3)(64bit) libstdc++.so.6(CXXABI_1.3.5)(64bit) libstdc++.so.6(GLIBCXX_3.4)(64bit) libstdc++.so.6(GLIBCXX_3.4.11)(64bit) libstdc++.so.6(GLIBCXX_3.4.15)(64bit) libstdc++.so.6(GLIBCXX_3.4.19)(64bit) libstdc++.so.6(GLIBCXX_3.4.9)(64bit) rtld(GNU_HASH) Processing files: beegfs-meta-debuginfo-19.5-git9el7.x86_64 Provides: beegfs-meta-debuginfo = 19:19.5-git9el7 beegfs-meta-debuginfo(x86-64) = 19:19.5-git9el7 Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 Wrote: /root/beegfs-v6/fhgfs_meta/build/buildroot/RPMS/x86_64/beegfs-meta-19.5-git9el7.x86_64.rpm Wrote: /root/beegfs-v6/fhgfs_meta/build/buildroot/RPMS/x86_64/beegfs-meta-debuginfo-19.5-git9el7.x86_64.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.jbV8Ew + umask 022 + cd /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD + cd beegfs-meta-19.5 + rm -rf /root/beegfs-v6/fhgfs_meta/build/buildroot/BUILDROOT/beegfs-meta-19.5-git9el7.x86_64 + exit 0 Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.IPpOum + umask 022 + cd /root/beegfs-v6/fhgfs_meta/build/buildroot//BUILD + rm -rf beegfs-meta-19.5 + exit 0 ~/beegfs-v6/fhgfs_meta/build make: Leaving directory `/root/beegfs-v6/fhgfs_meta/build' $ ll beegfs_meta/build/buildroot/RPMS/x86_64/ total 18036 -rw-r--r-- 1 root root 1165336 May 9 10:33 beegfs-meta-19.5-git9el7.x86_64.rpm -rw-r--r-- 1 root root 17300984 May 9 10:33 beegfs-meta-debuginfo-19.5-git9el7.x86_64.rpm 分析启动脚本 BeeGFS使用Systemd进行管理,其配置文件中直接指定运行程序的路径和参数: $ systemctl status beegfs-meta.service ● beegfs-meta.service - Start BeeGFS Metadata Server Loaded: loaded (/usr/lib/systemd/system/beegfs-meta.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2019-05-08 22:33:19 CST; 10min ago Process: 48475 ExecStop=/etc/init.d/beegfs-meta stop (code=exited, status=0/SUCCESS) Process: 48685 ExecStart=/etc/init.d/beegfs-meta start (code=exited, status=0/SUCCESS) Main PID: 48691 (beegfs-meta/Mai) Tasks: 442 Memory: 363.9M CGroup: /system.slice/beegfs-meta.service └─48691 /opt/beegfs/sbin/beegfs-meta cfgFile=/etc/beegfs/beegfs-meta.conf pidFile=/var/run/beegfs-meta.pid May 08 22:33:19 sacd02 systemd[1]: Starting Start BeeGFS Metadata Server... May 08 22:33:19 sacd02 beegfs-meta[48685]: Starting BeeGFS Meta Server: [ OK ] May 08 22:33:19 sacd02 systemd[1]: Started Start BeeGFS Metadata Server. $ cat /usr/lib/systemd/system/beegfs-meta.service [Unit] Description=Start BeeGFS Metadata Server Requires=network-online.target # We disable the wants service, because it spams the log files #Wants=beegfs-mgmtd.service beegfs-storage.service openibd.service openib.service rdma.service opensmd.service opensm.service After=network-online.target beegfs-mgmtd.service beegfs-storage.service openibd.service openib.service rdma.service opensmd.service opensm.service zfs.target [Service] ExecStart=/etc/init.d/beegfs-meta start ExecStop=/etc/init.d/beegfs-meta stop Type=forking # We disable PIDFile= because it doesn't work with multi-mode configurations #PIDFile=/var/run/beegfs-meta.pid [Install] WantedBy=multi-user.target 为了保持跟早期的SysInitV保持兼容,整整的程序执行脚本在init.d目录中: $ cat /etc/init.d/beegfs-meta #!/bin/bash # ### BEGIN INIT INFO # Provides: beegfs-meta # Required-Start: # Should-Start: $network beegfs-mgmtd beegfs-storage openibd openib rdma opensmd opensm # Required-Stop: # Should-Stop: $network beegfs-mgmtd beegfs-storage openibd openib rdma opensmd opensm # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # chkconfig: 35 95 9 # Short-Description: BeeGFS Meta # Description: Start BeeGFS Meta ### END INIT INFO APP_NAME="BeeGFS Meta Server" SERVICE_NAME=beegfs-meta # source function library . /etc/beegfs/lib/start-stop-functions . /etc/beegfs/lib/init-multi-mode SYSCONFIG_FILE=/etc/default/${SERVICE_NAME} # Check for missing binaries (stale symlinks should not happen) # Note: Special treatment of stop for LSB conformance APP_BIN=/opt/beegfs/sbin/${SERVICE_NAME} test -x $APP_BIN || { echo "$APP_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } source ${SYSCONFIG_FILE} if [ "${MULTI_MODE}" = "YES" -o "${MULTI_MODE}" = "yes" ]; then init_multi_mode $1 $2 exit $? fi # Check for existence of needed config file and read it APP_CONFIG=/etc/beegfs/${SERVICE_NAME}.conf test -r $APP_CONFIG || { echo "$APP_CONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } PIDFILE=/var/run/${SERVICE_NAME}.pid DAEMON_ARGS="cfgFile=${APP_CONFIG} pidFile=$PIDFILE" RETVAL=0 # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - user had insufficient privileges # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl) # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signaling is not supported) are # considered a success. case "$1" in start) if [ -f "${SYSCONFIG_FILE}" ]; then if [ "${START_SERVICE}" = "NO" -o "${START_SERVICE}" = "no" ]; then echo "${APP_NAME} not set to be started" exit 0 fi fi echo -n "Starting ${APP_NAME}: " ## create subfolder for lock files, on Debian systems needed mkdir -p /var/lock/subsys ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. daemon --pidfile $PIDFILE $APP_BIN $DAEMON_ARGS \ && touch /var/lock/subsys/${SERVICE_NAME} RETVAL=$? echo ;; stop) echo -n "Shutting down ${APP_NAME}: " ## Stop daemon with killproc(8) and if this fails ## killproc sets the return value according to LSB. killproc -p $PIDFILE $APP_BIN && rm -f /var/lock/subsys/${SERVICE_NAME} RETVAL=$? echo ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start RETVAL=$? ;; status) echo -n "Checking for service ${APP_NAME}: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Return value is slightly different for the status command: # 0 - service up and running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running (unused) # 4 - service status unknown :-( # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) status -p $PIDFILE $APP_BIN RETVAL=$? echo ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 3 ;; esac exit $RETVAL 运行编译程序 我们只需要把BeeGFS的SysInitV的启动脚本中改成自己编译的程序,就可以直接无缝运行了: $ ps -aux | grep beegfs-meta root 48691 36.7 0.0 33435824 338600 ? Ssl 22:33 4:09 /opt/beegfs/sbin/beegfs-meta cfgFile=/etc/beegfs/beegfs-meta.conf pidFile=/var/run/beegfs-meta.pid root 51229 0.0 0.0 112712 980 pts/1 R+ 22:44 0:00 grep --color=auto beegfs-meta $ vi /etc/init.d/beegfs-meta #APP_BIN=/opt/beegfs/sbin/${SERVICE_NAME} APP_BIN=/root/beegfs-v6/beegfs_meta/build/${SERVICE_NAME} # /root/beegfs-v6/beegfs_meta/build/beegfs-meta cfgFile=/etc/beegfs/beegfs-meta.conf pidFile=/var/run/beegfs-meta.pid $ systemctl stop beegfs-meta.service $ beegfs-ctl --listtargets --state --nodetype=meta TargetID Reachability Consistency NodeID ======== ============ =========== ====== 2 Online Good 2 3 Offline Needs-resync 3 $ systemctl start beegfs-meta.service $ beegfs-ctl --listtargets --state --nodetype=meta TargetID Reachability Consistency NodeID ======== ============ =========== ====== 2 Online Good 2 3 Online resyncing 3 $ systemctl status beegfs-meta.service ● beegfs-meta.service - Start BeeGFS Metadata Server Loaded: loaded (/usr/lib/systemd/system/beegfs-meta.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2019-05-09 11:01:41 CST; 21s ago Process: 60986 ExecStop=/etc/init.d/beegfs-meta stop (code=exited, status=0/SUCCESS) Process: 62824 ExecStart=/etc/init.d/beegfs-meta start (code=exited, status=0/SUCCESS) Main PID: 62834 (beegfs-meta/Mai) Tasks: 441 Memory: 53.4M CGroup: /system.slice/beegfs-meta.service └─62834 /root/beegfs-v6/beegfs_meta/build/beegfs-meta cfgFile=/etc/beegfs/beegfs-meta.conf pidFile=/var/run/beegfs-meta.pid May 09 11:01:40 sacd02 systemd[1]: Starting Start BeeGFS Metadata Server... May 09 11:01:41 sacd02 beegfs-meta[62824]: Starting BeeGFS Meta Server: [ OK ] May 09 11:01:41 sacd02 systemd[1]: Started Start BeeGFS Metadata Server. $ ps -aux | grep beegfs-meta root 62834 146 0.0 33364184 52596 ? Ssl 11:01 6:34 /root/beegfs-v6/beegfs_meta/build/beegfs-meta cfgFile=/etc/beegfs/beegfs-meta.conf pidFile=/var/run/beegfs-meta.pid root 63289 0.0 0.0 112708 980 pts/2 S+ 11:06 0:00 grep --color=auto beegfs-meta

优秀的个人博客,低调大师

服务器搭建个人网站【新手小白】

一丶购买服务器这里我选的是阿里云服务器,进入阿里云官网 阿里云提供了几种服务器,云服务器ESC、轻量应用服务器,ESC更好一点儿,我选了轻量级应用服务器。购买好了之后,在阿里云网站主页→控制台→轻量应用服务器。找到运行中的实例点进去就好了。服务器器就购买好了 二、配置服务器环境首先你要知道怎么把你本机的文件放到你的服务器里去:你在本机上复制文件,远程连接服务器(运行中敲“mstsc”可打开远程连接窗口),在服务器中粘贴即可,就这么简单。你也可以设置本机上的各个盘为共享也是OK的。其次千万要注意:要在阿里云服务器中把你的防火墙的端口打开比如8080,3306之类的,不打开你是访问不了的 (1)JDK和JRE 去官网http://www.oracle.com/technetwork/java/javase/downloads/index.ht

优秀的个人博客,低调大师

Mac免费使用MAMP搭建本地开发环境

打开MAMP 打开偏好设置 设置端口 这里用的是Apache,选择项目路径 到这里可以先运行一下看看是否有端口占用的情况,如果80被占用改成其他的,正常就继续下面的 修改apache文件httpd.conf vi /Applications/MAMP/conf/apache/httpd.conf找到这行把#注释去掉,:wq保存退出Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf 第一步、修改httpd-vhosts.conf文件 vi /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf //配置多个项目就复制多个,主要改两个地方 //DocumentRoot 修改为项目路径 //ServerName 自定义配置本地域名 <VirtualHost *:80> ServerAdmin alf66666@163.com DocumentRoot "/Users/eric/HBuilder/userprofiles/medin/backend/web" ServerName www.m.com ErrorLog "logs/apache_error.log" CustomLog "logs/dummy-host2.example.com-access_log" common </VirtualHost> 第二步、修改系统hosts,需要权限 sudo vi /etc/hosts添加配置的本地域名,就是上面的ServerName 127.0.0.1 www.m.com 第三步、重启MAMP 如果配置多个项目,只需要重复上面三步就可以了 以上步骤做完,可以正常运行了或许有其他报错情况 The requested URL index.php was not found on this server. 如果项目是Nginx运行的,选择Apache也是可以的,在项目目录(第一步配置的DocumentRoot)下添加.htaccess文件 // vi /Applications/MAMP/conf/apache/httpd.conf //修改apache文件httpd.conf //AllowOverride None 改为 AllowOverride All <Directory "/Applications/MAMP/bin/phpPgAdmin"> Options All AllowOverride All Order allow,deny Allow from all </Directory> 如果有端口6379 Redis等报错情况,可能是后端根据本地域名必须包含哪些英文字母来配置不同数据库等等,所以要和后端约定好本地域名规则,按照规则配置域名

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册