Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
It is generally good practice to allocate as much swap as your configuration has physical RAM
DescriptionCommand1

Check your current memory and swap space configuration and availability

NOTE: Under the "total" column, you will see the total system memory allocation needed to configure the swap for step 2

Page Tree
expandCollapseAlltrue
root安全节点+超级节点搭建教程


Panel
borderColorgrey
bgColorwhite
titleColorblack
borderWidth1
titleBGColorwhite
borderStylesolid
titleLanguages
  • It is recommended to add swap to ensure (1) stable running of the zend daemon (and Side Chain Applications for Super Nodes) (2) challenge times that meet the criteria (Secure Node: 300 seconds, Super Node:150 seconds)
    • 建议添加swap以确保(1)稳定运行zend守护程序(以及超级节点的侧链应用程序)(2)符合条件的挑战时间(安全节点:200秒,超级节点:100秒)
    • 通常,良好的做法是分配尽可能多的swap,因为您的配置具有物理RAM



    描述指令
    1

    检查当前内存和交换空间配置和可用性

    注意:在“total”列下面,您将看到为步骤2配置swap所需的总系统内存分配


    Code Block
    free -h

    Get a list of swapfile names and paths for your system获取系统的swap文件名称和路径列表

    Code Block
    sudo swapon -s

    Turn off and remove the swap file if one already exists (change /swapfile as necessary to the path and name of your swapfile)关闭并删除swap文件(如果已存在)(根据需要更改/swap文件到swap文件的路径和名称)

    Code Block
    sudo swapoff /swapfile
    sudo rm /swapfile


    2

    Allocate the swapfile, changing the command as necessary

    NOTE: A Secure Node with 2GB RAM, will need to add a 2GB swap file

    NOTE: A Super Node with 8GB RAM, may add a 8GB swap file (change 2G on the right to 8G)

    Don't enter this entry without first changing the value as instructed in the description column

    分配swap文件,根据需要更改命令

    注意:具有2GB RAM的安全节点需要添加2GB交换文件

    注意:具有8GB RAM的超级节点可以添加8GB交换文件(将右侧的2G更改为8G)

    如果没有按照说明更改,请不要输入此条目

    Code Block
    sudo fallocate -l 2G /swapfile


    3Set permissions on the swapfile设置swap文件的权限


    Code Block
    sudo chmod 600 /swapfile
    


    4Format the file as swap space
    将文件格式化为swap空间


    Code Block
    sudo mkswap /swapfile


    5Activate swap激活swap


    Code Block
    sudo swapon /swapfile


    6

    Validate swap is activated using this command, the output should return a row for 'Swap:' as shown in the example output; with the value in the 'total column matching the allocated amount of swap from step 1使用此命令激活验证swap,如示例输出中所示,输出应为“swap:”;返回一行, 使用与从步骤1分配的swap量匹配的“总列”中的值


    Code Block
    free -h


    This is an example of a system with 2GB of RAM, 2GB of swap was set in step 2这是一个具有2GB RAM的系统的示例,在步骤2中设置了2GB的swap

    Panel
    borderColorgrey
    bgColorblack
    titleColorwhite
    borderWidth2
    titleBGColorblack
    borderStylesolid
    titleExample Output

    zenops@node01:~$ free -h
    ............................total............used.................free.......shared....buff.cache.......available
    Mem:.................1.9G............1.3G.................66M...........12M.............576M.............489M
    Swap:.................2.0G...........0.0M.................2.0G


    7

    Edit the 编辑/etc/sysctl.conf file to specify the 'swappiness' behaviour of your nodeEdit the conf文件以指定节点的“swappiness”行为

    编辑/ etc / fstab file, specifying that swap should be mounted at bootfstab文件,指定应在引导时挂载swap


    Code Block
    echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf
    echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab


    8Activate the updated configuration (without rebooting)激活更新的配置(无需重新启动)


    Code Block
    sudo sysctl -p


    9

    Test that your node is capable of running challenges in the required time, the "runningtime" value returned (example output) is required to be fewer than 200 seconds (Secure Node) or 100 seconds (Super Node)

    Check your node's block height, compare with: https:测试您的节点是否能够在所需时间内运行挑战,返回的“运行时”值(示例输出)需要少于200秒(安全节点)或100秒(超级节点)

    检查节点的块高,参考:https://explorer.zensystem.io/

    NOTE: If your node is still downloading the blockchain, it is very likely that this benchmark will fail, with much higher times than expected

    NOTE: You can skip this step for the sake of being efficient and continue on with parts 4 to 6 and return here to benchmark

    While the blockchain is downloading and indexing, it will use extra CPU cycles (see notes). Check the current block height

    注意:如果您的节点仍在下载区块链,则此基准测试很可能会失败,其次数远远超过预期

    注意:为了提高效率,您可以跳过此步骤,继续使用第4步第6步并返回此处进行benchmark测试

    当区块链正在下载和索引时,它将使用额外的CPU周期(参见注释)。 检查当前块高度

    Code Block
    zen-cli getblockcount

    It is normal to not get an output right away, it may take a few minutes不能立即获得输出是正常的,可能需要几分钟

    Code Block
    zen-cli zcbenchmark createjoinsplit 1



    Panel
    borderColorgrey
    bgColorblack
    titleColorwhite
    borderWidth2
    titleBGColorblack
    borderStylesolid
    titleExample Output

    zenops@node01:~$ zen-cli zcbenchmark createjoinsplit 1
    [
    {
    "runningtime": 80.682516
    }
    ]



    Part 3a of 11 - Adding swap and Benchmark

    第3步a/共11步 - 增加swap和Benchmark

    Insert excerpt
    Social Links友情链接Social Links
    友情链接
    nopaneltrue