Mixin 大群部署完全教程 实操(一)

Mixin 大群部署完全教程 实操总结

Mixin 大群部署完全教程
Mixin 大群部署完全教程 实操(一)
Mixin 大群部署完全教程 实操(二)

apt -y install postgresql postgresql-contrib

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libopts25 sntp
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libpq5 libxslt1.1 postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common ssl-cert
Suggested packages:
  postgresql-doc locales-all postgresql-doc-10 libjson-perl openssl-blacklist
The following NEW packages will be installed:
  libpq5 libxslt1.1 postgresql postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common postgresql-contrib ssl-cert
0 upgraded, 9 newly installed, 0 to remove and 172 not upgraded.
Need to get 5,170 kB of archives.
After this operation, 20.2 MB of additional disk space will be used.
Get:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 libpq5 amd64 10.12-0ubuntu0.18.04.1 [107 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 libxslt1.1 amd64 1.1.29-5ubuntu0.2 [150 kB]
Get:3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql-client-common all 190ubuntu0.1 [29.6 kB]
Get:4 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql-client-10 amd64 10.12-0ubuntu0.18.04.1 [937 kB]
Get:5 http://mirrors.cloud.aliyuncs.com/ubuntu bionic/main amd64 ssl-cert all 1.0.39 [17.0 kB]
Get:6 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql-common all 190ubuntu0.1 [157 kB]
Get:7 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql-10 amd64 10.12-0ubuntu0.18.04.1 [3,761 kB]
Get:8 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql all 10+190ubuntu0.1 [5,884 B]
Get:9 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 postgresql-contrib all 10+190ubuntu0.1 [5,896 B]
Fetched 5,170 kB in 1s (8,316 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libpq5:amd64.
(Reading database ... 130555 files and directories currently installed.)
Preparing to unpack .../0-libpq5_10.12-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libpq5:amd64 (10.12-0ubuntu0.18.04.1) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../1-libxslt1.1_1.1.29-5ubuntu0.2_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.29-5ubuntu0.2) ...
Selecting previously unselected package postgresql-client-common.
Preparing to unpack .../2-postgresql-client-common_190ubuntu0.1_all.deb ...
Unpacking postgresql-client-common (190ubuntu0.1) ...
Selecting previously unselected package postgresql-client-10.
Preparing to unpack .../3-postgresql-client-10_10.12-0ubuntu0.18.04.1_amd64.deb ...
Unpacking postgresql-client-10 (10.12-0ubuntu0.18.04.1) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../4-ssl-cert_1.0.39_all.deb ...
Unpacking ssl-cert (1.0.39) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../5-postgresql-common_190ubuntu0.1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (190ubuntu0.1) ...
Selecting previously unselected package postgresql-10.
Preparing to unpack .../6-postgresql-10_10.12-0ubuntu0.18.04.1_amd64.deb ...
Unpacking postgresql-10 (10.12-0ubuntu0.18.04.1) ...
Selecting previously unselected package postgresql.
Preparing to unpack .../7-postgresql_10+190ubuntu0.1_all.deb ...
Unpacking postgresql (10+190ubuntu0.1) ...
Selecting previously unselected package postgresql-contrib.
Preparing to unpack .../8-postgresql-contrib_10+190ubuntu0.1_all.deb ...
Unpacking postgresql-contrib (10+190ubuntu0.1) ...
Setting up ssl-cert (1.0.39) ...
Setting up libxslt1.1:amd64 (1.1.29-5ubuntu0.2) ...
Setting up libpq5:amd64 (10.12-0ubuntu0.18.04.1) ...
Setting up postgresql-client-common (190ubuntu0.1) ...
Setting up postgresql-common (190ubuntu0.1) ...
Adding user postgres to group ssl-cert

Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
Setting up postgresql-client-10 (10.12-0ubuntu0.18.04.1) ...
update-alternatives: using /usr/share/postgresql/10/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-10 (10.12-0ubuntu0.18.04.1) ...
Creating new PostgreSQL cluster 10/main ...
/usr/lib/postgresql/10/bin/initdb -D /var/lib/postgresql/10/main --auth-local peer --auth-host md5
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/10/main ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Asia/Shanghai
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    /usr/lib/postgresql/10/bin/pg_ctl -D /var/lib/postgresql/10/main -l logfile start

Ver Cluster Port Status Owner    Data directory              Log file
10  main    5432 down   postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
update-alternatives: using /usr/share/postgresql/10/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Setting up postgresql (10+190ubuntu0.1) ...
Setting up postgresql-contrib (10+190ubuntu0.1) ...
Processing triggers for systemd (237-3ubuntu10.31) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

/usr/lib/postgresql/10/bin/postgres -V

~ /usr/lib/postgresql/10/bin/postgres -V
postgres (PostgreSQL) 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1)

