环境:2cpu,2G,centos7
首先关闭CentOS的SELinux功能和防火墙

建议升级gcc到7.3:https://lijunmin.blog.csdn.net/article/details/102455127

安装依赖:
yum install centos-release-scl epel-release -y
yum install cmake3 devtoolset-7-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make git -y
scl enable devtoolset-7 bash

下载并安装挖矿程序:
git clone https://github.com/fireice-uk/xmr-stak.git
vim xmr-stak/xmrstak/donate-level.hpp
constexpr double fDevDonationLevel = 0.0 / 100.0;

cd xmr-stak/
cmake3 . -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF

#如果有报错类似如:`GLIBCXX_3.4.21' not found 
解决方法:
cp /usr/local/src/gcc-7.3.0/gcc-build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.24 /usr/lib64/
cd /usr/lib64/
rm -fr libstdc++.so.6
ln -s libstdc++.so.6.0.24 libstdc++.so.6

如果没报错执行下面命令:
make install

内存分配调整:
vim /etc/security/limits.conf
* soft memlock 262144
* hard memlock 262144

开始挖矿:
cd bin/
./xmr-stak
 
1、输入0 回车
2、输入cryptonight_v7 回车    xmr-jp1.nanopool.org:14444
#矿池:https://help.nanopool.org/category/8-monero-xmr-pool
3、输入钱包地址 回车
4、输入 x 回车 或者直接 回车
5、直接回车
6、输入n 回车
7、输入n 回车
8、输入n 回车
 
实践:
[root@localhost bin]# ./xmr-stak

Use simple setup method? (Y/n)
n
Please enter:
- Do you want to use the HTTP interface?
Unlike the screen display, browser interface is not affected by the GPU lag.
#If you don't want to use it, please enter 0, otherwise enter port number that the miner should listen on
0
Configuration stored in file 'config.txt'
Please enter:
- Please enter the currency that you want to mine: 
    - bbscoin
    - bittube
    - cryptonight
    - cryptonight_bittube2
    - cryptonight_masari
    - cryptonight_haven
    - cryptonight_heavy
    - cryptonight_lite
    - cryptonight_lite_v7
    - cryptonight_lite_v7_xor
    - cryptonight_r
    - cryptonight_superfast
    - cryptonight_turtle
    - cryptonight_v7
    - cryptonight_v8
    - cryptonight_v8_double
    - cryptonight_v8_half
    - cryptonight_v8_reversewaltz
    - cryptonight_v8_zelerius
    - cryptonight_v7_stellite
    - cryptonight_gpu
    - cryptonight_conceal
    - graft
    - haven
    - lethean
    - masari
    - qrl
    - ryo
    - torque
    - plenteum
    - zelerius

cryptonight_v7
- Pool address: e.g. pool.example.com:3333
xmr-jp1.nanopool.org:14444
- Username (wallet address or pool login):
monero:48JoMFPaehYdzB1RQnvh7daftRr3QN8tVandRte8rRCiDNWSQiuY8h6A1dJRq3NuM3ZC3FcaviydmHoDSzYHuXuYRBr5A5b
- Password (mostly empty or x):
x
- Rig identifier for pool-side statistics (needs pool support). Can be empty:

- Does this pool port support TLS/SSL? Use no if unknown. (y/N)
n
- Do you want to use nicehash on this pool? (y/N)
n
- Do you want to use multiple pools? (y/N)
n
Pool configuration stored in file 'pools.txt'
-------------------------------------------------------------------
xmr-stak 2.10.8 67cf951

Brought to you by fireice_uk and psychocrypt under GPLv3.
Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).

Configurable dev donation level is set to 0.0%

-------------------------------------------------------------------
You can use following keys to display reports:
'h' - hashrate
'r' - results
'c' - connection
-------------------------------------------------------------------
Upcoming xmr-stak-gui is sponsored by:
   #####   ______               ____
 ##     ## | ___ \             /  _ \
