这篇文章上次修改于 558 天前,可能其部分内容已经发生变化,如有疑问可询问作者。
近期成功申请到了Oracle cloud的账号,简单总结一下相关信息。
1.申请之前,关于区域选择可参考下:
- 是否容易申请到永久免费的区域说明:https://telegra.ph/oraclearm-03-22
- 如何选择区域,速度如何:https://telegra.ph/%E7%94%B2%E9%AA%A8%E6%96%87%E6%80%8E%E4%B9%88%E9%80%89%E5%8C%BA%E5%9F%9F%E6%80%8E%E4%B9%88%E6%B5%8B%E8%AF%95%E4%B8%8D%E5%90%8C%E5%8C%BA%E5%9F%9F%E7%9A%84%E9%80%9F%E5%BA%A6-02-27
2.免费账号与永久免费使用的说明
- 免费账号:新申请的账号试用期30天,并且获赠申请区域所在国家400金币,用于在创建相关收费服务时进行抵扣费用,举例:我创建了一下2核8G的Ubuntu实例,一天左右时间,收费1块多新加坡币
- 免费账号:只要不升级账号,那么在30天试用期过后,你开出的付费实例会自动停掉,并不会收取你的费用。
- 永久免费:需要在创建实例时,只有标识 Always Free-eligible 的才是永久免费的配置,并且每个人的限制是200G硬盘,4核、24G内存,但是单台要求最低47G硬盘,所以最多只能组合成4台。但目前来看,免费实例无法创建成功,报相关提示:
Out of capacity for shape VM.Standard.E2.1.Micro in availability domain AD-1. Create the instance in a different availability domain or try again later. If you specified a fault domain, try creating the instance without specifying a fault domain. If that doesn’t work, please try again later. Learn more about host capacity.
听说最近(2024年11月14日)只有孟买可以手工创建成功,其它区域都比较难,上网找解决方案,试试R探长脚本。
3.使用R探长甲骨文实例抢机操作步骤
详情可参考:https://telegra.ph/oracleR-Bot-03-04
核心步骤
- 创建api密钥
脚本操作创建api密钥:打开甲骨文oci ---> 打开cloud shell ---> 运行下面的语句:wget -N "https://raw.githubusercontent.com/jin-gubang/public/main/oracle_role_apiuser_policy.sh" --no-check-certificate && chmod +x oracle_role_apiuser_policy.sh && bash oracle_role_apiuser_policy.sh关于运行语句的内容及安全性,有能力的可以查看GitHub
https://github.com/jin-gubang/public/blob/main/oracle_role_apiuser_policy.sh
运行后的效果如下:ate && chmod +x oracle_role_apiuser_policy.sh && bash oracle_role_apiuser_policy.sh 2024-07-17 00:28:01-- https://raw.githubusercontent.com/jin-gubang/public/main/oracle_role_apiuser_policy.sh Resolving raw.githubusercontent.com (raw.githubusercontent.com).. 185.199.109.133, 185.199.110.133, 185.199.111.133, Connecting to raw-githubusercontent.com (raw-githubusercontent.com) |185.199.109.133|:443... connected. HTTP request sent, awaiting response... 200 0K Length: 4858 (4.7K) [text/plain] Last-modified header missing -- time-stamps turned off. 2024-07-17 00:28:01 https://raw.githubusercontent.com/jin-gubang/public/main/oracle_role_apiuser_policy-sh Reusing existing connection to raw.githubusercontent.com:443. HTTP request sent, awaiting response... 200 OK Length: 4858 (4.7K) [text/plain] Saving to: oracle_role_apiuser_policy.sh 2024-07-17 00:28:01 (50.5 MB/s) - oracle_role_apiuser_policy-sh' saved [4858/4858] 3A POCID: ocid1.tenancy.ocl..aaaaz 组创建成功 HE RA GI SU HATH 用户创建成功 用户添加到组成功 后续可手动在用户 User_for_Api_used 中态加 API密钥(无需登录该用户)结果创建出[策略][组][用户] ---> 找到用户[User_for_Api_used]创建密钥即可 ---> 收工。
- 在tg准备一个机器人准备收通知:
从 https://t.me/radiance_helper_bot 配置(bot可使用/raninfo命令随机生成)- 找一个服务器装一个抢机脚本
此处我用的是自已的AWS,使用官方教程->https://github.com/semicons/java_oci_manage/blob/main/md/install.md
主要关键点:
Linux一键安装/更新(运行完后使用bash sh_java_oci.sh可重启运行)
脚本并未创建文件夹 可手动创建文件夹方便管理 如:mkdir rbot && cd rbotwget -O sh_client_bot.sh https://github.com/semicons/java_oci_manage/releases/latest/download/sh_client_bot.sh && chmod +x sh_client_bot.sh && bash sh_client_bot.sh修改配置文件参数,按参数说明编辑client_config文件(model填写local为启动本地无公网IP模式)
其中我将配置改为了本地模式:local非必填 本机ip和端口号 (进阶玩家选项 可填写域名) 不写将自动获取本机ip 并使用默认端口号9527 (小白用户建议不填) 如填写 格式为:https://xxx.xx:9527 local_address=https://我的ip:9527 非必填 url名称(默认为address 可在bot上修改) local_url_name= 非必填 启动模式 填写local为启动本地无公网IP模式(只要能联网即可) 不填或填其他 则启动端口模式 model=local- 在tg机器人开始抢机操作;
- 进入耐心等待阶段,等待出号;
oracle 实例端口设置,oci控制放开端口
Oracle自带的镜像默认设置了Iptable规则,关闭:
sudo apt-get purge netfilter-persistent && sudo reboot