linux测试虚拟机
192.168.1.101
root
123456

 

linux测试虚拟机
192.168.1.102
root
123456

 

linux测试虚拟机
192.168.1.103
root
123456

 

 

电脑名称配置etc/hostname

 

[root@serverGTH01 ~]# vi /etc/hostname

[root@serverGTH01 ~]# cat /etc/hostname

serverGTH01

[root@serverGTH01 ~]#

 

[root@serverGTH02 ~]# vim /etc/hostname

[root@serverGTH02 ~]# cat /etc/hostname

serverGTH02

[root@serverGTH02 ~]#

 

[root@localhost ~]# vi /etc/hostname

[root@localhost ~]# cat /etc/hostname

serverGTH03

[root@localhost ~]#

 

 

 

网络配置etc/hosts

 

 

[root@serverGTH01 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.101 serverGTH01

192.168.1.102 serverGTH02

192.168.1.103 serverGTH03

 

[root@serverGTH01 ~]#

 

 

[root@serverGTH02 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.102 serverGTH02

192.168.1.101 serverGTH01

192.168.1.103 serverGTH03

 

[root@serverGTH02 ~]#

 

[root@localhost ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.101 serverGTH01

192.168.1.102 serverGTH02

192.168.1.103 serverGTH03

[root@localhost ~]#

 

一.安装consul service.mash

  1. 安装consul服务发现
    a.查看内核情况

[root@localhost consul]# cat /proc/version

Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018

[root@localhost consul]# lscpu | grep Architecture

Architecture:          x86_64

[root@localhost consul]#

 

 

[root@localhost ~]# mkdir /app/

[root@localhost ~]# mkdir /app/software

[root@localhost ~]# mkdir /app/software/consul

[root@localhost consul]# pwd

/app/software/consul

[root@localhost consul]# unzip consul_1.20.0_linux_amd64.zip -d /usr/local/bin

Archive:  consul_1.20.0_linux_amd64.zip

  inflating: /usr/local/bin/LICENSE.txt

  inflating: /usr/local/bin/consul

[root@localhost consul]#

[root@localhost consul]# consul version

Consul v1.20.0

Revision cddc6181

Build Date 2024-10-14T20:52:01Z

Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

配置文件

[root@localhost consul]# mkdir -p /etc/consul.d

 

[root@localhost consul.d]# pwd

/etc/consul.d

[root@localhost consul.d]# ls

consul_config.json

[root@localhost consul.d]#[root@localhost consul.d]# cat consul_config.json

{

 

  "datacenter": "dcGTH",

 

  "data_dir": "/app/software/consul/data",

 

  "log_level": "INFO",

 

  "node_name": "serverGTH01",

 

  "bind_addr": "192.168.1.101",

 

  "client_addr": "0.0.0.0",

 

  "bootstrap_expect": 1,

 

  "server": true,

 

  "ui": true,

 

  "ports": {

 

    "http": 8500,

 

    "dns": 8600,

 

    "server": 8300

 

  },

 

  "retry_join": ["192.168.1.101", "192.168.1.102"]

 

}

[root@localhost consul.d]#

 

 

 

/etc/consul.d/consul_config.json  

 

{  

 

  "datacenter": "dcGTH",  

 

  "data_dir": "/app/software/consul/data",  

 

  "log_level": "INFO",  

 

  "node_name": "serverGTH02",  

 

  "bind_addr": "192.168.1.102",  

 

  "client_addr": "0.0.0.0",  

 

  "server": true,  

 

  "retry_join": ["192.168.1.101"]  # 指向集群中的其他节点以加入集群  

 

}

 

 

[root@serverGTH03 consul.d]# cat consul_config.json

{

 

  "datacenter": "dcGTH",

 

  "data_dir": "/app/software/consul/data",

 

  "log_level": "INFO",

 

  "node_name": "serverGTH03",

 

  "bind_addr": "192.168.1.103",

 

  "client_addr": "0.0.0.0",

 

  "server": true,

 

  "retry_join": ["192.168.1.101"]  # 指向集群中的其他节点以加入集群

 

}

 

 

启动服务器

consul agent -config-dir=/etc/consul.d/

 

关闭防火墙

 查看状态

 

[root@localhost data]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

   Active: active (running) since 一 2024-10-21 22:56:38 CST; 7h left

     Docs: man:firewalld(1)

 Main PID: 5883 (firewalld)

    Tasks: 2

   CGroup: /system.slice/firewalld.service

           └─5883 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

 

10月 21 14:56:21 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

10月 21 22:56:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

[root@localhost data]# ^C

[root@localhost data]# systemctl disable firewalld

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@localhost data]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

   Active: active (running) since 一 2024-10-21 22:56:38 CST; 7h left

     Docs: man:firewalld(1)

 Main PID: 5883 (firewalld)

   CGroup: /system.slice/firewalld.service

           └─5883 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

 

10月 21 14:56:21 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

10月 21 22:56:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

[root@localhost data]# systemctl disable firewalld

[root@localhost data]# systemctl stop firewalld

[root@localhost data]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

   Active: inactive (dead)

     Docs: man:firewalld(1)

 

10月 21 14:56:21 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

10月 21 22:56:38 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

10月 21 15:25:06 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...

10月 21 15:25:07 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.

[root@localhost data]#

 

永久关闭防火墙

 

[root@localhost consul.d]# systemctl stop firewalld

[root@localhost consul.d]# systemctl disable firewalld

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@localhost consul.d]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

   Active: inactive (dead)

     Docs: man:firewalld(1)

 

10月 21 23:16:14 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...

10月 21 23:16:15 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.

10月 21 15:25:38 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...

10月 21 15:25:39 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.

[root@localhost consul.d]#

 

 

安装完成后可以看得到

http://192.168.1.101:8500/ui/dcgth/nodes

 

 

 

设置自动启动

 

 

root@localhost data]# cd /etc/systemd/system/

