CentOS7 systemd管理mysql的一个问题 20C

基础环境版本:
CentOS7.3
原生mysql5.7

我是通过下载官网的rpm包进行安装mysql-server的,

问题现象:
通过使用官网下载的rpm安装好mysql-server后,在配置文件中配置好mysql服务端
图片说明
创建好相关目录,配置好权限后,使用systemct启动应用
但是当我查看启动的mysql进程时,突然发现pid-file是/var/run/mysqld/mysqld.pid,但是我配置中写的是/opt/mysql/3306/tmp/mysqld.pid图片说明
查看了一下,发现/usr/lib/systemd/system/mysqld.service(mysql的systemd注册服务文件)中已经把mysql的pid文件名写死了图片说明
再次尝试修改pid文件路径,改为/opt/mysql/3306/tmp/mysqld.pid图片说明
使用systemctl daemon-reload重新加载mysqd.service文件
再次使用systemctl启动mysqld,但是这时,mysqld进程启动正常,pid文件也写入了正确的路径中,但是systemctl一直没有返回,另起一个section,用systemctl status mysqld查询状态,发现mysqld一直处于activating (start)状态图片说明
这时mysql-server可以正常使用,systemctl start mysqld的进程强制停掉也不会影响正常使用,但mysqld的服务状态也不会变为正常的active (running)
兄弟们有遇到过类似的状况么??求解一下,这个是什么原理?

1个回答

又重新看了一下,/usr/lib/systemd/system/mysqld.service中还有个配置是PIDfile,修改这个配置为/opt/mysql/3306/tmp/mysqld.pid后,就可以正常使用了,但是总觉得这个地方有点怪,本身我的/etc/my.cnf中已经配置了pid的文件路径,但是使用systemd管理mysqld服务的时候还需要在/usr/lib/systemd/system/mysqld.service中对pid文件另外进行配置,感觉这个本身有点问题呀

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求助Centos 7 开机不执行rc.local 服务

本人刚开始接触Centos系统,需要设置开机启动一个QT编译生成的程序。在CSDN中看到很多类似的方法,但是都解决不了我的问题。 目前已经将编写的脚本文件通过/etc/rc.d/rc.local来执行: #!/bin/bash touch /var/lock/subsys/local; cd /home/ie/desktop/test ./test.sh & exit 0 目前在终端中执行./rc.local可以正确执行/home/ie/desktop/test中的test.sh 但是对应的/usr/lib/systemd/system/rc-local.service总是处于以下状态: [root@localhost rc.d]# systemctl status rc-local.service ● rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static; vendor preset: disabled) Active: active (exited) (Result: exit-code) since Thu 2019-02-14 21:02:25 CST; 1h 58min ago Main PID: 42953 (code=exited, status=1/FAILURE) Tasks: 0 CGroup: /system.slice/rc-local.service Feb 14 21:02:25 localhost.localdomain systemd[1]: Starting /etc/rc.d/rc.local Compatibility… Feb 14 21:02:25 localhost.localdomain systemd[1]: Started /etc/rc.d/rc.local Compatibility. Feb 14 21:02:25 localhost.localdomain rc.local[42950]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’ Feb 14 21:02:25 localhost.localdomain rc.local[42950]: qt.qpa.screen: QXcbConnection: Could not connect to display Feb 14 21:02:25 localhost.localdomain rc.local[42950]: Could not connect to any X display. Feb 14 21:02:25 localhost.localdomain systemd[1]: rc-local.service: main process exited, code=exited, status=1/FAILURE 望曾遇到类似问题的朋友来帮忙解决!

CentOS 7 64位使用问题

