systemd

running two instances of gunicorn

安稳与你 提交于 2019-12-21 06:28:34
问题 Trying to run two sites on gunicorn editing the service from [Unit] Description=gunicorn daemon After=network.target [Service] User=ubuntu Group=www-data WorkingDirectory=/home/ubuntu/webapps/kenyabuzz ExecStart=/home/ubuntu/webapps/djangoenv/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/webapps/kenyabuzz/kb.sock kb.wsgi:application [Install] WantedBy=multi-user.target to [Unit] Description=gunicorn daemon After=network.target [Service] User=ubuntu Group=www-data WorkingDirectory=/home

systemctl命令

南笙酒味 提交于 2019-12-21 02:53:01
Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器。 Systemd是一个系统管理守护进程、工具和库的集合,用于取代System V初始进程。Systemd的功能是用于集中管理和配置类UNIX系统。 在Linux生态系统中,Systemd被部署到了大多数的标准Linux发行版中,只有为数不多的几个发行版尚未部署。Systemd通常是所有其它守护进程的父进程,但并非总是如此。 服务所在位置: /usr/lib/systemd/system/ 新旧指令比较: 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service 使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd .service 检查服务状态 service httpd status systemctl status httpd.service (服务详细信息) systemctl is-enabled httpd.service (仅显示是否 Active) 显示所有已启动的服务 chkconfig --list systemctl list -units --type=service 启动某服务 service

Docker上运行MySQL服务

馋奶兔 提交于 2019-12-21 00:49:28
1.搜索MySQL镜像 $ docker search mysql INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED docker.io docker.io/mysql MySQL is a widely used, open-source relati... 6008 [OK] docker.io docker.io/mariadb MariaDB is a community-developed fork of M... 1891 [OK] docker.io docker.io/mysql/mysql-server Optimized MySQL Server Docker images. Crea... 427 [OK] docker.io docker.io/percona Percona Server is a fork of the MySQL rela... 335 [OK] 备注:STARS数最多,OFFICIAL是[OK]的这个就是官方的centos镜像。 2.下载MySQL镜像 $ docker pull docker.io/mysql $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/mysql latest 5195076672a7 4

DOCKER_OPTS do not work in config file /etc/default/docker

狂风中的少年 提交于 2019-12-20 08:59:51
问题 I have changed /etc/default/docker with DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock" (docker version 1.4.1 in ubuntu 14.04), but it do not take any effect for me (not listening at port 2375 ). It seems that docker do not read this initial config file because I found export http_proxy enviroment do not work too. Only sudo docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -d works. It really confused me! 回答1: According to docker documentation, The recommended

Raspberry Pi - Autostart OpenCv-Script - Error with cv::imshow()

江枫思渺然 提交于 2019-12-20 06:43:06
问题 Short Description: I want to auto-start an executable (opencv binary file, generate via c++) via a systemd service-script after booting, but I am unsuccessful. I narrowed down the error to the code statement "cv::imshow(....)" which opens a window and displays an image. At this point, the code throws the error: "QXcbConnection: Could not connect to display" However, if I manually execute the sh-script or the binary, both work fine. I searched around stackoverflow for the most common errors,

Airflow Worker Daemon exits for no visible reason

故事扮演 提交于 2019-12-20 01:43:09
问题 I have Airflow 1.9 running inside a virtual environment, set up with Celery and Redis and it works well. However, I wanted to daemon-ize the set up and used the instructions here. It works well for the Webserver, Scheduler and Flower, but fails for the Worker, which is of course, the core of it all. My airflow-worker.service file looks like this: [Unit] Description=Airflow celery worker daemon After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service Wants

linux mysql最大连接数调整

天大地大妈咪最大 提交于 2019-12-20 01:20:51
linux mysql最大连接数调整 1、查看当前最大链接 show variables like 'max_connections'; 2、设置最大链接数 vi /etc/my.cnf ------------------------ max_connections =2000 3、更改 MySQL 在 Linux 的最大文件描述符限制 vi /usr/lib/systemd/system/mysqld.service ------------------- LimitNOFILE=65535 LimitNPROC=65535 4、重启 systemctl daemon-reload systemctl restart mysqld.service 来源: CSDN 作者: Asia1752 链接: https://blog.csdn.net/Asia1752/article/details/103613656

OrangePi 折腾日记:在 Armbian OS 上编译安装 Redis 4

℡╲_俬逩灬. 提交于 2019-12-20 00:28:36
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 最近折腾了一下自己的 Orange Pi PC,意图使之重新焕发青春活力。 很快,我发现了 Armbian 这一为 ARM 开发板定制的 Debian GNU/Linux 操作系统。官网上有 Orange Pi PC 的 主页 ,并为其提供了 Armbian Stretch (Linux Kernel 4.14) 版本的稳定版镜像( 下载 )。Armbian 推荐使用全平台的 SD 刷写工具 etcher 。并提供了完整的 使用手册 。 开机,root 用户登录,默认密码 1234,根据提示重设用户密码。 本想从软件源中直接安装 redis。不过,先将软件源从 debian 官方切换到 USTC。 deb https://mirrors.ustc.edu.cn/debian stretch main contrib non-free deb https://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free #deb https://mirrors.ustc.edu.cn

debian下普通用户操作systemd服务

心已入冬 提交于 2019-12-20 00:17:27
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 问题描述: 使用普通账号test通过systemctl启动系统服务提示需要输入root密码: 解决方案: 根据上面提示得知权限由polkit进行管理,对应的是org.freedesktop.systemd1.policy这个配置文件下的manae-units动作 进入/usr/share/polkit-1/actions/org.freedesktop.systemd1.policy, 将对应manae-units的defaults中的授权全部改为yes,然后执行systemctl restart polkit重启polkit <defaults> <allow_any>yes</allow_any> <allow_inactive>yes</allow_inactive> <allow_active>yes</allow_active> </defaults> 下图为权限可选的配置参数 defaults This element is used to specify implicit authorizations for clients. Elements that can be used inside defaults include: allow_any Implicit authorizations

LVS负载均衡群集——实战篇

拈花ヽ惹草 提交于 2019-12-19 19:16:50
LVS负载均衡群集 环境准备: CentOS 7-1:调度器,网关(需要两块网卡)外:12.0.0.1 内:192.168.200.1 CentOS 7-2:网站服务器(Apache)192.168.200.110 CentOS 7-3:网站服务器(Apache)192.168.200.120 CentOS 7-4:提供共享存储 192.168.200.130 win7-1:客户端 12.0.0.12 yum在线安装前置操作: 1.共享存储服务器CentOS 7-4的操作: [root@localhost ~]# rpm -q nfs-utils nfs-utils-1.3.0-0.48.el7.x86_64 [root@localhost ~]# rpm -q rpcbind rpcbind-0.2.0-42.el7.x86_64 2.节点服务器CentOS 7-2和7-3两台节点服务器: [root@localhost ~]# yum install httpd -y 3.调度器网关CentOS 7-1操作: //要先添加一个网络适配器,成为两个网卡 [root@localhost ~]# yum install ipvsadm -y 共享存储服务器CentOS 7-4: //先将网卡更改为仅主机模式 [root@localhost ~]# vim /etc/sysconfig