[root@localhost system]# pwd

/etc/systemd/system

[root@localhost system]#

 

[root@localhost system]# touch consul.service

[root@localhost system]# vi consul.service

[root@localhost system]# vi consul.service

配置文件内容

 

 

[root@localhost system]# cat /etc/systemd/system/consul.service

[Unit]

Description=Consul Agent

After=network.target

 

[Service]

Type=simple

User=root

Group=root

ExecStart=/usr/local/bin/consul agent -server -config-dir /etc/consul.d -data-dir /app/software/consul/data/ -log-file /app/software/consul/log/consul.log -log-level warn -node serverGTH01 -bind 192.168.1.101 -client 0.0.0.0 -ui

Restart=on-failure

 

[Install]

WantedBy=multi-user.target

[root@localhost system]#

第二台:

 

[Unit]

Description=Consul Agent

After=network.target

 

[Service]

Type=simple

User=root

Group=root

ExecStart=/usr/local/bin/consul agent -server -config-dir /etc/consul.d -data-dir /app/software/consul/data/ -log-file /app/software/consul/log/consul.log -log-level warn -node serverGTH02 -bind 192.168.1.102 -client 0.0.0.0 -ui -join 192.168.1.101

Restart=on-failure

 

[Install]

WantedBy=multi-user.target

[root@localhost system]#

 

 

 

 

 

第三台:

 

[Unit]

Description=Consul Agent

After=network.target

 

[Service]

Type=simple

User=root

Group=root

ExecStart=/usr/local/bin/consul agent -server -config-dir /etc/consul.d -data-dir /app/software/consul/data/ -log-file /app/software/consul/log/consul.log -log-level warn -node serverGTH02 -bind 192.168.1.102 -client 0.0.0.0 -ui -join 192.168.1.101

Restart=on-failure

 

[Install]

WantedBy=multi-user.target

[root@localhost system]#

 

 

 

 

[root@localhost system]# systemctl daemon-reload

[root@localhost system]# systemctl enable consul.service

Created symlink from /etc/systemd/system/multi-user.target.wants/consul.service to /etc/systemd/system/consul.service.

[root@localhost system]# systemctl start consul.service

[root@localhost system]# systemctl status consul.service

● consul.service - Consul Agent

   Loaded: loaded (/etc/systemd/system/consul.service; enabled; vendor preset: disabled)

   Active: active (running) since 一 2024-10-21 16:13:58 CST; 3s ago

 Main PID: 11028 (consul)

    Tasks: 7

   CGroup: /system.slice/consul.service

           └─11028 /usr/local/bin/consul agent -server -config-dir /etc/consul.d -data-dir /app/software/consul/data/ -log-file /app/software/consul/log/consul.log -log-level warn -node serverGTH01 -bind 192.168.1.101 -client 0.0.0.0 -ui

 

10月 21 16:13:58 localhost.localdomain consul[11028]: HTTPS TLS: Verify Incoming: false, Verify Outgoing: false, Min Version: TLSv1_2

10月 21 16:13:58 localhost.localdomain consul[11028]: gRPC TLS: Verify Incoming: false, Min Version: TLSv1_2

10月 21 16:13:58 localhost.localdomain consul[11028]: Internal RPC TLS: Verify Incoming: false, Verify Outgoing: false (Verify Hostname: false), Min Version: TLSv1_2

10月 21 16:13:58 localhost.localdomain consul[11028]: ==> Log data will now stream in as it occurs:

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.517+0800 [WARN]  agent: The 'ui' field is deprecated. Use the 'ui_config.enabled' field instead.

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.517+0800 [WARN]  agent: BootstrapExpect is set to 1; this is the same as Bootstrap mode.

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.517+0800 [WARN]  agent: bootstrap = true: do not enable unless necessary

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.523+0800 [WARN]  agent.auto_config: The 'ui' field is deprecated. Use the 'ui_config.enabled' field instead.

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.523+0800 [WARN]  agent.auto_config: BootstrapExpect is set to 1; this is the same as Bootstrap mode.

10月 21 16:13:58 localhost.localdomain consul[11028]: 2024-10-21T16:13:58.523+0800 [WARN]  agent.auto_config: bootstrap = true: do not enable unless necessary

[root@localhost system]#

 

 

设置告警

https://www.cnblogs.com/ExMan/p/11907491.html

 

[root@localhost consul.d]# pwd

/etc/consul.d

[root@localhost consul.d]# ls

consul_config.json  watch.json

[root@localhost consul.d]#

[root@localhost consul.d]# vi watch.json

{

  "watches": [

    {

      "type": "checks",

      "handler_type": "http",

      "state": "critical",

      "http_handler_config": {

        "path": "http://192.168.1.102:2010/alertservice/notice",

        "method": "POST",

        "timeout": "10s",

        "header": { "Authorization": [ "token" ] }

      }

},

 

 {

      "type": "services",

      "handler_type": "http",

      "http_handler_config": {

        "path": "http://192.168.1.102:2010/alertservice/notice",

        "method": "POST",

        "timeout": "10s",

        "header": { "Authorization": [ "token" ] }

      }

},

 

{

      "type": "service",

      "service": "ztServiceGTH",

      "handler_type": "http",

      "http_handler_config": {

        "path": "http://192.168.1.102:2010/alertservice/notice",

        "method": "POST",

        "timeout": "10s",

        "header": { "Authorization": [ "token" ] }

      }

    }

 

 

 

 

  ]

}

 

[root@localhost consul.d]# systemctl stop consul.service

[root@localhost consul.d]# systemctl start consul.service

[root@localhost consul.d]#

 

 

二.安装supervisor

安装文件

[root@localhost ~]#  mkdir /app/software/supervisor

[root@localhost ~]# cd /app/software/supervisor