↓↓↓如图↓↓↓ ![图片说明](https://img-ask.csdn.net/upload/201908/23/1566547725_75479.png) 登陆进去之后,我该如何进入桌面?难道Linux只有命令行? 求教 ![图片说明](https://img-ask.csdn.net/upload/201908/23/1566548325_883719.png)

centos7上用rpmbuild建立rpm安装包问题(急)

centos7.1 php-5.6.25 $ ls rpmbuild/ BUILD BUILDROOT RPMS SOURCES SPECS SRPMS $cat rpmbuild/SPECS/php.spec Name: php Version: 5.6.25 Release: 1%{?dist} Summary: compiled from 5.6.25 by Kevin Group: System Environment/Daemons License: GPL URL: https://secure.php.net Source0: php-5.6.25.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: gcc, gcc-c++, openssl-devel Requires: wireshark-gnome %description php server. Compiled from 5.6.25 by Kevin %prep %setup -q %build ./configure '--with-libdir=lib64' '--prefix=/usr/local/php5.6' '--with-fpm-systemd' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-pdo-mysql' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir' '--with-curl' '--with-openssl' '--with-mcrypt' '--enable-zip' '--enable-intl' make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %defattr(-,root,root,-) /usr/local/php5.6/bin/* /usr/local/php5.6/sbin/* /usr/local/php5.6/include/* /usr/local/php5.6/php/php/fpm/* /usr/local/php5.6/php/man/man1/* /usr/local/php5.6/php/man/man8/* /usr/local/php5.6/lib/php/* /usr/local/php5.6/lib/php/extensions/* /usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/* /usr/local/php5.6/lib/php/build/* /usr/local/php5.6/lib/php/build/shtool/* /usr/local/php5.6/lib/php/.registry/* /usr/local/php5.6/lib/php/.channels/* /usr/local/php5.6/lib/php/Archive/* /usr/local/php5.6/lib/php/doc/* /usr/local/php5.6/lib/php/doc/Archive_Tar/* /usr/local/php5.6/lib/php/doc/Archive_Tar/docs/* /usr/local/php5.6/lib/php/doc/Structures_Graph/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/Structures_Graph/* /usr/local/php5.6/lib/php/doc/Structures_Graph/LICENSE/* /usr/local/php5.6/lib/php/doc/XML_Util/* /usr/local/php5.6/lib/php/doc/XML_Util/examples/* /usr/local/php5.6/lib/php/doc/PEAR/* /usr/local/php5.6/lib/php/doc/PEAR/LICENSE/* /usr/local/php5.6/lib/php/doc/PEAR/INSTALL/* /usr/local/php5.6/lib/php/Console/* /usr/local/php5.6/lib/php/test/* /usr/local/php5.6/lib/php/test/Console_Getopt/* /usr/local/php5.6/lib/php/test/Console_Getopt/tests/* /usr/local/php5.6/lib/php/test/Structures_Graph/* /usr/local/php5.6/lib/php/test/Structures_Graph/tests/* /usr/local/php5.6/lib/php/test/XML_Util/* /usr/local/php5.6/lib/php/test/XML_Util/tests/* /usr/local/php5.6/lib/php/Structures/* /usr/local/php5.6/lib/php/Structures/Graph/* /usr/local/php5.6/lib/php/Structures/Graph/Manipulator/* /usr/local/php5.6/lib/php/XML/* /usr/local/php5.6/lib/php/OS/* /usr/local/php5.6/lib/php/PEAR/* /usr/local/php5.6/lib/php/PEAR/ChannelFile/* /usr/local/php5.6/lib/php/PEAR/Command/* /usr/local/php5.6/lib/php/PEAR/Downloader/* /usr/local/php5.6/lib/php/PEAR/Frontend/* /usr/local/php5.6/lib/php/PEAR/Installer/* /usr/local/php5.6/lib/php/PEAR/Installer/Role/* /usr/local/php5.6/lib/php/PEAR/PackageFile/* /usr/local/php5.6/lib/php/PEAR/PackageFile/Generator/* /usr/local/php5.6/lib/php/PEAR/PackageFile/Parser/* /usr/local/php5.6/lib/php/PEAR/PackageFile/v2/* /usr/local/php5.6/lib/php/PEAR/REST/* /usr/local/php5.6/lib/php/PEAR/Task/* /usr/local/php5.6/lib/php/PEAR/Task/Postinstallscript/* /usr/local/php5.6/lib/php/PEAR/Task/Replace/* /usr/local/php5.6/lib/php/PEAR/Task/Unixeol/* /usr/local/php5.6/lib/php/PEAR/Task/Windowseol/* /usr/local/php5.6/lib/php/PEAR/Validator/* /usr/local/php5.6/lib/php/data/* /usr/local/php5.6/lib/php/data/PEAR/* %config /usr/local/php5.6/etc/* /usr/local/php5.6/var/run/* /usr/local/php5.6/lib/* %dir /usr/local/php5.6/var/log/ %post cp /usr/local/php5.6/etc/php-fpm.conf.default /usr/local/php5.6/etc/php-fpm.conf ln -s /usr/local/php5.6/bin/php /usr/bin/php %changelog * Tue Aug 30 2016 Kevin<kevin_liao@163.com> 5.6.25 - first rpm from php-5.6.25 然后用一个user用户为centos,没在root下执行 $ rpmbuild -ba rpmbuild/SPECS/php.spec 最后报错 Build complete. Don't forget to run 'make test'. + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.QjJHDq + umask 022 + cd /home/centos/rpmbuild/BUILD + '[' /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 '!=' / ']' + rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 ++ dirname /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + mkdir -p /home/centos/rpmbuild/BUILDROOT + mkdir /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + cd php-5.6.25 + rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + make install DESTDIR=/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 Installing shared extensions: /usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ Installing PHP CLI binary: /usr/local/php5.6/bin/ Installing PHP CLI man page: /usr/local/php5.6/php/man/man1/ Installing PHP FPM binary: /usr/local/php5.6/sbin/ Installing PHP FPM config: /usr/local/php5.6/etc/ Installing PHP FPM man page: /usr/local/php5.6/php/man/man8/ Installing PHP FPM status page: /usr/local/php5.6/php/php/fpm/ Installing PHP CGI binary: /usr/local/php5.6/bin/ Installing PHP CGI man page: /usr/local/php5.6/php/man/man1/ Installing build environment: /usr/local/php5.6/lib/php/build/ Installing header files: /usr/local/php5.6/include/php/ Installing helper programs: /usr/local/php5.6/bin/ program: phpize program: php-config Installing man pages: /usr/local/php5.6/php/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/php5.6/lib/php/ [PEAR] Archive_Tar - already installed: 1.4.0 [PEAR] Console_Getopt - already installed: 1.4.1 [PEAR] Structures_Graph- already installed: 1.1.1 [PEAR] XML_Util - already installed: 1.3.0 [PEAR] PEAR - already installed: 1.10.1 Wrote PEAR system config file at: /usr/local/php5.6/etc/pear.conf You may want to add: /usr/local/php5.6/lib/php to your php.ini include_path /home/centos/rpmbuild/BUILD/php-5.6.25/build/shtool install -c ext/phar/phar.phar /usr/local/php5.6/bin ln -s -f phar.phar /usr/local/php5.6/bin/phar Installing PDO headers: /usr/local/php5.6/include/php/ext/pdo/ + /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/centos/rpmbuild/BUILD/php-5.6.25 find: '/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install)

我启动了`php-fpm`,但在我的CentOS7中找不到`php-fpm.sock`文件

<div class="post-text" itemprop="text"> <p>I started the <code>php-fpm</code>, but can not find the <code>php-fpm.sock</code> file in my CentOS7.</p> <p>I use this command installed the php7 and php7-fpm:</p> <pre><code>yum install php70w-common php70w-fpm php70w-opcache php70w-gd php70w-mysqlnd php70w-mbstring php70w-pecl-redis php70w-pecl-memcached php70w-devel </code></pre> <p>I started the php-fpm:</p> <pre><code>/usr/sbin/php-fpm </code></pre> <p>but I can not find the <code>php-fpm.sock</code> file in my CentOS7.2, I can find the <code>php-fpm.pid</code> in there:</p> <pre><code>/var/run/php-fpm/php-fpm.pid </code></pre> <hr> <p><strong>EDIT-01</strong></p> <p>I use the <code>ss -x -a</code>, did not find the <code>php-fpm.sock</code>.</p> <pre><code>$ ss -x -a Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port u_str LISTEN 0 128 /run/lvm/lvmpolld.socket 8458 * 0 u_dgr UNCONN 0 0 /run/systemd/shutdownd 8465 * 0 u_str LISTEN 0 128 /run/docker/libnetwork/d47cac5c2e8dd9490d56a5067ec009db0aa0e0df52b4321c51bff8f6062f6166.sock 110335003 * 0 u_str LISTEN 0 128 /var/run/docker.sock 110329383 * 0 u_dgr UNCONN 0 0 /run/systemd/cgroups-agent 3853374 * 0 u_str LISTEN 0 128 /run/systemd/private 110322498 * 0 u_str LISTEN 0 30 /var/run/NetworkManager/private 9026 * 0 u_dgr UNCONN 0 0 /run/systemd/notify 1355 * 0 u_str LISTEN 0 128 /var/run/dbus/system_bus_socket 9805 * 0 u_str LISTEN 0 128 /run/systemd/journal/stdout 1364 * 0 u_dgr UNCONN 0 0 /run/systemd/journal/socket 1367 * 0 u_dgr UNCONN 0 0 /dev/log 1369 * 0 u_seq LISTEN 0 128 /run/udev/control 3852388 * 0 u_str LISTEN 0 5 /var/run/screen/S-root/9870..www 128997222 * 0 u_str LISTEN 0 128 /var/run/docker/libcontainerd/docker-containerd.sock 110326421 * 0 u_str LISTEN 0 80 /var/lib/mysql/mysql.sock 4072947 * 0 u_str LISTEN 0 128 /run/lvm/lvmetad.socket 8373 * 0 u_str ESTAB 0 0 /run/systemd/journal/stdout 19620 * 18806 u_str ESTAB 0 0 * 18650 * 9123 u_str ESTAB 0 0 /run/systemd/journal/stdout 8155 * 17962 u_dgr UNCONN 0 0 * 110327085 * 1369 u_dgr UNCONN 0 0 * 9025 * 1369 u_str ESTAB 0 0 * 18179 * 19621 u_str ESTAB 0 0 * 8176 * 8175 u_str ESTAB 0 0 * 110322500 * 110325911 u_str ESTAB 0 0 * 15930 * 10704 u_str ESTAB 0 0 * 130300393 * 130300392 u_str ESTAB 0 0 /run/systemd/journal/stdout 110325177 * 110327913 u_str ESTAB 0 0 * 9028 * 15825 u_str ESTAB 0 0 * 130011125 * 130011124 u_str ESTAB 0 0 * 18806 * 19620 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 10705 * 19546 u_str ESTAB 0 0 * 18596 * 8177 u_str ESTAB 0 0 /run/systemd/journal/stdout 4070758 * 4074559 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 19553 * 9145 u_str ESTAB 0 0 /var/run/docker/libcontainerd/docker-containerd.sock 110329386 * 110332150 u_dgr UNCONN 0 0 * 9938 * 1369 u_dgr UNCONN 0 0 * 110322566 * 1369 u_str ESTAB 0 0 /run/systemd/journal/stdout 19621 * 18179 u_dgr UNCONN 0 0 * 9147 * 1369 u_str ESTAB 0 0 /run/systemd/journal/stdout 10704 * 15930 u_str ESTAB 0 0 * 110327913 * 110325177 u_str ESTAB 0 0 * 130011124 * 130011125 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 15825 * 9028 u_dgr UNCONN 0 0 * 18585 * 1367 u_str ESTAB 0 0 * 8175 * 8176 u_str ESTAB 0 0 * 130013581 * 130013580 u_str ESTAB 0 0 * 12146 * 9463 u_str ESTAB 0 0 * 17234 * 21801 u_str ESTAB 0 0 * 3851403 * 3849440 u_dgr UNCONN 0 0 * 3845588 * 1367 u_str ESTAB 0 0 * 9145 * 19553 u_dgr UNCONN 0 0 * 130300389 * 1369 u_str ESTAB 0 0 * 19546 * 10705 u_str ESTAB 0 0 * 130013580 * 130013581 u_str ESTAB 0 0 * 110333809 * 110331364 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 21801 * 17234 u_str ESTAB 0 0 /run/systemd/journal/stdout 8152 * 16751 u_str ESTAB 0 0 /run/systemd/journal/stdout 8151 * 15671 u_str ESTAB 0 0 /run/systemd/journal/stdout 110331364 * 110333809 u_str ESTAB 0 0 * 110322568 * 110322567 u_str ESTAB 0 0 * 4074559 * 4070758 u_str ESTAB 0 0 /run/systemd/journal/stdout 9463 * 12146 u_str ESTAB 0 0 * 17962 * 8155 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 110325911 * 110322500 u_str ESTAB 0 0 /run/systemd/journal/stdout 18006 * 15757 u_dgr UNCONN 0 0 * 3845606 * 3845607 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 9123 * 18650 u_str ESTAB 0 0 * 15757 * 18006 u_str ESTAB 0 0 * 110322567 * 110322568 u_dgr UNCONN 0 0 * 110329381 * 1367 u_dgr UNCONN 0 0 * 3845607 * 3845606 u_str ESTAB 0 0 * 16751 * 8152 u_str ESTAB 0 0 * 110332150 * 110329386 u_str ESTAB 0 0 /var/run/dbus/system_bus_socket 8177 * 18596 u_str ESTAB 0 0 * 15671 * 8151 u_dgr UNCONN 0 0 * 130020259 * 1367 u_str ESTAB 0 0 * 130300392 * 130300393 u_str ESTAB 0 0 /run/systemd/journal/stdout 3849440 * 3851403 </code></pre> </div>

linux 安装 mysql 后出现的问题

我的安装步骤如下: 1. 下载mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz 文件 2.解压_到 /usr/local/mysqlService/目录下 ,解压后的文件夹重命名为mysql 3、运行安装目录下面的 scripts/mysql_install_db 进行安装 4、编辑 /etc/my.cnf 配置如下: [root@localhost ~]# cat /etc/my.cnf [client] socket = /tmp/mysql.sock [mysqld] #character-set-server=utf8 datadir=/usr/local/mysqlService/mysql/data basedir=/usr/local/mysqlService/mysql socket=/tmp/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld_safe] log-error=/usr/local/mysqlService/mysql/log/mysqld.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d [root@localhost ~]# 5、 /etc/my.cnf 中的 socket = /tmp/mysql.sock 是我照着网上写的,我并没有找到mysql.sock 这个文件 6、开始运行 #service mysql start 报错: 170518 17:11:11 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysqlService/mysql/data 2017-05-18 17:11:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for m ore details). 2017-05-18 17:11:11 0 [Note] /usr/local/mysqlService/mysql/bin/mysqld (mysqld 5.6.33) starting as process 27678 ... 2017-05-18 17:11:11 27678 [Note] Plugin 'FEDERATED' is disabled. /usr/local/mysqlService/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist 2017-05-18 17:11:11 27678 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 2017-05-18 17:11:11 27678 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-05-18 17:11:11 27678 [Note] InnoDB: The InnoDB memory heap is disabled 2017-05-18 17:11:11 27678 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-05-18 17:11:11 27678 [Note] InnoDB: Memory barrier is not used 2017-05-18 17:11:11 27678 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-05-18 17:11:11 27678 [Note] InnoDB: Using Linux native AIO 2017-05-18 17:11:11 27678 [Note] InnoDB: Using CPU crc32 instructions 2017-05-18 17:11:11 27678 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-05-18 17:11:11 27678 [Note] InnoDB: Completed initialization of buffer pool 2017-05-18 17:11:11 27678 [Note] InnoDB: Highest supported file format is Barracuda. 2017-05-18 17:11:11 27678 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463 2017-05-18 17:11:11 27678 [Note] InnoDB: Database was not shutdown normally! 2017-05-18 17:11:11 27678 [Note] InnoDB: Starting crash recovery. 2017-05-18 17:11:11 27678 [Note] InnoDB: Reading tablespace information from the .ibd files... 2017-05-18 17:11:11 27678 [Note] InnoDB: Restoring possible half-written data pages 2017-05-18 17:11:11 27678 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 1600607 2017-05-18 17:11:11 27678 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 7 4 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 InnoDB: Apply batch completed 2017-05-18 17:11:12 27678 [Note] InnoDB: 128 rollback segment(s) are active. 2017-05-18 17:11:12 27678 [Note] InnoDB: Waiting for purge to start 2017-05-18 17:11:12 27678 [Note] InnoDB: 5.6.33 started; log sequence number 1600607 2017-05-18 17:11:12 27678 [Note] Server hostname (bind-address): '*'; port: 3306 2017-05-18 17:11:12 27678 [Note] IPv6 is available. 2017-05-18 17:11:12 27678 [Note] - '::' resolves to '::'; 2017-05-18 17:11:12 27678 [Note] Server socket created on IP: '::'. 2017-05-18 17:11:12 27678 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 170518 17:11:12 mysqld_safe mysqld from pid file /usr/local/mysqlService/mysql/data/localhost.localdomain.pid ended 到目前为止,一直报这个错误,我目前还觉得是哪里配置出现了问题,但是网上找了一天,一点进展都没有。希望大神们看到能够帮助我解决这个问题。

centos7服务器中启动防火墙firewalld时间超长停止启动是怎么回事

firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: failed (Result: timeout) since Mon 2019-07-08 10:19:40 CST; 11min ago Docs: man:firewalld(1) Process: 7152 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS) Main PID: 7152 (code=exited, status=0/SUCCESS) 报错之前在防火墙端口处开启了3306端口,并且重载了,