修改时区

timedatectl status
                      Local time: Wed 2020-06-24 18:28:11 CST
                  Universal time: Wed 2020-06-24 10:28:11 UTC
                        RTC time: Wed 2020-06-24 18:28:12
                       Time zone: Asia/Shanghai (CST, +0800)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.
➜  ~ timedatectl set-timezone UTC
➜  ~
➜  ~ timedatectl status
                      Local time: Wed 2020-06-24 10:28:35 UTC
                  Universal time: Wed 2020-06-24 10:28:35 UTC
                        RTC time: Wed 2020-06-24 10:28:35
                       Time zone: UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: yes

还是在build这里卡住了

go: cloud.google.com/go@v0.41.0: Get "https://proxy.golang.org/cloud.google.com/go/@v/v0.41.0.mod": dial tcp 34.64.4.113:443: i/o timeout

bash <(curl -L -s https://install.direct/go.sh)

Installing V2Ray v4.25.1 on x86_64
Downloading V2Ray: https://github.com/v2fly/v2ray-core/releases/download/v4.25.1/v2ray-linux-64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   631  100   631    0     0    376      0  0:00:01  0:00:01 --:--:--   376
100 12.3M  100 12.3M    0     0  17988      0  0:11:58  0:11:58 --:--:-- 17289
awk: not an option: -e
Archive:  /tmp/v2ray/v2ray.zip
  inflating: /usr/bin/v2ray/geoip.dat
  inflating: /usr/bin/v2ray/geosite.dat
  inflating: /usr/bin/v2ray/v2ctl
  inflating: /usr/bin/v2ray/v2ray
PORT:xxxx
UUID:xxxx
Archive:  /tmp/v2ray/v2ray.zip
  inflating: /etc/systemd/system/v2ray.service
Created symlink /etc/systemd/system/multi-user.target.wants/v2ray.service → /etc/systemd/system/v2ray.service.
V2Ray v4.25.1 is installed.

新建文件 config.json,复制已下文本并粘贴。修改其中的节点地址V2Ray UUID

v2ray -config /home/root/config.json即可启动。 该客户端仅提供了一个 Socks5 服务在本地的 1080 端口,还需要针对不同的软件进行配置才能使用。

{
  "inbounds": [
    {
      "port": 1080,
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": ["http", "tls"]
      },
      "settings": {
        "auth": "noauth"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "**节点地址**",
            "port": 443,
            "users": [
              {
                "id": "**V2Ray UUID**",
                "alterId": 1
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "ws",
        "security": "tls",
        "wsSettings": {
          "path": "/v2"
        }
      }
    }
  ]
}

curl -L git.io/cow | bash 下载不下来,可以将内容本地下载,复制到install-cow.sh中,赋值后进行安装。

listen = http://127.0.0.1:7777

# SOCKS5 二级代理
proxy = socks5://127.0.0.1:1080

这样v2ray提供socks5代理;cow进行http代理(转发给socke5)——我理解的是这样。

进行go build成功生成可执行文件supergroup.mixin.one

要下雨了,先搞到这里今天。