[root@localhost supervisor]# pwd

/app/software/supervisor

[root@localhost supervisor]#

 

[root@localhost supervisor]# ls

supervisor-4.2.5  supervisor-4.2.5.tar.gz

[root@localhost supervisor]#

[root@localhost supervisor]# ls

supervisor-4.2.5.tar.gz

[root@localhost supervisor]# tar -zxvf supervisor-4.2.5.tar.gz

[root@localhost supervisor-4.2.5]# python setup.py install

running install

running bdist_egg

running egg_info

writing requirements to supervisor.egg-info/requires.txt

writing supervisor.egg-info/PKG-INFO

writing top-level names to supervisor.egg-info/top_level.txt

writing dependency_links to supervisor.egg-info/dependency_links.txt

writing entry points to supervisor.egg-info/entry_points.txt

reading manifest file 'supervisor.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no previously-included files matching '*' found under directory 'docs/.build'

writing manifest file 'supervisor.egg-info/SOURCES.txt'

installing library code to build/bdist.linux-x86_64/egg

running install_lib

running build_py

creating build

creating build/lib

creating build/lib/supervisor

copying supervisor/__init__.py -> build/lib/supervisor

copying supervisor/childutils.py -> build/lib/supervisor

copying supervisor/compat.py -> build/lib/supervisor

copying supervisor/confecho.py -> build/lib/supervisor

copying supervisor/datatypes.py -> build/lib/supervisor

copying supervisor/dispatchers.py -> build/lib/supervisor

copying supervisor/events.py -> build/lib/supervisor

copying supervisor/http.py -> build/lib/supervisor

copying supervisor/http_client.py -> build/lib/supervisor

copying supervisor/loggers.py -> build/lib/supervisor

copying supervisor/options.py -> build/lib/supervisor

copying supervisor/pidproxy.py -> build/lib/supervisor

copying supervisor/poller.py -> build/lib/supervisor

copying supervisor/process.py -> build/lib/supervisor

copying supervisor/rpcinterface.py -> build/lib/supervisor

copying supervisor/socket_manager.py -> build/lib/supervisor

copying supervisor/states.py -> build/lib/supervisor

copying supervisor/supervisorctl.py -> build/lib/supervisor

copying supervisor/supervisord.py -> build/lib/supervisor

copying supervisor/templating.py -> build/lib/supervisor

copying supervisor/web.py -> build/lib/supervisor

copying supervisor/xmlrpc.py -> build/lib/supervisor

creating build/lib/supervisor/medusa

copying supervisor/medusa/__init__.py -> build/lib/supervisor/medusa

copying supervisor/medusa/asynchat_25.py -> build/lib/supervisor/medusa

copying supervisor/medusa/asyncore_25.py -> build/lib/supervisor/medusa

copying supervisor/medusa/auth_handler.py -> build/lib/supervisor/medusa

copying supervisor/medusa/counter.py -> build/lib/supervisor/medusa

copying supervisor/medusa/default_handler.py -> build/lib/supervisor/medusa

copying supervisor/medusa/filesys.py -> build/lib/supervisor/medusa

copying supervisor/medusa/http_date.py -> build/lib/supervisor/medusa

copying supervisor/medusa/http_server.py -> build/lib/supervisor/medusa

copying supervisor/medusa/logger.py -> build/lib/supervisor/medusa

copying supervisor/medusa/producers.py -> build/lib/supervisor/medusa

copying supervisor/medusa/util.py -> build/lib/supervisor/medusa

copying supervisor/medusa/xmlrpc_handler.py -> build/lib/supervisor/medusa

creating build/lib/supervisor/tests

copying supervisor/tests/__init__.py -> build/lib/supervisor/tests

copying supervisor/tests/base.py -> build/lib/supervisor/tests

copying supervisor/tests/test_childutils.py -> build/lib/supervisor/tests

copying supervisor/tests/test_confecho.py -> build/lib/supervisor/tests

copying supervisor/tests/test_datatypes.py -> build/lib/supervisor/tests

copying supervisor/tests/test_dispatchers.py -> build/lib/supervisor/tests

copying supervisor/tests/test_end_to_end.py -> build/lib/supervisor/tests

copying supervisor/tests/test_events.py -> build/lib/supervisor/tests

copying supervisor/tests/test_http.py -> build/lib/supervisor/tests

copying supervisor/tests/test_http_client.py -> build/lib/supervisor/tests

copying supervisor/tests/test_loggers.py -> build/lib/supervisor/tests

copying supervisor/tests/test_options.py -> build/lib/supervisor/tests

copying supervisor/tests/test_pidproxy.py -> build/lib/supervisor/tests

copying supervisor/tests/test_poller.py -> build/lib/supervisor/tests

copying supervisor/tests/test_process.py -> build/lib/supervisor/tests

copying supervisor/tests/test_rpcinterfaces.py -> build/lib/supervisor/tests

copying supervisor/tests/test_socket_manager.py -> build/lib/supervisor/tests

copying supervisor/tests/test_states.py -> build/lib/supervisor/tests

copying supervisor/tests/test_supervisorctl.py -> build/lib/supervisor/tests

copying supervisor/tests/test_supervisord.py -> build/lib/supervisor/tests

copying supervisor/tests/test_templating.py -> build/lib/supervisor/tests

copying supervisor/tests/test_web.py -> build/lib/supervisor/tests

copying supervisor/tests/test_xmlrpc.py -> build/lib/supervisor/tests

copying supervisor/version.txt -> build/lib/supervisor

creating build/lib/supervisor/scripts

copying supervisor/scripts/loop_eventgen.py -> build/lib/supervisor/scripts

copying supervisor/scripts/loop_listener.py -> build/lib/supervisor/scripts

copying supervisor/scripts/sample_commevent.py -> build/lib/supervisor/scripts