#    _    #| |_/ /_   _   ___  | / \/ _   _  _ _  _ _  ___  _ __    ___  _   _
#   |_|   #|    /| | | | / _ \ | |   | | | || '_|| '_|/ _ \| '_ \  / __|| | | |
#         #| |\ \| |_| || (_) || \_/\| |_| || |  | | |  __/| | | || (__ | |_| |
 ##     ## \_| \_|\__, | \___/ \____/ \__,_||_|  |_|  \___||_| |_| \___| \__, |
   #####           __/ |                                                  __/ |
                  |___/   https://ryo-currency.com                       |___/

This currency is a way for us to implement the ideas that we were unable to in
Monero. See https://github.com/fireice-uk/cryptonote-speedup-demo for details.
-------------------------------------------------------------------
[2020-10-23 14:18:39] : Mining coin: cryptonight_v7
[2020-10-23 14:18:39] : CPU configuration stored in file 'cpu.txt'
[2020-10-23 14:18:39] : Starting 2x thread, affinity: 0.
[2020-10-23 14:18:39] : hwloc: memory pinned
[2020-10-23 14:18:39] : Starting 2x thread, affinity: 1.
[2020-10-23 14:18:39] : hwloc: memory pinned
[2020-10-23 14:18:39] : Starting 2x thread, affinity: 2.
[2020-10-23 14:18:39] : hwloc: memory pinned
[2020-10-23 14:18:39] : Starting 2x thread, affinity: 3.
[2020-10-23 14:18:39] : hwloc: memory pinned
[2020-10-23 14:18:39] : Fast-connecting to xmr-jp1.nanopool.org:14444 pool ...
[2020-10-23 14:18:39] : Pool xmr-jp1.nanopool.org:14444 connected. Logging in...
[2020-10-23 14:18:40] : Difficulty changed. Now: 480045.
[2020-10-23 14:18:40] : Pool logged in.
[2020-10-23 14:18:40] : New block detected.
[2020-10-23 14:19:26] : New block detected.
[2020-10-23 14:19:35] : New block detected.
[2020-10-23 14:20:36] : New block detected.
[2020-10-23 14:21:36] : New block detected.

运行后可按H键 查看 当前算力
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   16.0 |   15.7 |   (na) |  1 |   15.9 |   15.8 |   (na) |
|  2 |   16.0 |   15.8 |   (na) |  3 |   15.8 |   15.6 |   (na) |
Totals (CPU):    63.7   62.9    0.0 H/s
-----------------------------------------------------------------
Totals (ALL):     63.7   62.9    0.0 H/s
Highest:    64.5 H/s
-----------------------------------------------------------------
[2020-10-23 14:24:18] : New block detected.

执行完之后,机器将会开始挖矿。

但是如果需要后台常驻挖矿,可以先安装screen,之后再screen中运行挖矿程序:
yum  -y install screen
screen
./xmr-stak
之后ctrl+A,松开后按下d,实现后台挖矿。如果要查看screen的运行程序,可以输入

screen -ls

查看挖矿效率,可以进入nanopool,在右上角粘贴进自己的钱包地址之后搜索来查看挖矿结果
https://xmr.nanopool.org/#

# 后台运行
nohup ~/xmr-stak/build/bin/xmr-stak &

# 关闭
ps -a|grep xmr
kill PID

pool.supportxmr.com:5555

修改cpu
vim /root/xmr-stak/build/bin/cpu.txt
# 将cpu的0 1线程用来挖矿,具体的可以根据情况设置,安装时会自动配置,可不更改
"cpu_threads_conf" :
[
    { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 },
    { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 },
],

总结:cpu方式效率太低了,基本挖不到。