为什么我的php没有呈现? 为什么我的php页面空白?

<div class="post-text" itemprop="text"> <p>I'm trying to setup a wordpress server, but before that I need to get PHP working. Currently I have installed and configured nginx and php 7.3, but the php is not rendering, it is just showing text.</p> <p><strong>Main Issue:</strong> </p> <pre><code>[root@a-knapsack-sav ~]# cat /usr/share/nginx/html/info.php &lt;?php phpinfo(); ?&gt; [root@a-knapsack-sav ~]# curl http://localhost/info.php &lt;?php phpinfo(); ?&gt; </code></pre> <p>Obviously I should expect to see some content from the above, but I'm not. The following is all of the setup that I've done. Hopefully someone can see this and point out my likely omission.</p> <p><strong>What OS are you using?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# rpm -q centos-release centos-release-7-6.1810.2.el7.centos.x86_64 </code></pre> <p><strong>Is nginx even installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# nginx -v nginx version: nginx/1.15.12 </code></pre> <p><strong>Is php even installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# php -v PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies </code></pre> <p><strong>Where is nginx installed?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# pwd /etc/nginx [root@a-knapsack-sav nginx]# ls conf.d fastcgi_params koi-utf koi-win mime.types modules nginx.conf scgi_params sites-available sites-enabled uwsgi_params win-utf </code></pre> <p><strong>Is php-fpm even running?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# systemctl status php-fpm ● php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2019-05-03 10:42:25 CDT; 7h ago Main PID: 2772 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/php-fpm.service ├─2772 php-fpm: master process (/etc/php-fpm.conf) ├─2773 php-fpm: pool www ├─2774 php-fpm: pool www ├─2775 php-fpm: pool www ├─2776 php-fpm: pool www └─2777 php-fpm: pool www </code></pre> <p><strong>Is nginx even running?</strong></p> <pre><code>[root@a-knapsack-sav nginx]# systemctl status nginx ● nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2019-05-03 17:19:55 CDT; 31min ago Docs: http://nginx.org/en/docs/ Process: 4299 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 4302 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS) Main PID: 4303 (nginx) CGroup: /system.slice/nginx.service ├─4303 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf └─4304 nginx: worker process </code></pre> <p><strong>Did you edit you php.ini?</strong> Only the <code>cgi.fix_pathinfo</code> for security.</p> <pre><code>[root@a-knapsack-sav nginx]# cat /etc/php.ini | grep cgi.fix ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; http://php.net/cgi.fix-pathinfo cgi.fix_pathinfo=0 </code></pre> <p><strong>Did you update php's conf settings to for nginx?</strong><br> I think so.</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/php-fpm.d/www.conf | grep listen ; - 'listen' (unixsocket) ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; 'port' - to listen on a TCP socket to all addresses ; '/path/to/unix/socket' - to listen on a unix socket. listen = /var/run/php-fpm/php-fpm.sock ; Set listen(2) backlog. ;listen.backlog = 511 listen.owner = nobody listen.group = nobody ;listen.mode = 0660 ; When set, listen.owner and listen.group are ignored ;listen.acl_users = apache,nginx ;listen.acl_groups = ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address listen.allowed_clients = 127.0.0.1 ; listen queue - the number of request in the queue of pending ; connections (see backlog in listen(2)); ; max listen queue - the maximum number of requests in the queue ; listen queue len - the size of the socket queue of pending connections; ; listen queue: 0 ; max listen queue: 1 ; listen queue len: 42 [root@a-knapsack-sav ~]# cat /etc/php-fpm.d/www.conf | grep nginx user = nginx group = nginx ;listen.acl_users = apache,nginx </code></pre> <p><strong>Did you update nginx's conf properly?</strong> As far as I know to....</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/conf.d/default.conf server { listen 80; # listen [::]:80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~* \.php$ { try_files $uri =404; fastcgi_index index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_NAME $fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> <p><strong>Do you have your info.php file in the correct place?</strong><br> Yezzir.</p> <pre><code>[root@a-knapsack-sav ~]# ls /usr/share/nginx/html 50x.html index.html info.php </code></pre> <p><strong>What about your nginx.conf?</strong></p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/nginx.conf user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*.conf; server_names_hash_bucket_size 64; } </code></pre> <p><strong>What about your sites-available conf?</strong> I don't know if this is needed but I tried it anways.</p> <pre><code>[root@a-knapsack-sav ~]# cat /etc/nginx/sites-available/default.conf server { listen 80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> <p><strong>Did you forget to link sites-enabled and sites-available?</strong> Nope :)</p> <pre><code>[root@a-knapsack-sav ~]# ls -lrt /etc/nginx/sites-enabled total 0 lrwxrwxrwx. 1 root root 39 May 3 12:40 default.conf -&gt; /etc/nginx/sites-available/default.conf </code></pre> <p>I hope this is everything. I think this is everything I've done. The index.html loads when I <code>curl http://localhost</code> but as shown above the info.php is not rendered when called. I think, I've set this up almost correct, but I'm pretty sure I missed something. Please let me know if something seems off. I tried to follow <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7</a> (mysql is on another server). Also if there is any configuration that I need to change so that <code>curl http://A.B.C.D</code> doesn't hang and returns like <code>curl http://localhost</code>, I'd appreciate it. Thanks :)</p> <p>Edit:</p> <p><strong>What is your entire config?</strong></p> <pre><code>[root@a-knapsack-sav ~]# nginx -T nginx: [warn] conflicting server name "A.B.C.D" on 0.0.0.0:80, ignored nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful # configuration file /etc/nginx/nginx.conf: user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*.conf; server_names_hash_bucket_size 64; } # configuration file /etc/nginx/mime.types: types { text/html html htm shtml; text/css css; text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/javascript js; application/atom+xml atom; application/rss+xml rss; text/mathml mml; text/plain txt; text/vnd.sun.j2me.app-descriptor jad; text/vnd.wap.wml wml; text/x-component htc; image/png png; image/svg+xml svg svgz; image/tiff tif tiff; image/vnd.wap.wbmp wbmp; image/webp webp; image/x-icon ico; image/x-jng jng; image/x-ms-bmp bmp; font/woff woff; font/woff2 woff2; application/java-archive jar war ear; application/json json; application/mac-binhex40 hqx; application/msword doc; application/pdf pdf; application/postscript ps eps ai; application/rtf rtf; application/vnd.apple.mpegurl m3u8; application/vnd.google-earth.kml+xml kml; application/vnd.google-earth.kmz kmz; application/vnd.ms-excel xls; application/vnd.ms-fontobject eot; application/vnd.ms-powerpoint ppt; application/vnd.oasis.opendocument.graphics odg; application/vnd.oasis.opendocument.presentation odp; application/vnd.oasis.opendocument.spreadsheet ods; application/vnd.oasis.opendocument.text odt; application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; application/vnd.wap.wmlc wmlc; application/x-7z-compressed 7z; application/x-cocoa cco; application/x-java-archive-diff jardiff; application/x-java-jnlp-file jnlp; application/x-makeself run; application/x-perl pl pm; application/x-pilot prc pdb; application/x-rar-compressed rar; application/x-redhat-package-manager rpm; application/x-sea sea; application/x-shockwave-flash swf; application/x-stuffit sit; application/x-tcl tcl tk; application/x-x509-ca-cert der pem crt; application/x-xpinstall xpi; application/xhtml+xml xhtml; application/xspf+xml xspf; application/zip zip; application/octet-stream bin exe dll; application/octet-stream deb; application/octet-stream dmg; application/octet-stream iso img; application/octet-stream msi msp msm; audio/midi mid midi kar; audio/mpeg mp3; audio/ogg ogg; audio/x-m4a m4a; audio/x-realaudio ra; video/3gpp 3gpp 3gp; video/mp2t ts; video/mp4 mp4; video/mpeg mpeg mpg; video/quicktime mov; video/webm webm; video/x-flv flv; video/x-m4v m4v; video/x-mng mng; video/x-ms-asf asx asf; video/x-ms-wmv wmv; video/x-msvideo avi; } # configuration file /etc/nginx/conf.d/default.conf: server { listen 80; # listen [::]:80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~* \.php$ { try_files $uri =404; fastcgi_index index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_param SCRIPT_NAME $fastcgi_script_name; } # location ~ /.ht { # deny all; # } } # configuration file /etc/nginx/fastcgi_params: fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; # configuration file /etc/nginx/conf.d/default_original.conf: server { listen 80; server_name localhost; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #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 /usr/share/nginx/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; #} } # configuration file /etc/nginx/sites-enabled/default.conf: server { listen 80; server_name A.B.C.D; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { try_files $uri =404; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # location ~ /.ht { # deny all; # } } </code></pre> </div>