copying supervisor/scripts/sample_eventlistener.py -> build/lib/supervisor/scripts

copying supervisor/scripts/sample_exiting_eventlistener.py -> build/lib/supervisor/scripts

creating build/lib/supervisor/skel

copying supervisor/skel/sample.conf -> build/lib/supervisor/skel

creating build/lib/supervisor/ui

copying supervisor/ui/status.html -> build/lib/supervisor/ui

copying supervisor/ui/tail.html -> build/lib/supervisor/ui

creating build/lib/supervisor/ui/images

copying supervisor/ui/images/icon.png -> build/lib/supervisor/ui/images

copying supervisor/ui/images/rule.gif -> build/lib/supervisor/ui/images

copying supervisor/ui/images/state0.gif -> build/lib/supervisor/ui/images

copying supervisor/ui/images/state1.gif -> build/lib/supervisor/ui/images

copying supervisor/ui/images/state2.gif -> build/lib/supervisor/ui/images

copying supervisor/ui/images/state3.gif -> build/lib/supervisor/ui/images

copying supervisor/ui/images/supervisor.gif -> build/lib/supervisor/ui/images

creating build/lib/supervisor/ui/stylesheets

copying supervisor/ui/stylesheets/supervisor.css -> build/lib/supervisor/ui/stylesheets

creating build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/donothing.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/include.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1054.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1170a.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1170b.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1170c.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1224.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1231a.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1231b.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1231c.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1298.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1483a.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1483b.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-1483c.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-291a.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-550.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-565.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-638.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-663.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-664.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-733.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-835.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-836.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/issue-986.conf -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/listener.py -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/print_env.py -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/spew.py -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/test_1231.py -> build/lib/supervisor/tests/fixtures

copying supervisor/tests/fixtures/unkillable_spew.py -> build/lib/supervisor/tests/fixtures

creating build/lib/supervisor/tests/fixtures/example

copying supervisor/tests/fixtures/example/included.conf -> build/lib/supervisor/tests/fixtures/example

creating build/bdist.linux-x86_64

creating build/bdist.linux-x86_64/egg

creating build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/__init__.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/childutils.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/compat.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/confecho.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/datatypes.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/dispatchers.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/events.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/http.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/http_client.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/loggers.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/options.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/pidproxy.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/poller.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/process.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/rpcinterface.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/socket_manager.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/states.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/supervisorctl.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/supervisord.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/templating.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/web.py -> build/bdist.linux-x86_64/egg/supervisor

copying build/lib/supervisor/xmlrpc.py -> build/bdist.linux-x86_64/egg/supervisor

creating build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/__init__.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/asynchat_25.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/asyncore_25.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/auth_handler.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/counter.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/default_handler.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/filesys.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/http_date.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/http_server.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/logger.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/producers.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/util.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

copying build/lib/supervisor/medusa/xmlrpc_handler.py -> build/bdist.linux-x86_64/egg/supervisor/medusa

creating build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/__init__.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/base.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_childutils.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_confecho.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_datatypes.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_dispatchers.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_end_to_end.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_events.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_http.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_http_client.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_loggers.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_options.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_pidproxy.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_poller.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_process.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_rpcinterfaces.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_socket_manager.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_states.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_supervisorctl.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_supervisord.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_templating.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_web.py -> build/bdist.linux-x86_64/egg/supervisor/tests

copying build/lib/supervisor/tests/test_xmlrpc.py -> build/bdist.linux-x86_64/egg/supervisor/tests

creating build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/donothing.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/include.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1054.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1170a.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1170b.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1170c.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1224.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1231a.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1231b.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1231c.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1298.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1483a.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1483b.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-1483c.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-291a.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-550.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-565.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-638.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-663.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-664.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-733.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-835.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-836.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/issue-986.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/listener.py -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/print_env.py -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/spew.py -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/test_1231.py -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

copying build/lib/supervisor/tests/fixtures/unkillable_spew.py -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures

creating build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/example

copying build/lib/supervisor/tests/fixtures/example/included.conf -> build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/example

copying build/lib/supervisor/version.txt -> build/bdist.linux-x86_64/egg/supervisor

creating build/bdist.linux-x86_64/egg/supervisor/scripts

copying build/lib/supervisor/scripts/loop_eventgen.py -> build/bdist.linux-x86_64/egg/supervisor/scripts

copying build/lib/supervisor/scripts/loop_listener.py -> build/bdist.linux-x86_64/egg/supervisor/scripts

copying build/lib/supervisor/scripts/sample_commevent.py -> build/bdist.linux-x86_64/egg/supervisor/scripts

copying build/lib/supervisor/scripts/sample_eventlistener.py -> build/bdist.linux-x86_64/egg/supervisor/scripts

copying build/lib/supervisor/scripts/sample_exiting_eventlistener.py -> build/bdist.linux-x86_64/egg/supervisor/scripts

creating build/bdist.linux-x86_64/egg/supervisor/skel

copying build/lib/supervisor/skel/sample.conf -> build/bdist.linux-x86_64/egg/supervisor/skel

creating build/bdist.linux-x86_64/egg/supervisor/ui

copying build/lib/supervisor/ui/status.html -> build/bdist.linux-x86_64/egg/supervisor/ui

copying build/lib/supervisor/ui/tail.html -> build/bdist.linux-x86_64/egg/supervisor/ui

creating build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/icon.png -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/rule.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/state0.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/state1.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/state2.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/state3.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

copying build/lib/supervisor/ui/images/supervisor.gif -> build/bdist.linux-x86_64/egg/supervisor/ui/images

creating build/bdist.linux-x86_64/egg/supervisor/ui/stylesheets

copying build/lib/supervisor/ui/stylesheets/supervisor.css -> build/bdist.linux-x86_64/egg/supervisor/ui/stylesheets