Centos XMR相关推荐

  1. Ubuntu 18.04 安装xmr

    同样的机器,安装xmrig不能用,会出现read error: "connection reset by peer " 尝试了好几次,都不行. 最后发现xmr-stak版本可以 步 ...

  2. 【XMR】/usr/bin/ld: 找不到 -lstdc++

    [XMR]/usr/bin/ld: 找不到 -lstdc++ 报错明细 问题分析 解决办法 后记 报错明细 安装了Centos8.4 minimal版后对xmrig挖矿程序进行无抽水编译,执行: ma ...

  3. 【CentOS】利用Kubeadm部署Kubernetes (K8s)

    [CentOS]利用Kubeadm部署Kubernetes (K8s)[阅读时间:约10分钟] 一.概述 二.系统环境&项目介绍 1.系统环境 2.项目的任务要求 三.具体实验流程 1 系统准 ...

  4. CentOS Docker安装配置部署Golang web helloworld

    目录[阅读时间:约5分钟] 一.Docker简介 二.Docker的安装与配置[CentOS环境] 三.Docker部署Golang web helloworld 四.Docker与虚拟机的区别 五. ...

  5. centos使用镜像源轻松配置golang+vscode的方法

    Title:centos使用镜像源轻松配置golang+vscode的方法 (阅读时间:约5分钟) 零.序言 最近笔者在上一门名为服务计算的课程,在老师的作业博客中提到,安装golang+vscode ...

  6. centos 7.4 上安装neo4j并测试

    安装 neo4j 社区地址如下: https://neo4j.com/download-center/#community 在centos上的安装过程如下(使用root权限): 获取官方的key cd ...

  7. CentOS 6.5 下配置Java环境

    工具 java JDK yum库 3.CentOS 6.5 方法/步骤 1: 查看CentOS自带的JDK是够已经安装. yum list installed |grep java 这里有相关的jav ...

  8. CentOS 安装docker.ce报错提示containerd.io >= 1.2.2-3问题

    centos安装docker.ce遇到报错,提示如下 # yum install -y docker-ce Last metadata expiration check: 0:01:49 ago on ...

  9. CentOS下Docker 安装

    一.前提 Docker 运行在 CentOS 7 上,要求系统为64位.系统内核版本为 3.10 以上. Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位 ...

最新文章

  1. SAP WM中阶之LT25确认Group中的TO单据
  2. 提高SQLite每秒INSERT的性能?
  3. 实验二 动态规划算法 最大字段和问题
  4. 小说里的lt什么意思_游戏cpdd网络用语是什么意思 王者荣耀里很常见
  5. 公钥和私钥 java_公钥与私钥 - yxhxj2006 - BlogJava
  6. php 内置mail 包,PHP使用pear自带的mail类库发邮件的方法
  7. 市面上有哪几种门_实木门、原木门、模压门,各有门道不怕坑!
  8. 剑指offer之机器人的运动轨迹
  9. [转载]用SQL语句添加删除修改字段
  10. 机器学习——卷积神经网络计算
  11. Jenkins任务配置详解,支持ssh远程部署,maven聚合项目,springboot
  12. 中达优控触摸屏编程视频教程_YKBuilder(中达优控触摸屏编程软件)下载
  13. 如何下载B站视频(方法持续更新)
  14. 使用xpath解析爬取链家
  15. 7-45 航空公司VIP客户查询 【哈希表 链地址法】
  16. python 招聘 海盐_聚焦普高新课标 提升信息核心素养——海盐县初中信息技术Python课堂教学研讨活动在武原中学举行...
  17. 2020中国网络安全年会论文发布 知道创宇ZoomEye引领全球网空测绘
  18. 【网络安全】CSRF漏洞详细解读
  19. 按照动物、宠物、猫和蜘蛛的关系,通过编程实现各自的关系并声明自己的属性和方法(C++)
  20. 文思海辉技术有限公司——流程管理架构平台应用

热门文章

  1. Google Earth Engine(GEE)——利用sentinel-2数据
  2. android反馈简书,Android HapticFeedback(触觉反馈)
  3. 清华深圳计算机科学,江勇(清华大学深圳研究生院教授)_百度百科
  4. 微软学生开发者峰会收获分享
  5. SRM管理系统是什么?能为企业带来什么效益
  6. 橡胶耐臭氧龟裂的静态拉伸试验,你知道吗?
  7. Unity 游戏皇家消消乐Android版
  8. ble mesh学习笔记(10)mesh网络各种key的应用
  9. github使用教程:通过git上传本地项目
  10. JavaScript_shoping++