main函数return -1,服务设置了Restart=on-failure

自己项目上的进程xxx.service上设置了Restart=on-failure,但是实际上测试发现main函数中return -1后进程未自动重启,有人知道是为什么吗? 系统是centos7.0.1406

Linux磁盘100%已用求解答

系统版本 [root@localhost mysql]# cat /etc/centos-release CentOS Linux release 7.3.1611 (Core) [root@localhost mysql]# df -h 文件系统 容量 已用 可用 已用% 挂载点 /dev/mapper/cl-root 50G 50G 20K 100% / devtmpfs 3.9G 0 3.9G 0% /dev tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 3.9G 377M 3.5G 10% /run tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sda1 1014M 139M 876M 14% /boot /dev/mapper/cl-home 198G 23G 175G 12% /home tmpfs 783M 0 783M 0% /run/user/0 [root@localhost mysql]# 这里inode值比较大,是因为/usr文件中文件比较多 [root@localhost mysql]# df -i 文件系统 Inode 已用(I) 可用(I) 已用(I)% 挂载点 /dev/mapper/cl-root 55680 49112 6568 89% / devtmpfs 998610 364 998246 1% /dev tmpfs 1001351 1 1001350 1% /dev/shm tmpfs 1001351 576 1000775 1% /run tmpfs 1001351 16 1001335 1% /sys/fs/cgroup /dev/sda1 524288 330 523958 1% /boot /dev/mapper/cl-home 103346176 25421 103320755 1% /home tmpfs 1001351 1 1001350 1% /run/user/0 [root@localhost mysql]# find /usr | wc -l 44229 注:/home由于挂在另外一个磁盘下,所以可以无视。 那在/dev/mapper/cl-root这块盘下大致就用了(29-23=6G) [root@localhost mysql]# du -sh / 29G [root@localhost mysql]# du -sh /* 0 /bin 106M /boot 0 /dev 30M /etc 23G /home 0 /lib 0 /lib64 0 /media 0 /mnt 0 /proc 69M /root 377M /run 0 /sbin 0 /srv 0 /sys 2.0M /tmp 2.0G /usr 3.5G /var 前面这台机器不归我管,后来出了这个问题让我来弄。 经理说,前面这台机器还好好的,有一天重启了一下,然后就发现mysql启动不了了,查看一下磁盘用了100%了,然后就删了一些日志文件,大概清理了2G,然后重启一下,结果重启完又变成100%,清理出来的2G不见了 已尝试: 1)怀疑过中毒了,但是CPU没有异样,就磁盘有问题 [root@localhost mysql]# top top - 18:43:57 up 27 days, 19:01, 2 users, load average: 0.12, 0.13, 0.27 Tasks: 126 total, 1 running, 125 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.1 us, 2.3 sy, 0.0 ni, 96.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 8010812 total, 141016 free, 2661320 used, 5208476 buff/cache KiB Swap: 8257532 total, 8223976 free, 33556 used. 4563024 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9220 root 20 0 6698700 359604 9476 S 5.6 4.5 733:59.96 java 12082 root 20 0 6449520 1.702g 12528 S 2.6 22.3 36:43.26 java 25297 root 20 0 357720 9564 2252 S 2.3 0.1 442:00.22 xfrpc 32298 root 20 0 430396 9236 2256 S 2.3 0.1 437:20.19 xfrpc 3133 root 20 0 169688 10560 1104 S 0.7 0.1 114:14.54 redis-server 2993 root 20 0 157704 2216 1536 R 0.3 0.0 0:00.05 top 1 root 20 0 45816 5408 3004 S 0.0 0.1 1:05.65 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:01.04 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:13.22 ksoftirqd/0 7 root rt 0 0 0 0 S 0.0 0.0 0:03.42 migration/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root 20 0 0 0 0 S 0.0 0.0 29:27.01 rcu_sched 10 root rt 0 0 0 0 S 0.0 0.0 0:22.34 watchdog/0 11 root rt 0 0 0 0 S 0.0 0.0 0:22.23 watchdog/1 12 root rt 0 0 0 0 S 0.0 0.0 0:01.89 migration/1 13 root 20 0 0 0 0 S 0.0 0.0 0:23.27 ksoftirqd/1 16 root rt 0 0 0 0 S 0.0 0.0 0:23.70 watchdog/2 17 root rt 0 0 0 0 S 0.0 0.0 0:02.59 migration/2 18 root 20 0 0 0 0 S 0.0 0.0 0:22.26 ksoftirqd/2 2)主要运行的程序有 tomcat,redis,mosquitto 我已经排除了tomcat日志过大的问题,我重启过tomcat,如果过大的话,重启的时候已经没掉了。 redis占用的内存看了下,也不是很大,才百来兆。 3)losf | grep delete 也已经试过了,没发现有什么占用着 因为重启之后磁盘还是满的,也不太可能是什么进程占用着文件没释放 [root@localhost conf]# lsof | grep deleted tuned 930 root 7u REG 253,0 4096 67161125 /tmp/ffirMlJJF (deleted) gmain 930 2261 root 7u REG 253,0 4096 67161125 /tmp/ffirMlJJF (deleted) tuned 930 2262 root 7u REG 253,0 4096 67161125 /tmp/ffirMlJJF (deleted) tuned 930 2263 root 7u REG 253,0 4096 67161125 /tmp/ffirMlJJF (deleted) tuned 930 2264 root 7u REG 253,0 4096 67161125 /tmp/ffirMlJJF (deleted) [root@localhost conf]# 4)磁盘坏了~ 如果是这种情况,就莫得办法咯。 求大神帮忙~先谢过了。