byte-compiling build/bdist.linux-x86_64/egg/supervisor/__init__.py to __init__.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/childutils.py to childutils.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/compat.py to compat.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/confecho.py to confecho.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/datatypes.py to datatypes.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/dispatchers.py to dispatchers.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/events.py to events.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/http.py to http.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/http_client.py to http_client.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/loggers.py to loggers.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/options.py to options.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/pidproxy.py to pidproxy.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/poller.py to poller.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/process.py to process.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/rpcinterface.py to rpcinterface.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/socket_manager.py to socket_manager.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/states.py to states.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/supervisorctl.py to supervisorctl.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/supervisord.py to supervisord.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/templating.py to templating.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/web.py to web.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/xmlrpc.py to xmlrpc.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/__init__.py to __init__.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/asynchat_25.py to asynchat_25.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/asyncore_25.py to asyncore_25.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/auth_handler.py to auth_handler.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/counter.py to counter.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/default_handler.py to default_handler.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/filesys.py to filesys.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/http_date.py to http_date.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/http_server.py to http_server.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/logger.py to logger.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/producers.py to producers.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/util.py to util.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/medusa/xmlrpc_handler.py to xmlrpc_handler.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/__init__.py to __init__.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/base.py to base.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_childutils.py to test_childutils.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_confecho.py to test_confecho.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_datatypes.py to test_datatypes.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_dispatchers.py to test_dispatchers.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_end_to_end.py to test_end_to_end.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_events.py to test_events.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_http.py to test_http.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_http_client.py to test_http_client.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_loggers.py to test_loggers.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_options.py to test_options.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_pidproxy.py to test_pidproxy.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_poller.py to test_poller.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_process.py to test_process.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_rpcinterfaces.py to test_rpcinterfaces.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_socket_manager.py to test_socket_manager.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_states.py to test_states.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_supervisorctl.py to test_supervisorctl.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_supervisord.py to test_supervisord.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_templating.py to test_templating.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_web.py to test_web.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/test_xmlrpc.py to test_xmlrpc.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/listener.py to listener.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/print_env.py to print_env.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/spew.py to spew.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/test_1231.py to test_1231.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/tests/fixtures/unkillable_spew.py to unkillable_spew.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/scripts/loop_eventgen.py to loop_eventgen.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/scripts/loop_listener.py to loop_listener.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/scripts/sample_commevent.py to sample_commevent.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/scripts/sample_eventlistener.py to sample_eventlistener.pyc

byte-compiling build/bdist.linux-x86_64/egg/supervisor/scripts/sample_exiting_eventlistener.py to sample_exiting_eventlistener.pyc

creating build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying supervisor.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

creating dist

creating 'dist/supervisor-4.2.5-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it

removing 'build/bdist.linux-x86_64/egg' (and everything under it)

Processing supervisor-4.2.5-py2.7.egg

creating /usr/lib/python2.7/site-packages/supervisor-4.2.5-py2.7.egg

Extracting supervisor-4.2.5-py2.7.egg to /usr/lib/python2.7/site-packages

Adding supervisor 4.2.5 to easy-install.pth file

Installing echo_supervisord_conf script to /usr/bin

Installing pidproxy script to /usr/bin

Installing supervisorctl script to /usr/bin

Installing supervisord script to /usr/bin

 

Installed /usr/lib/python2.7/site-packages/supervisor-4.2.5-py2.7.egg

Processing dependencies for supervisor==4.2.5

Searching for setuptools==0.9.8

Best match: setuptools 0.9.8

Adding setuptools 0.9.8 to easy-install.pth file

Installing easy_install script to /usr/bin

Installing easy_install-2.7 script to /usr/bin

 

Using /usr/lib/python2.7/site-packages

Finished processing dependencies for supervisor==4.2.5

 

 

[root@localhost supervisor-4.2.5]# echo_supervisord_conf > /etc/supervisor/supervisord.conf

[root@localhost supervisor-4.2.5]# mkdir /etc/supervisor/conf.d

[root@localhost supervisor-4.2.5]# mkdir /etc/supervisor/log

 

配置如下:

 

 

 

 

[root@serverGTH02 supervisor]# cat supervisord.conf

; Sample supervisor config file.

;

; For more information on the config file, please see:

; http://supervisord.org/configuration.html

;

; Notes:

;  - Shell expansion ("~" or "$HOME") is not supported.  Environment

;    variables can be expanded using this syntax: "%(ENV_HOME)s".

;  - Quotes around values are not supported, except in the case of

;    the environment= options as shown below.

;  - Comments must have a leading space: "a=b ;comment" not "a=b;comment".

;  - Command will be truncated if it looks like a config file comment, e.g.

;    "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ".

;

; Warning:

;  Paths throughout this example file use /tmp because it is available on most

;  systems.  You will likely need to change these to locations more appropriate

;  for your system.  Some systems periodically delete older files in /tmp.

;  Notably, if the socket file defined in the [unix_http_server] section below

;  is deleted, supervisorctl will be unable to connect to supervisord.

 

[unix_http_server]

file=/var/run/supervisor.sock   ; the path to the socket file

;chmod=0700                 ; socket file mode (default 0700)

;chown=nobody:nogroup       ; socket file uid:gid owner

;username=user              ; default is no username (open server)

;password=123               ; default is no password (open server)

 

; Security Warning:

;  The inet HTTP server is not enabled by default.  The inet HTTP server is

;  enabled by uncommenting the [inet_http_server] section below.  The inet

;  HTTP server is intended for use within a trusted environment only.  It

;  should only be bound to localhost or only accessible from within an

;  isolated, trusted network.  The inet HTTP server does not support any

;  form of encryption.  The inet HTTP server does not use authentication

;  by default (see the username= and password= options to add authentication).

;  Never expose the inet HTTP server to the public internet.

 