/var/log/messages报错,很多节点都是,快崩溃。segfault at 30 ip

Aug 1 09:29:37 gg1131 sshd[15554]: Accepted publickey for nscc567_DL from 20.3.10.20 port 51056 ssh2 Aug 1 09:29:39 gg1131 kernel: [1512610.409422] l302.exel[15600]: segfault at 30 ip 0000000000eebf0b sp 00002ab270e7fa50 error 4 in l302. exel[400000+b63000] Aug 1 09:29:39 gg1131 sshd[15612]: Accepted publickey for nscc567_DL from 20.3.10.20 port 51065 ssh2 Aug 1 09:29:41 gg1131 kernel: [1512612.282235] l401.exel[15657]: segfault at 30 ip 0000000000fb4aab sp 00002b98ee7cca50 error 4 in l401. exel[400000+c36000] Aug 1 09:29:41 gg1131 sshd[15664]: Accepted publickey for nscc567_DL from 20.3.10.20 port 51075 ssh2 Aug 1 09:30:01 gg1131 /usr/sbin/cron[16183]: (root) CMD ([ -x /usr/lib64/sa/sa1 ] && exec /usr/lib64/sa/sa1 -S ALL 1 1) Aug 1 09:30:27 gg1131 gdm-session-worker[9550]: PAM pam_putenv: NULL pam handle passed Aug 1 09:31:27 gg1131 kernel: [1512717.900750] l502.exel[15709]: segfault at 30 ip 000000000128654b sp 00002ae6338d3a50 error 4 in l502. exel[400000+f13000] Aug 1 09:31:27 gg1131 sshd[16875]: Accepted publickey for nscc567_DL from 20.3.10.20 port 51098 ssh2 Aug 1 09:31:28 gg1131 kernel: [1512719.344404] l701.exel[16922]: segfault at 30 ip 000000000115fa5b sp 00002b3c4190ba50 error 4 in l701. exel[400000+ddd000] Aug 1 09:31:28 gg1131 sshd[16929]: Accepted publickey for nscc567_DL from 20.3.10.20 port 51108 ssh2 Aug 1 09:31:50 gg1131 kernel: [1512741.183293] l703.exel[16974]: segfault at 30 ip 0000000000f16e4b sp 00002ac220d43a50 error 4 in l703. exel[400000+b87000] Aug 1 09:31:51 gg1131 sshd[17149]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54222 ssh2 Aug 1 09:31:54 gg1131 kernel: [1512744.926539] l302.exel[17509]: segfault at 30 ip 0000000000eebf0b sp 00002b5189d1ea50 error 4 in l302. exel[400000+b63000] Aug 1 09:31:54 gg1131 sshd[17522]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54232 ssh2 Aug 1 09:31:56 gg1131 kernel: [1512746.929391] l401.exel[17567]: segfault at 30 ip 0000000000fb4aab sp 00002af9a0221a50 error 4 in l401. exel[400000+c36000] Aug 1 09:31:56 gg1131 sshd[17574]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54240 ssh2 Aug 1 09:32:58 gg1131 kernel: [1512808.598603] l502.exel[17619]: segfault at 30 ip 000000000128654b sp 00002abc19e31a50 error 4 in l502. exel[400000+f13000] Aug 1 09:32:58 gg1131 sshd[18227]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54258 ssh2 Aug 1 09:32:59 gg1131 kernel: [1512810.055148] l701.exel[18274]: segfault at 30 ip 000000000115fa5b sp 00002b9c74aa6a50 error 4 in l701. exel[400000+ddd000] Aug 1 09:32:59 gg1131 sshd[18281]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54267 ssh2 Aug 1 09:33:20 gg1131 kernel: [1512831.065113] l703.exel[18330]: segfault at 30 ip 0000000000f16e4b sp 00002ac636233a50 error 4 in l703. exel[400000+b87000] Aug 1 09:33:21 gg1131 sshd[18404]: Accepted publickey for nscc567_DL from 20.3.10.20 port 54280 ssh2 Aug 1 09:33:23 gg1131 kernel: [1512834.192715] l302.exel[18449]: segfault at 30 ip 0000000000eebf0b sp 00002b8c8fcb6a50 error 4 in l302. exel[400000+b63000] --More--

Php-fpm不会监听端口

<div class="post-text" itemprop="text"> <p>I have been trying to get php-fpm (w nginx) to work with the default port(9000) and it just does not work.I am trying to use php 7.1 (also tried 7.0 and 5.6). The service started fine and I can also see the port open and being listened in ss/netstat. There are no errors in the php-fpm log. Initially I thought it could be an nginx issue, But when I try to test the connection directly using cgi-fcgi -bind -connect 127.0.0.1:9000 it just does not respond and I eventually get a could not connect error. The request doesnot get logged in the access log (when access log enabled).</p> <pre><code> # cgi-fcgi -bind -connect 127.0.0.1:9000 Could not connect to 127.0.0.1:9000 </code></pre> <p>And some times after a restart it just randomly works for a few requests (sometimes 1 request, sometimes 10, varies) and then it just stops working again. The request count in the php-fpm status no longer increases. There is no rhyme or rythm to its behaviour and I could not find a consistent way to get it to work even for those few requests.<br> The issue has been haunting me for 2 days now and its soo inconsistent with nothing in logs. Please help. Thanks for the replies in advance.</p> <p><br> <br> <strong>What I tried so far -</strong> </p> <ol> <li>Tested with nginx to make sure that its not <em>cgi-fcgi</em> issue. Same problem in nginx too could not connect to upstream.</li> <li>Setting the php-fpm log level to debug to see if something pops up. Nothing out of the ordinary found.</li> <li>Enabling access log to see if the request atleast reaches php-fpm. <em>No entry in the access log for the failed requests.</em></li> <li>Changed <em>listen</em> value to 9000 and 0.0.0.0:9000 and the external_ip:9000. All of these changes didnot change the behaviour.</li> <li>Changed to other ports to ensure its not the port number being in use.</li> <li>Increased and decreased <em>pm.start_servers</em> along with other related values to check if its processes running out. Didnot effect, infact all process just idle all the time.</li> <li>Removing and re installing php-fpm</li> <li>Resetting the config to ensure its not a config issue</li> <li>Installing php-fpm from remi repo instead of webstatic repo to ensure its not a bad build</li> <li>Downgrading to php 7.0</li> <li>Stopping all other services to make sure there are no conflicts or alike</li> <li>Change listen.allowed_clients to 'any' to make sure that its not the client being rejected</li> <li>Nuked the server and reinstalled the OS itself to ensure that its not an OS issue after trying multiple things for 2 days straight. (Empty server with no data)</li> <li>It does work absolutely fine with a unix socket instead of port. But a socket will not work for the requirement as if it needs to get anything more than a 100 rows from mysql, I noticed it to just timeout (&gt; 30s) in socket mode.</li> </ol> <p><br> <br></p> <p><strong>Information &amp; Config Below</strong></p> <p>Operating System - CentOS 7</p> <p>PHP-FPM Service status</p> <pre><code> #service php-fpm status Redirecting to /bin/systemctl status php-fpm.service * php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled) Active: active (running) since Sun 2017-04-16 17:12:06 EDT; 14s ago Main PID: 2392 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/php-fpm.service |-2392 php-fpm: master process (/etc/php-fpm.conf) |-2393 php-fpm: pool www |-2394 php-fpm: pool www |-2395 php-fpm: pool www |-2396 php-fpm: pool www `-2397 php-fpm: pool www Apr 16 17:12:06 2740.servermania.com systemd[1]: Starting The PHP FastCGI Pr.... Apr 16 17:12:06 2740.servermania.com systemd[1]: Started The PHP FastCGI Pro.... Hint: Some lines were ellipsized, use -l to show in full. </code></pre> <p>Socketstat / netstat . (Last one is php-fpm)</p> <pre><code> # ss -tapn State Recv-Q Send-Q Local Address:Port Peer Address:Port Cannot open netlink socket: Protocol not supported LISTEN 0 0 *:111 *:* users:(("rpcbind",pid=1588,fd=4),("systemd",pid=1,fd=42)) LISTEN 0 0 *:80 *:* users:(("httpd",pid=1871,fd=3),("httpd",pid=1870,fd=3)) LISTEN 0 0 *:22 *:* users:(("sshd",pid=1512,fd=3)) LISTEN 0 0 127.0.0.1:25 *:* users:(("sendmail",pid=416,fd=4)) LISTEN 0 0 127.0.0.1:9000 *:* users:(("php-fpm",pid=2397,fd=0),("php-fpm",pid=2396,fd=0),("php-fpm",pid=2395,fd=0),("php-fpm",pid=2394,fd=0),("php-fpm",pid=2393,fd=0),("php-fpm",pid=2392,fd=6)) </code></pre> <p>The default php-fpm config I am currently trying to get to work.( My config is not working, hence trying to get it to work atleast in default). </p><pre><code>; Start a new pool named 'www'. [www] <pre><code>; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = apache ; RPM: Keep a group allowed to write in log dir. group = apache ; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = 127.0.0.1:9000 ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) ;listen.backlog = 511 ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many ; BSD-derived systems allow connections regardless of permissions. ; Default Values: user and group are set as the running user ; mode is set to 0660 ;listen.owner = nobody ;listen.group = nobody ;listen.mode = 0660 ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. ; When set, listen.owner and listen.group are ignored ;listen.acl_users = ;listen.acl_groups = ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be ; accepted from any ip address. ; Default Value: any listen.allowed_clients = any ; Specify the nice(2) priority to apply to the pool processes (only if set) ; The value can vary from -19 (highest priority) to 20 (lower priority) ; Note: - It will only work if the FPM master process is launched as root ; - The pool processes will inherit the master process priority ; unless it specified otherwise ; Default Value: no set ; process.priority = -19 ; Choose how the process manager will control the number of child processes. ; Possible Values: ; static - a fixed number (pm.max_children) of child processes; ; dynamic - the number of child processes are set dynamically based on the ; following directives. With this process management, there will be ; always at least 1 children. ; pm.max_children - the maximum number of children that can ; be alive at the same time. ; pm.start_servers - the number of children created on startup. ; pm.min_spare_servers - the minimum number of children in 'idle' ; state (waiting to process). If the number ; of 'idle' processes is less than this ; number then some children will be created. ; pm.max_spare_servers - the maximum number of children in 'idle' ; state (waiting to process). If the number ; of 'idle' processes is greater than this ; number then some children will be killed. ; ondemand - no children are created at startup. Children will be forked when ; new requests will connect. The following parameter are used: ; pm.max_children - the maximum number of children that ; can be alive at the same time. ; pm.process_idle_timeout - The number of seconds after which ; an idle process will be killed. ; Note: This value is mandatory. pm = dynamic ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. ; This value sets the limit on the number of simultaneous requests that will be ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP ; CGI. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. pm.max_children = 50 ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 pm.start_servers = 5 ; The desired minimum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' pm.min_spare_servers = 5 ; The desired maximum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' pm.max_spare_servers = 35 ; The number of seconds after which an idle process will be killed. ; Note: Used only when pm is set to 'ondemand' ; Default Value: 10s ;pm.process_idle_timeout = 10s; ; The number of requests each child process should execute before respawning. ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 ;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: ; pool - the name of the pool; ; process manager - static, dynamic or ondemand; ; start time - the date and time FPM has started; ; start since - number of seconds since FPM has started; ; accepted conn - the number of request accepted by the pool; ; listen queue - the number of request in the queue of pending ; connections (see backlog in listen(2)); ; max listen queue - the maximum number of requests in the queue ; of pending connections since FPM has started; ; listen queue len - the size of the socket queue of pending connections; ; idle processes - the number of idle processes; ; active processes - the number of active processes; ; total processes - the number of idle + active processes; ; max active processes - the maximum number of active processes since FPM ; has started; ; max children reached - number of times, the process limit has been reached, ; when pm tries to start more children (works only for ; pm 'dynamic' and 'ondemand'); ; Value are updated in real time. ; Example output: ; pool: www ; process manager: static ; start time: 01/Jul/2011:17:53:49 +0200 ; start since: 62636 ; accepted conn: 190460 ; listen queue: 0 ; max listen queue: 1 ; listen queue len: 42 ; idle processes: 4 ; active processes: 11 ; total processes: 15 ; max active processes: 12 ; max children reached: 0 ; ; By default the status page output is formatted as text/plain. Passing either ; 'html', 'xml' or 'json' in the query string will return the corresponding ; output syntax. Example: ; http://www.foo.bar/status ; http://www.foo.bar/status?json ; http://www.foo.bar/status?html ; http://www.foo.bar/status?xml ; ; By default the status page only outputs short status. Passing 'full' in the ; query string will also return status for each pool process. ; Example: ; http://www.foo.bar/status?full ; http://www.foo.bar/status?json&amp;full ; http://www.foo.bar/status?html&amp;full ; http://www.foo.bar/status?xml&amp;full ; The Full status returns for each process: ; pid - the PID of the process; ; state - the state of the process (Idle, Running, ...); ; start time - the date and time the process has started; ; start since - the number of seconds since the process has started; ; requests - the number of requests the process has served; ; request duration - the duration in 袖s of the requests; ; request method - the request method (GET, POST, ...); ; request URI - the request URI with the query string; ; content length - the content length of the request (only with POST); ; user - the user (PHP_AUTH_USER) (or '-' if not set); ; script - the main script called (or '-' if not set); ; last request cpu - the %cpu the last request consumed ; it's always 0 if the process is not in Idle state ; because CPU calculation is done when the request ; processing has terminated; ; last request memory - the max amount of memory the last request consumed ; it's always 0 if the process is not in Idle state ; because memory calculation is done when the request ; processing has terminated; ; If the process is in Idle state, then informations are related to the ; last request the process has served. Otherwise informations are related to ; the current request being served. ; Example output: ; ************************ ; pid: 31330 ; state: Running ; start time: 01/Jul/2011:17:53:49 +0200 ; start since: 63087 ; requests: 12808 ; request duration: 1250261 ; request method: GET ; request URI: /test_mem.php?N=10000 ; content length: 0 ; user: - ; script: /home/fat/web/docs/php/test_mem.php ; last request cpu: 0.00 ; last request memory: 0 ; ; Note: There is a real-time FPM status monitoring sample web page available ; It's available in: @EXPANDED_DATADIR@/fpm/status.html ; ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set pm.status_path = /status ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; URI will be recognized as a ping page. This could be used to test from outside ; that FPM is alive and responding, or to ; - create a graph of FPM availability (rrd or such); ; - remove a server from a group if it is not responding (load balancing); ; - trigger alerts for the operating team (24/7). ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set ping.path = /ping ; This directive may be used to customize the response of a ping request. The ; response is formatted as text/plain with a 200 response code. ; Default Value: pong ;ping.response = pong ; The access log file ; Default: not set access.log = /var/log/php-fpm/access.log ; The access log format. ; The following syntax is allowed ; %%: the '%' character ; %C: %CPU used by the request ; it can accept the following format: ; - %{user}C for user CPU only ; - %{system}C for system CPU only ; - %{total}C for user + system CPU (default) ; %d: time taken to serve the request ; it can accept the following format: ; - %{seconds}d (default) ; - %{miliseconds}d ; - %{mili}d ; - %{microseconds}d ; - %{micro}d ; %e: an environment variable (same as $_ENV or $_SERVER) ; it must be associated with embraces to specify the name of the env ; variable. Some exemples: ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e ; %f: script filename ; %l: content-length of the request (for POST request only) ; %m: request method ; %M: peak of memory allocated by PHP ; it can accept the following format: ; - %{bytes}M (default) ; - %{kilobytes}M ; - %{kilo}M ; - %{megabytes}M ; - %{mega}M ; %n: pool name ; %o: output header ; it must be associated with embraces to specify the name of the header: ; - %{Content-Type}o ; - %{X-Powered-By}o ; - %{Transfert-Encoding}o ; - .... ; %p: PID of the child that serviced the request ; %P: PID of the parent of the child that serviced the request ; %q: the query string ; %Q: the '?' character if query string exists ; %r: the request URI (without the query string, see %q and %Q) ; %R: remote IP address ; %s: status (response code) ; %t: server time the request was received ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) ; The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %T: time the log has been written (the request has finished) ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) ; The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %u: remote user ; ; Default: "%R - %u %t \"%m %r\" %s" ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set slowlog = /var/log/php-fpm/www-slow.log ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 ;request_slowlog_timeout = 0 ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 ;request_terminate_timeout = 0 ; Set open file descriptor rlimit. ; Default Value: system defined value ;rlimit_files = 1024 ; Set max core size rlimit. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value ;rlimit_core = 0 ; Chroot to this directory at the start. This value must be defined as an ; absolute path. When this value is not set, chroot is not used. ; Note: chrooting is a great security feature and should be used whenever ; possible. However, all PHP paths will be relative to the chroot ; (error_log, sessions.save_path, ...). ; Default Value: not set ;chroot = ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot ;chdir = /var/www ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs. ; Note: on highloaded environement, this can cause some delay in the page ; process time (several ms). ; Default Value: no ;catch_workers_output = yes ; Clear environment in FPM workers ; Prevents arbitrary environment variables from reaching FPM worker processes ; by clearing the environment in workers before env vars specified in this ; pool configuration are added. ; Setting to "no" will make all environment variables available to PHP code ; via getenv(), $_ENV and $_SERVER. ; Default Value: yes ;clear_env = no ; Limits the extensions of the main script FPM will allow to parse. This can ; prevent configuration mistakes on the web server side. You should only limit ; FPM to .php extensions to prevent malicious users to use other extensions to ; exectute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php ;security.limit_extensions = .php .php3 .php4 .php5 .php7 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. ; Default Value: clean env ;env[HOSTNAME] = $HOSTNAME ;env[PATH] = /usr/local/bin:/usr/bin:/bin ;env[TMP] = /tmp ;env[TMPDIR] = /tmp ;env[TEMP] = /tmp ; Additional php.ini defines, specific to this pool of workers. These settings ; overwrite the values previously defined in the php.ini. The directives are the ; same as the PHP SAPI: ; php_value/php_flag - you can set classic ini defines which can ; be overwritten from PHP call 'ini_set'. ; php_admin_value/php_admin_flag - these directives won't be overwritten by ; PHP call 'ini_set' ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. ; Defining 'extension' will load the corresponding shared extension from ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not ; overwrite previously defined php.ini values, but will append the new value ; instead. ; Default Value: nothing is defined by default except the values in php.ini and ; specified at startup with the -d argument ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com ;php_flag[display_errors] = off php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on ;php_admin_value[memory_limit] = 128M ; Set session path to a directory owned by process user php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/php/session php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache </code></pre> <p></p></code></pre> <p>PHP-FPM Error log</p> <pre><code> [16-Apr-2017 17:12:06] NOTICE: fpm is running, pid 2392 [16-Apr-2017 17:12:06] NOTICE: ready to handle connections [16-Apr-2017 17:12:06] NOTICE: systemd monitor interval set to 10000ms </code></pre> <p>Telnet output</p> <pre><code> # telnet 127.0.0.1 9000 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection timed out </code></pre> </div>

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