;[inet_http_server]         ; inet (TCP) server disabled by default

;port=127.0.0.1:9001        ; ip_address:port specifier, *:port for all iface

;username=user              ; default is no username (open server)

;password=123               ; default is no password (open server)

 

[supervisord]

logfile=/etc/supervisor/log/supervisord.log ; main log file; default $CWD/supervisord.log

logfile_maxbytes=50MB        ; max main logfile bytes b4 rotation; default 50MB

logfile_backups=10           ; # of main logfile backups; 0 means none, default 10

loglevel=info                ; log level; default info; others: debug,warn,trace

pidfile=/var/run/supervisord.pid ; supervisord pidfile; default supervisord.pid

nodaemon=false               ; start in foreground if true; default false

silent=false                 ; no logs to stdout if true; default false

minfds=1024                  ; min. avail startup file descriptors; default 1024

minprocs=200                 ; min. avail process descriptors;default 200

;umask=022                   ; process file creation umask; default 022

;user=supervisord            ; setuid to this UNIX account at startup; recommended if root

;identifier=supervisor       ; supervisord identifier, default is 'supervisor'

;directory=/tmp              ; default is not to cd during start

;nocleanup=true              ; don't clean up tempfiles at start; default false

;childlogdir=/tmp            ; 'AUTO' child log dir, default $TEMP

;environment=KEY="value"     ; key value pairs to add to environment

;strip_ansi=false            ; strip ansi escape codes in logs; def. false

 

; The rpcinterface:supervisor section must remain in the config file for

; RPC (supervisorctl/web interface) to work.  Additional interfaces may be

; added by defining them in separate [rpcinterface:x] sections.

 

[rpcinterface:supervisor]

supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

 

; The supervisorctl section configures how supervisorctl will connect to

; supervisord.  configure it match the settings in either the unix_http_server

; or inet_http_server section.

 

[supervisorctl]

serverurl=unix:///var/run/supervisor.sock ;

;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket

;username=chris              ; should be same as in [*_http_server] if set

;password=123                ; should be same as in [*_http_server] if set

;prompt=mysupervisor         ; cmd line prompt (default "supervisor")

;history_file=~/.sc_history  ; use readline history if available

 

; The sample program section below shows all possible program subsection values.

; Create one or more 'real' program: sections to be able to control them under

; supervisor.

 

;[program:theprogramname]

;command=/bin/cat              ; the program (relative uses PATH, can take args)

;process_name=%(program_name)s ; process_name expr (default %(program_name)s)

;numprocs=1                    ; number of processes copies to start (def 1)

;directory=/tmp                ; directory to cwd to before exec (def no cwd)

;umask=022                     ; umask for process (default None)

;priority=999                  ; the relative start priority (default 999)

;autostart=true                ; start at supervisord start (default: true)

;startsecs=1                   ; # of secs prog must stay up to be running (def. 1)

;startretries=3                ; max # of serial start failures when starting (default 3)

;autorestart=unexpected        ; when to restart if exited after running (def: unexpected)

;exitcodes=0                   ; 'expected' exit codes used with autorestart (default 0)

;stopsignal=QUIT               ; signal used to kill process (default TERM)

;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)

;stopasgroup=false             ; send stop signal to the UNIX process group (default false)

;killasgroup=false             ; SIGKILL the UNIX process group (def false)

;user=chrism                   ; setuid to this UNIX account to run the program

;redirect_stderr=true          ; redirect proc stderr to stdout (default false)

;stdout_logfile=/a/path        ; stdout log path, NONE for none; default AUTO

;stdout_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)

;stdout_logfile_backups=10     ; # of stdout logfile backups (0 means none, default 10)

;stdout_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)

;stdout_events_enabled=false   ; emit events on stdout writes (default false)

;stdout_syslog=false           ; send stdout to syslog with process name (default false)

;stderr_logfile=/a/path        ; stderr log path, NONE for none; default AUTO

;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)

;stderr_logfile_backups=10     ; # of stderr logfile backups (0 means none, default 10)

;stderr_capture_maxbytes=1MB   ; number of bytes in 'capturemode' (default 0)

;stderr_events_enabled=false   ; emit events on stderr writes (default false)

;stderr_syslog=false           ; send stderr to syslog with process name (default false)

;environment=A="1",B="2"       ; process environment additions (def no adds)

;serverurl=AUTO                ; override serverurl computation (childutils)

 

; The sample eventlistener section below shows all possible eventlistener

; subsection values.  Create one or more 'real' eventlistener: sections to be

; able to handle event notifications sent by supervisord.

 

;[eventlistener:theeventlistenername]

;command=/bin/eventlistener    ; the program (relative uses PATH, can take args)

;process_name=%(program_name)s ; process_name expr (default %(program_name)s)

;numprocs=1                    ; number of processes copies to start (def 1)

;events=EVENT                  ; event notif. types to subscribe to (req'd)

;buffer_size=10                ; event buffer queue size (default 10)

;directory=/tmp                ; directory to cwd to before exec (def no cwd)

;umask=022                     ; umask for process (default None)

;priority=-1                   ; the relative start priority (default -1)

;autostart=true                ; start at supervisord start (default: true)

;startsecs=1                   ; # of secs prog must stay up to be running (def. 1)

;startretries=3                ; max # of serial start failures when starting (default 3)

;autorestart=unexpected        ; autorestart if exited after running (def: unexpected)

;exitcodes=0                   ; 'expected' exit codes used with autorestart (default 0)

;stopsignal=QUIT               ; signal used to kill process (default TERM)

;stopwaitsecs=10               ; max num secs to wait b4 SIGKILL (default 10)

;stopasgroup=false             ; send stop signal to the UNIX process group (default false)

;killasgroup=false             ; SIGKILL the UNIX process group (def false)

;user=chrism                   ; setuid to this UNIX account to run the program

;redirect_stderr=false         ; redirect_stderr=true is not allowed for eventlisteners

;stdout_logfile=/a/path        ; stdout log path, NONE for none; default AUTO

;stdout_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)