抖音上很火的时钟效果

反正,我的抖音没人看,别人都有几十万个赞什么的。 发到CSDN上来,大家交流下~ 主要用到原生态的 JS+CSS3。 具体不解释了,看注释: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/tit...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

手机经常收到"回复TD退订",回还是不回?今天总算是弄清楚了

自从有了微信和QQ,手机短信几乎很少再用了,但是我们手机里面还是经常会收到"回复TD退订"的消息,那到底要不要回复呢?今天就来告诉大家! 信息内容可能包括 推销信息 品牌活动日的时候,会根据你的用户浏览信息,或者购买记录,后续发送一些降价消息。 但是笔者想说我是缺那10块钱的人嘛,我缺的是1000块。 垃圾信息 虽然我们已经不经常用短信功能,但是还是有不少...

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试官问我:如何加载100M的图片却不撑爆内存

还记得当年面试一个面试官问我怎么加载巨图才能不撑爆内存,我没回答上来,他说分片显示,我寻思特么分片能减少内存使用??现在可以打他脸了! 内容扩展 1.图片的三级缓存中,图片加载到内存中,如果内存快爆了,会发生什么?怎么处理? 2.内存中如果加载一张 500*500 的 png 高清图片.应该是占用多少的内存? 3.Bitmap 如何处理大图,如一张 30M 的大图,如何预防 OOM? A...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

又出事了?网站被攻击了?高中生?

北京时间2020年3月27日9点整,如往常一样来到公司,带开电脑,正准备打开Github网站看一会源代码,再开始手头的工作。哟吼,一直打不开,一直出现如下页面: 我想很多网友也尝到了甜头,各大技术群炸开了锅,据网友反馈有攻击者正在发起大规模的中间人挟持,京东和Github等网站等网站都受到了影响。 什么是中间中间人挟持呢? 简而言之,就是攻击者在数据网络传输的过程中,截获传输过程中的数据并篡改...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

6年开发经验女程序员,面试京东Java岗要求薪资28K

写在开头: 上周面试了一位女程序员,上午10::30来我们部门面试,2B哥接待了她.来看看她的简历: 个人简历 个人技能: ● 熟悉spring mvc 、spring、mybatis 等框架 ● 熟悉 redis 、rocketmq、dubbo、zookeeper、netty 、nginx、tomcat、mysql。 ● 阅读过juc 中的线程池、锁的源...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

推荐9个能让你看一天的网站

分享的这9个保证另你意外的网站,每个都非常实用!非常干货!毫不客气的说,这些网站最少值10万块钱。 利用好这些网站,会让你各方面的技能都得到成长,不说让你走上人生巅峰,但对比现在的你,在眼界、学识、技能方面都有质的飞跃。 一、AIRPANO 传送门:https://www.airpano.com/360photo_list.php 这是一个可以躺在家里,就能环游世界的神奇网站。 世界那么大,绝大多...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

月薪22K程序员,打卡迟到10次,收到工资短信一脸懵逼

每家公司为了保证公司员工每天的工作时间,一般都会采用上下班打卡的工作制度,这其实是一个很常见的是,本身也没有什么问题的。正所谓无规矩不成方圆,公司肯定是有公司的规矩,虽然每个员工都很不喜欢这些规矩来束缚我们,但是公司也只是为了能更好的管理员工。但是一家公司如果一成不变的使用打卡制度,而不会去变通管理,也真不一定是好事。 打卡制度特别对于销售部门来说,不但会让公司发展不起来,还很容易丢失员工。但如...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

我真的错了,我被跳槽后的高薪冲昏了头脑...

国内疫情已接近尾声,疫情对生活各个方面造成的影响,就是一场真实的“蝴蝶效应”。“全球最大安全套制造商因疫情停产,已造成一亿个安全套缺口”“口罩印钞机,月入千万的暴富神话”“百程旅行...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

​能让德国人放弃现金支付​,也没谁了

在新冠疫情中,德国人越来越多地选择在超市,加油站或其他商店付款时使用非接触式付款方式。德国信贷协会Deutschen Kreditwirtschaft (DK) 的一位发言人告诉德国新...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

工作两年简历写成这样,谁要你呀!

作者:小傅哥 博客:https://bugstack.cn 沉淀、分享、成长,让自己和他人都能有所收获! 一、前言 最近有伙伴问小傅哥,我的简历怎么投递了都没有反应,心里慌的很呀。 工作两年了目前的公司没有什么大项目,整天的维护别人的代码,有坑也不让重构,都烦死了。荒废我一身技能无处施展,投递的简历也没人看。我是不动物园里的猩猩,狒狒了! 我要加班,我要996,我要疯狂编码,求给我个机会… ...

在拼多多上班,是一种什么样的体验?我心态崩了呀!

之前有很多读者咨询我:武哥,在拼多多上班是一种什么样的体验?由于一直很忙,没抽出时间来和大家分享。上周末特地花点时间来写了一篇文章,跟大家分享一下拼多多的日常。 1. 倒时差的作息 可能很多小伙伴都听说了,拼多多加班很严重。这怎么说呢?作息上确实和其他公司有点区别,大家知道 996,那么自然也就能理解拼多多的“11 11 6”了。 所以当很多小伙伴早上出门时,他们是这样的: 我们是这样的: 当...

又一起程序员被抓事件

就在昨天互联网又发生一起让人心酸的程序员犯罪事件,著名的百度不限速下载软件 Pandownload PC 版作者被警方抓获。案件大致是这样的:软件的作者不仅非法盗取用户数据,还在QQ群进...

应聘3万的职位,有必要这么刁难我么。。。沙雕。。。

又一次被面试官带到坑里面了。面试官:springmvc用过么?我:用过啊,经常用呢面试官:springmvc中为什么需要用父子容器?我:嗯。。。没听明白你说的什么。面试官:就是contr...

相关热词 c# 局部 截图 页面 c#实现简单的文件管理器 c# where c# 取文件夹路径 c# 对比 当天 c# fir 滤波器 c# 和站 队列 c# txt 去空格 c#移除其他类事件 c# 自动截屏
立即提问