;stdout_logfile_backups=10     ; # of stdout logfile backups (0 means none, default 10)

;stdout_events_enabled=false   ; emit events on stdout writes (default false)

;stdout_syslog=false           ; send stdout to syslog with process name (default false)

;stderr_logfile=/a/path        ; stderr log path, NONE for none; default AUTO

;stderr_logfile_maxbytes=1MB   ; max # logfile bytes b4 rotation (default 50MB)

;stderr_logfile_backups=10     ; # of stderr logfile backups (0 means none, default 10)

;stderr_events_enabled=false   ; emit events on stderr writes (default false)

;stderr_syslog=false           ; send stderr to syslog with process name (default false)

;environment=A="1",B="2"       ; process environment additions

;serverurl=AUTO                ; override serverurl computation (childutils)

 

; The sample group section below shows all possible group values.  Create one

; or more 'real' group: sections to create "heterogeneous" process groups.

 

;[group:thegroupname]

;programs=progname1,progname2  ; each refers to 'x' in [program:x] definitions

;priority=999                  ; the relative start priority (default 999)

 

; The [include] section can just contain the "files" setting.  This

; setting can list multiple files (separated by whitespace or

; newlines).  It can also contain wildcards.  The filenames are

; interpreted as relative to this file.  Included files *cannot*

; include files themselves.

 

;[include]

;files = relative/directory/*.ini

 

[include]

files = /etc/supervisor/conf.d/*.conf

 

 

   

#启动supervisord

supervisord -c /etc/supervisor/supervisord.conf

#关闭supervisord

supervisorctl -c /etc/supervisor/supervisord.conf shutdown

 

 

 

生成自动随系统自动启动

[root@localhost supervisor]# cd /etc/systemd/system/

[root@localhost system]# touch supervisord.service

[root@localhost system]# pwd

/etc/systemd/system

[root@localhost system]#

 

 

[Unit]

Description=Supervisor daemon

 

[Service]

#表示systemd应该以forking模式启动服务。在此模式下,systemd会启动一个父进程,然后父进程会fork出一个或者多个子进程。

Type=forking

ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf

ExecStop=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf shutdown

ExecReload=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf reload

ExecStatus=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf status

ExecRestart=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf restart

#表示当systemd需要停止服务时,它会发送信号到服务的主进程。如果服务有子进程,那么子进程不会收到这个信号。

KillMode=process

#表示当服务非正常退出时(例如收到SIGKILL信号),systemd会尝试重启服务。

Restart=on-failure

#如果服务失败了,systemd会在尝试重启服务前等待30

RestartSec=30s

#指定运行服务的用户

User=root

 

[Install]

WantedBy=multi-user.target

 

[root@localhost system]# vi supervisord.service

[root@localhost system]# systemctl daemon-reload

[root@localhost system]# systemctl enable supervisord.service

Created symlink from /etc/systemd/system/multi-user.target.wants/supervisord.service to /etc/systemd/system/supervisord.service.

[root@localhost system]# systemctl start supervisord.service

[root@localhost system]# ps -ef|grep super

root     17391     1  0 17:23 ?        00:00:00 /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

root     17395 16606  0 17:23 pts/0    00:00:00 grep --color=auto super

[root@localhost system]#

 

 

# 启动supervisord

systemctl start supervisord.service

 

# 查看supervisord状态

systemctl status supervisord.service

 

# 重启supervisord

systemctl restart supervisord.service

 

# 停止supervisord

systemctl stop supervisord.service

 

# 重载配置

systemctl reload supervisord.service

 

 

 

 

三.安装dotnetcore

1. 安装SDK

[root@localhost dotnet]# pwd

/app/software/dotnet

[root@localhost dotnet]# mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.426-linux-x64.tar.gz -C $HOME/dotnet

[root@localhost dotnet]# export DOTNET_ROOT=$HOME/dotnet

[root@localhost dotnet]# export PATH=$PATH:$HOME/dotnet

[root@localhost dotnet]# dotnet --version

3.1.426

 

 

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/bin

 

 

export PATH

 

export PATH=$PATH:$HOME/dotnet

export DOTNET_ROOT=$HOME/dotnet

[root@localhost dotnet]# source ~/.bash_profile

 

官方安装教程

https://dotnet.microsoft.com/fr-fr/download/dotnet/thank-you/sdk-3.1.426-linux-x64-binaries

四.配置微服务

1. 配置网关

 

配置个体户网关

IP: 192.168.1.102:2001

[root@localhost qhmicroservice]# mkdir apigatewayGTH

[root@localhost qhmicroservice]# cd apigatewayGTH

[root@localhost apigatewayGTH]# pwd

/app/qhmicroservice/apigatewayGTH

配置守护进程

[program:apigatewayGTH]

command=/root/dotnet/dotnet QH.APIGateway3.0.dll ;

directory=/app/qhmicroservice/apigatewayGTH ;

autorestart=true ;

stderr_logfile=/app/qhmicroservice/apigatewayGTH/apigatewayGTH.err.log ;

stdout_logfile=/app/qhmicroservice/apigatewayGTH/apigatewayGTH.out.log ;

environment=ASPNETCORE_ENVIRONMENT=Production ;

user=root ;

stopsignal=INT

2.配置鉴权服务器

客户用户的鉴权

IP: 192.168.1.102:2010

内部用户的鉴权

IP: 192.168.1.101:2010

 

服务名称:IdentityServiceGTH 端口:2010

/app/qhmicroservice/apiidentityGTH

配置守护进程

[program:apiidentityGTHservice]

command=/root/dotnet/dotnet QH.APIIdentity3.1.dll ;

directory=/app/qhmicroservice/apiidentityGTH ;

autorestart=true ;

stderr_logfile=/app/qhmicroservice/apiidentityGTH/apiidentityGTH.err.log ;

stdout_logfile=/app/qhmicroservice/apiidentityGTH/apiidentityGTH.out.log ;

environment=ASPNETCORE_ENVIRONMENT=Production ;

user=root ;

stopsignal=INT

 

配置文件

内部用户的鉴权服务

{

 "ConnectionStrings": {

  "Sys": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper",

  "Mms": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper"

  },

  "Service": {

    "Name": "IdentityByInnerUserGTH",

    "Port": "2010"

  },

  "Consul": {

    "IP": "192.168.1.102",

    "Port": "8500"

  },

  "Logging": {

    "IncludeScopes": false,

    "Debug": {

      "LogLevel": {

        "Default": "Warning"

      }

    },

    "Console": {

      "LogLevel": {

        "Default": "Warning"

      }

    }

  }

}

客户的用户的鉴权服务

{

 

 "ConnectionStrings": {

  "Sys": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper",

  "Mms": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper"

  },

  "Service": {

    "Name": "IdentityByCustomerGTH",

    "Port": "2010"

  },

  "Consul": {

    "IP": "192.168.1.101",

    "Port": "8500"

  },

  "Logging": {

    "IncludeScopes": false,

    "Debug": {

      "LogLevel": {

        "Default": "Warning"

      }

    },

    "Console": {

      "LogLevel": {

        "Default": "Warning"

      }

    }

  }

}

 

 

 

 

 

 

 

 

 

 

 

 

3.配置中台服务

[root@localhost qhmicroservice]# mkdir ztserviceGTH

[root@localhost ztserviceGTH]# pwd

/app/qhmicroservice/ztserviceGTH

 

IP: 192.168.1.101:2011

服务名称:ztServiceGTH 端口号:2011

 

配置守护进程

[program:JQZTserviceGTH]

command=/root/dotnet/dotnet QH.QZTWeb.dll ;

directory=/app/qhmicroservice/ztserviceGTH ;

autorestart=true ;

stderr_logfile=/app/qhmicroservice/ztserviceGTH/ztserviceGTH.err.log ;

stdout_logfile=/app/qhmicroservice/ztserviceGTH/ztserviceGTH.out.log ;

environment=ASPNETCORE_ENVIRONMENT=Production ;

user=root ;

stopsignal=INT

 

 

4. 配置个体户前台服务

 

IP: 192.168.1.101:2012

IP: 192.168.1.102:2012

IP: 192.168.1.103:2012

 

 

服务名称:JQJZServiceGTH 端口号:2012

[root@localhost qhmicroservice]# mkdir JQJZServiceGTH

[root@localhost qhmicroservice]# cd JQJZServiceGTH

[root@localhost JQJZServiceGTH]# pwd

/app/qhmicroservice/JQJZServiceGTH

[root@localhost JQJZServiceGTH]#

配置文件

{

 

 

  "ConnectionStrings": {

    "Sys": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper",

    "Mms": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper"

  },

  "Logging": {

    "LogLevel": {

      "Default": "Warning"

    }

  },

  "Service": {

    "Name": "JQJZServiceGTH",

    "Port": "2012"

  },

    "IDentityPermession": {

    "ClientID": "jqCTGCGTHServiceClientTest",

    "IP": "192.168.1.102",

    "Port": "2010",

    "APIName": "jqCTGCGTHServiceTest",

    "ClientKey": Kn3TR0ThZQAf1zEEiYpKb1mzkpfDx0",

    "UrlPath": "connect/token"

  },

}

 

 

配置守护进程

[program:JQJZServiceGTH]

command=/root/dotnet/dotnet QH.QJZ.dll ;

directory=/app/qhmicroservice/JQJZServiceGTH ;

autorestart=true ;

stderr_logfile=/app/qhmicroservice/JQJZServiceGTH/JQJZServiceGTH.err.log ;

stdout_logfile=/app/qhmicroservice/JQJZServiceGTH/JQJZServiceGTH.out.log ;

environment=ASPNETCORE_ENVIRONMENT=Production ;

user=root ;

stopsignal=INT

 

 

 

5. 配置自动任务服务

IP: 192.168.1.101:2013

 

服务名称:JQTaskServiceGTH 端口号:2012

[root@localhost qhmicroservice]# mkdir JQTaskServiceGTH

[root@localhost qhmicroservice]# cd JQTaskServiceGTH

[root@localhost JQTaskServiceGTH]# pwd

/app/qhmicroservice/JQTaskServiceGTH

[root@localhost JQTaskServiceGTH]#

配置守护进程

[program:JQTaskServiceGTH]

command=/root/dotnet/dtonet QH.QJZTask.dll ;

directory=/app/qhmicroservice/JQTaskServiceGTH;

autorestart=true ;

stderr_logfile=/app/qhmicroservice/JQTaskServiceGTH/JQTaskServiceGTH.err.log ;

stdout_logfile=/app/qhmicroservice/JQTaskServiceGTH/JQTaskServiceGTH.out.log ;

environment=ASPNETCORE_ENVIRONMENT=Production ;

user=root ;

stopsignal=INT

 

配置文件

  "ConnectionStrings": {

    "Sys": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper",

    "Mms": "server=192.168.1.203,49507;uid=testqh;pwd=Test_2022;database=newoper"

  },

 

  "Consul": {

    "IP": "192.168.1.102",

    "Port": "8500"

  },

  "Service": {

    "Name": "JQTaskServiceGTH",

    "Port": "2013"

  },

  "Client": {

    "ClientID": "qhminiapiJQ"

 

  },

posted on 2024-10-24 13:11  woody.wu  阅读(10)  评论(0编辑  收藏  举报